retdec
|
A representation of enum type. More...
#include <enum_type.h>
Classes | |
class | Value |
A representation of enum value. More... | |
Public Types | |
using | Values = std::vector< Value > |
using | iterator = Values::iterator |
using | const_iterator = Values::const_iterator |
Public Member Functions | |
virtual bool | isEnum () const override |
Enum type values. | |
iterator | value_begin () |
Returns an iterator to the enum value. More... | |
const_iterator | value_begin () const |
Returns a constant iterator to the enum value. More... | |
iterator | value_end () |
Returns an iterator past the last enum value. More... | |
const_iterator | value_end () const |
Returns a constant iterator past the last enum value. More... | |
Values::size_type | getValueCount () const |
Returns number of enum's values. More... | |
const Value & | getValue (Values::size_type index) const |
Returns n-th value. More... | |
Visitor interface. | |
virtual void | accept (Visitor *v) override |
Visitor pattern implementation. More... | |
![]() | |
virtual | ~Type ()=default |
const std::string & | getName () const |
unsigned | getBitWidth () const |
virtual bool | isArray () const |
virtual bool | isFloatingPoint () const |
virtual bool | isFunction () const |
virtual bool | isIntegral () const |
virtual bool | isNamed () const |
virtual bool | isPointer () const |
virtual bool | isReference () const |
virtual bool | isStruct () const |
virtual bool | isTypedef () const |
virtual bool | isUnion () const |
virtual bool | isUnknown () const |
virtual bool | isVoid () const |
Static Public Member Functions | |
static std::shared_ptr< EnumType > | create (const std::shared_ptr< Context > &context, const std::string &name, const Values &values) |
Creates enum type. More... | |
Static Public Attributes | |
static const Value::ValueType | DEFAULT_VALUE |
Value used for unknown values. More... | |
Private Member Functions | |
EnumType (const std::string &name, const Values &values) | |
Constructs a new enum type. More... | |
Private Attributes | |
Values | values |
Additional Inherited Members | |
![]() | |
Type ()=default | |
Type (const std::string &name, unsigned bitWidth) | |
Constructs a new type. More... | |
![]() | |
Visitable ()=default | |
~Visitable ()=default | |
![]() | |
std::string | name |
unsigned | bitWidth |
A representation of enum type.
using retdec::ctypes::EnumType::const_iterator = Values::const_iterator |
using retdec::ctypes::EnumType::iterator = Values::iterator |
using retdec::ctypes::EnumType::Values = std::vector<Value> |
|
private |
Constructs a new enum type.
|
overridevirtual |
Visitor pattern implementation.
Subclasses should implement this method as:
where T
is the name of the subclass.
Implements retdec::ctypes::Visitable.
|
static |
Creates enum type.
context | Storage for already created functions, types. |
name | Name of new enum type. |
values | Enum values. |
Does not create new enum type, if one has already been created and stored in context
.
const EnumType::Value & retdec::ctypes::EnumType::getValue | ( | Values::size_type | n | ) | const |
Returns n-th value.
0 < n <= ValueCount
EnumType::Values::size_type retdec::ctypes::EnumType::getValueCount | ( | ) | const |
Returns number of enum's values.
|
overridevirtual |
Returns true
when Type is enum, false
otherwise.
Reimplemented from retdec::ctypes::Type.
EnumType::iterator retdec::ctypes::EnumType::value_begin | ( | ) |
Returns an iterator to the enum value.
EnumType::const_iterator retdec::ctypes::EnumType::value_begin | ( | ) | const |
Returns a constant iterator to the enum value.
EnumType::iterator retdec::ctypes::EnumType::value_end | ( | ) |
Returns an iterator past the last enum value.
EnumType::const_iterator retdec::ctypes::EnumType::value_end | ( | ) | const |
Returns a constant iterator past the last enum value.
|
static |
Value used for unknown values.
Sets default enum value.
|
private |