7 #ifndef RETDEC_CTYPES_ENUM_TYPE_H
8 #define RETDEC_CTYPES_ENUM_TYPE_H
38 const std::string &
getName()
const;
59 static std::shared_ptr<EnumType>
create(
const std::shared_ptr<Context> &context,
72 virtual bool isEnum()
const override;
A representation of enum value.
Definition: enum_type.h:30
std::string name
Definition: enum_type.h:45
ValueType value
Definition: enum_type.h:46
bool operator==(const Value &other) const
Definition: enum_type.cpp:49
std::int64_t ValueType
Type of enum value.
Definition: enum_type.h:33
const std::string & getName() const
Returns enum value's name.
Definition: enum_type.cpp:36
Value(const std::string &name, ValueType value)
Constructs a new enum value.
Definition: enum_type.cpp:26
bool operator!=(const Value &other) const
Definition: enum_type.cpp:54
ValueType getValue() const
Returns enum value's value.
Definition: enum_type.cpp:44
A representation of enum type.
Definition: enum_type.h:25
static std::shared_ptr< EnumType > create(const std::shared_ptr< Context > &context, const std::string &name, const Values &values)
Creates enum type.
Definition: enum_type.cpp:123
virtual void accept(Visitor *v) override
Visitor pattern implementation.
Definition: enum_type.cpp:148
std::vector< Value > Values
Definition: enum_type.h:54
Values values
Definition: enum_type.h:83
iterator value_end()
Returns an iterator past the last enum value.
Definition: enum_type.cpp:78
iterator value_begin()
Returns an iterator to the enum value.
Definition: enum_type.cpp:62
Values::iterator iterator
Definition: enum_type.h:55
Values::const_iterator const_iterator
Definition: enum_type.h:56
Values::size_type getValueCount() const
Returns number of enum's values.
Definition: enum_type.cpp:94
static const Value::ValueType DEFAULT_VALUE
Value used for unknown values.
Definition: enum_type.h:51
EnumType(const std::string &name, const Values &values)
Constructs a new enum type.
Definition: enum_type.cpp:20
virtual bool isEnum() const override
Definition: enum_type.cpp:143
const Value & getValue(Values::size_type index) const
Returns n-th value.
Definition: enum_type.cpp:105
A base class of all C types.
Definition: type.h:22
std::string name
Definition: type.h:48
A base class of all C-types' visitors.
Definition: visitor.h:33
A base class of all C types.
Definition: archive_wrapper.h:19