1 //===-- OptionValueSInt64.h --------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_OptionValueSInt64_h_
11 #define liblldb_OptionValueSInt64_h_
15 // Other libraries and framework includes
17 #include "lldb/Interpreter/OptionValue.h"
19 namespace lldb_private {
21 class OptionValueSInt64 : public OptionValue
24 OptionValueSInt64 () :
28 m_min_value (INT64_MIN),
29 m_max_value (INT64_MAX)
33 OptionValueSInt64 (int64_t value) :
35 m_current_value (value),
36 m_default_value (value),
37 m_min_value (INT64_MIN),
38 m_max_value (INT64_MAX)
42 OptionValueSInt64 (int64_t current_value,
43 int64_t default_value) :
45 m_current_value (current_value),
46 m_default_value (default_value),
47 m_min_value (INT64_MIN),
48 m_max_value (INT64_MAX)
52 OptionValueSInt64 (const OptionValueSInt64 &rhs) :
54 m_current_value (rhs.m_current_value),
55 m_default_value (rhs.m_default_value),
56 m_min_value (rhs.m_min_value),
57 m_max_value (rhs.m_max_value)
66 //---------------------------------------------------------------------
67 // Virtual subclass pure virtual overrides
68 //---------------------------------------------------------------------
70 virtual OptionValue::Type
77 DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask);
80 SetValueFromCString (const char *value,
81 VarSetOperationType op = eVarSetOperationAssign);
86 m_current_value = m_default_value;
87 m_value_was_set = false;
91 virtual lldb::OptionValueSP
94 //---------------------------------------------------------------------
95 // Subclass specific functions
96 //---------------------------------------------------------------------
99 operator = (int64_t value)
101 m_current_value = value;
102 return m_current_value;
106 GetCurrentValue() const
108 return m_current_value;
112 GetDefaultValue() const
114 return m_default_value;
118 SetCurrentValue (int64_t value)
120 if (value >= m_min_value && value <= m_max_value)
122 m_current_value = value;
129 SetDefaultValue (int64_t value)
131 if (value >= m_min_value && value <= m_max_value)
133 m_default_value = value;
140 SetMinimumValue (int64_t v)
146 GetMinimumValue () const
152 SetMaximumValue (int64_t v)
158 GetMaximumValue () const
164 int64_t m_current_value;
165 int64_t m_default_value;
170 } // namespace lldb_private
172 #endif // liblldb_OptionValueSInt64_h_