LLDB mainline
lldb_private::OptionValueEnumeration Class Reference

#include <OptionValueEnumeration.h>

Inheritance diagram for lldb_private::OptionValueEnumeration:
[legend]

Classes

struct  EnumeratorInfo

Public Types

typedef int64_t enum_type
typedef UniqueCStringMap< EnumeratorInfo > EnumerationMap
typedef EnumerationMap::Entry EnumerationMapEntry
Public Types inherited from lldb_private::OptionValue
enum  Type {
  eTypeInvalid = 0 , eTypeArch , eTypeArgs , eTypeArray ,
  eTypeBoolean , eTypeChar , eTypeDictionary , eTypeEnum ,
  eTypeFileLineColumn , eTypeFileSpec , eTypeFileSpecList , eTypeFormat ,
  eTypeLanguage , eTypePathMap , eTypeProperties , eTypeRegex ,
  eTypeSInt64 , eTypeString , eTypeUInt64 , eTypeUUID ,
  eTypeFormatEntity
}
enum  {
  eDumpOptionName = (1u << 0) , eDumpOptionType = (1u << 1) , eDumpOptionValue = (1u << 2) , eDumpOptionDescription = (1u << 3) ,
  eDumpOptionRaw = (1u << 4) , eDumpOptionCommand = (1u << 5) , eDumpOptionDefaultValue = (1u << 6) , eDumpOptionOnlyChanged = (1u << 7) ,
  eDumpGroupValue = (eDumpOptionName | eDumpOptionType | eDumpOptionValue) , eDumpGroupHelp , eDumpGroupExport = (eDumpOptionCommand | eDumpOptionName | eDumpOptionValue)
}

Public Member Functions

 OptionValueEnumeration (const OptionEnumValues &enumerators, enum_type value)
 ~OptionValueEnumeration () override=default
OptionValue::Type GetType () const override
void DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask) override
llvm::json::Value ToJSON (const ExecutionContext *exe_ctx) const override
Status SetValueFromString (llvm::StringRef value, VarSetOperationType op=eVarSetOperationAssign) override
bool IsDefault () const override
 Return true if the current value equals the default value.
void AutoComplete (CommandInterpreter &interpreter, CompletionRequest &request) override
enum_type operator= (enum_type value)
enum_type GetCurrentValue () const
enum_type GetDefaultValue () const
void SetCurrentValue (enum_type value)
void SetDefaultValue (enum_type value)
Public Member Functions inherited from lldb_private::Cloneable< OptionValueEnumeration, OptionValue >
std::shared_ptr< typename OptionValue::TopmostBase > Clone () const override
Public Member Functions inherited from lldb_private::OptionValue
 OptionValue ()=default
virtual ~OptionValue ()=default
 OptionValue (const OptionValue &other)
OptionValue & operator= (const OptionValue &other)
virtual bool ValueIsTransparent () const
virtual const char * GetTypeAsCString () const
void Clear ()
virtual lldb::OptionValueSP DeepCopy (const lldb::OptionValueSP &new_parent) const
virtual lldb::OptionValueSP GetSubValue (const ExecutionContext *exe_ctx, llvm::StringRef name, Status &error) const
virtual Status SetSubValue (const ExecutionContext *exe_ctx, VarSetOperationType op, llvm::StringRef name, llvm::StringRef value)
virtual bool IsAggregateValue () const
virtual llvm::StringRef GetName () const
virtual bool DumpQualifiedName (Stream &strm, std::optional< Stream::HighlightSettings > highlight=std::nullopt) const
uint32_t GetTypeAsMask ()
OptionValueArch * GetAsArch ()
const OptionValueArch * GetAsArch () const
OptionValueArray * GetAsArray ()
const OptionValueArray * GetAsArray () const
OptionValueArgs * GetAsArgs ()
const OptionValueArgs * GetAsArgs () const
OptionValueBoolean * GetAsBoolean ()
const OptionValueBoolean * GetAsBoolean () const
OptionValueChar * GetAsChar ()
const OptionValueChar * GetAsChar () const
OptionValueDictionary * GetAsDictionary ()
const OptionValueDictionary * GetAsDictionary () const
OptionValueEnumeration * GetAsEnumeration ()
const OptionValueEnumeration * GetAsEnumeration () const
OptionValueFileSpec * GetAsFileSpec ()
const OptionValueFileSpec * GetAsFileSpec () const
OptionValueFileSpecList * GetAsFileSpecList ()
const OptionValueFileSpecList * GetAsFileSpecList () const
OptionValueFormat * GetAsFormat ()
const OptionValueFormat * GetAsFormat () const
OptionValueLanguage * GetAsLanguage ()
const OptionValueLanguage * GetAsLanguage () const
OptionValuePathMappings * GetAsPathMappings ()
const OptionValuePathMappings * GetAsPathMappings () const
OptionValueProperties * GetAsProperties ()
const OptionValueProperties * GetAsProperties () const
OptionValueRegex * GetAsRegex ()
const OptionValueRegex * GetAsRegex () const
OptionValueSInt64 * GetAsSInt64 ()
const OptionValueSInt64 * GetAsSInt64 () const
OptionValueString * GetAsString ()
const OptionValueString * GetAsString () const
OptionValueUInt64 * GetAsUInt64 ()
const OptionValueUInt64 * GetAsUInt64 () const
OptionValueUUID * GetAsUUID ()
const OptionValueUUID * GetAsUUID () const
OptionValueFormatEntity * GetAsFormatEntity ()
const OptionValueFormatEntity * GetAsFormatEntity () const
bool AppendFileSpecValue (FileSpec file_spec)
bool OptionWasSet () const
void SetOptionWasSet ()
void SetParent (const lldb::OptionValueSP &parent_sp)
lldb::OptionValueSP GetParent () const
void SetValueChangedCallback (std::function< void()> callback)
void NotifyValueChanged ()
template<typename T, std::enable_if_t<!std::is_pointer_v< T >, bool > = true>
std::optional< T > GetValueAs () const
template<typename T, typename U = typename std::remove_const< typename std::remove_pointer<T>::type>::type, std::enable_if_t< std::is_pointer_v< T >, bool > = true>
T GetValueAs () const
bool SetValueAs (bool v)
bool SetValueAs (char v)
bool SetValueAs (uint64_t v)
bool SetValueAs (int64_t v)
bool SetValueAs (UUID v)
bool SetValueAs (llvm::StringRef v)
bool SetValueAs (lldb::LanguageType v)
bool SetValueAs (lldb::Format v)
bool SetValueAs (FileSpec v)
bool SetValueAs (ArchSpec v)
bool SetValueAs (const FormatEntity::Entry &v)
template<typename T, std::enable_if_t< std::is_enum_v< T >, bool > = true>
bool SetValueAs (T t)

Protected Member Functions

void SetEnumerations (const OptionEnumValues &enumerators)
void DumpEnum (Stream &strm, enum_type value)
void ClearImpl () override

Protected Attributes

enum_type m_current_value
enum_type m_default_value
EnumerationMap m_enumerations
Protected Attributes inherited from lldb_private::OptionValue
lldb::OptionValueWP m_parent_wp
std::function< void()> m_callback
bool m_value_was_set = false
std::mutex m_mutex

Additional Inherited Members

Static Public Member Functions inherited from lldb_private::OptionValue
static const char * GetBuiltinTypeAsCString (Type t)
static uint32_t ConvertTypeToMask (OptionValue::Type type)
static OptionValue::Type ConvertTypeMaskToType (uint32_t type_mask)
static lldb::OptionValueSP CreateValueFromCStringForTypeMask (const char *value_cstr, uint32_t type_mask, Status &error)
Protected Types inherited from lldb_private::OptionValue
using TopmostBase = OptionValue

Detailed Description

Definition at line 22 of file OptionValueEnumeration.h.

Member Typedef Documentation

◆ enum_type

◆ EnumerationMap

◆ EnumerationMapEntry

Definition at line 31 of file OptionValueEnumeration.h.

Constructor & Destructor Documentation

◆ OptionValueEnumeration()

OptionValueEnumeration::OptionValueEnumeration ( const OptionEnumValues & enumerators,
enum_type value )

Definition at line 17 of file OptionValueEnumeration.cpp.

References m_current_value, m_default_value, and SetEnumerations().

◆ ~OptionValueEnumeration()

lldb_private::OptionValueEnumeration::~OptionValueEnumeration ( )
overridedefault

Member Function Documentation

◆ AutoComplete()

◆ ClearImpl()

void lldb_private::OptionValueEnumeration::ClearImpl ( )
inlineoverrideprotectedvirtual

◆ DumpEnum()

void OptionValueEnumeration::DumpEnum ( Stream & strm,
enum_type value )
protected

◆ DumpValue()

◆ GetCurrentValue()

enum_type lldb_private::OptionValueEnumeration::GetCurrentValue ( ) const
inline

Definition at line 62 of file OptionValueEnumeration.h.

References m_current_value.

◆ GetDefaultValue()

enum_type lldb_private::OptionValueEnumeration::GetDefaultValue ( ) const
inline

Definition at line 64 of file OptionValueEnumeration.h.

References m_default_value.

◆ GetType()

OptionValue::Type lldb_private::OptionValueEnumeration::GetType ( ) const
inlineoverridevirtual

◆ IsDefault()

bool lldb_private::OptionValueEnumeration::IsDefault ( ) const
inlineoverridevirtual

Return true if the current value equals the default value.

Subclasses that store a default value should override this to compare against it. The base implementation falls back to OptionWasSet(), which is a reasonable approximation for types without an explicit default.

Reimplemented from lldb_private::OptionValue.

Definition at line 50 of file OptionValueEnumeration.h.

References m_current_value, and m_default_value.

◆ operator=()

enum_type lldb_private::OptionValueEnumeration::operator= ( enum_type value)
inline

Definition at line 57 of file OptionValueEnumeration.h.

References m_current_value.

◆ SetCurrentValue()

void lldb_private::OptionValueEnumeration::SetCurrentValue ( enum_type value)
inline

Definition at line 66 of file OptionValueEnumeration.h.

References m_current_value.

◆ SetDefaultValue()

void lldb_private::OptionValueEnumeration::SetDefaultValue ( enum_type value)
inline

Definition at line 68 of file OptionValueEnumeration.h.

References m_default_value.

◆ SetEnumerations()

void OptionValueEnumeration::SetEnumerations ( const OptionEnumValues & enumerators)
protected

Definition at line 105 of file OptionValueEnumeration.cpp.

References m_enumerations.

Referenced by OptionValueEnumeration().

◆ SetValueFromString()

◆ ToJSON()

llvm::json::Value OptionValueEnumeration::ToJSON ( const ExecutionContext * exe_ctx) const
overridevirtual

Implements lldb_private::OptionValue.

Definition at line 51 of file OptionValueEnumeration.cpp.

References m_current_value, and m_enumerations.

Member Data Documentation

◆ m_current_value

enum_type lldb_private::OptionValueEnumeration::m_current_value
protected

◆ m_default_value

enum_type lldb_private::OptionValueEnumeration::m_default_value
protected

◆ m_enumerations

EnumerationMap lldb_private::OptionValueEnumeration::m_enumerations
protected

The documentation for this class was generated from the following files: