retdec
|
A representation of array types. More...
#include <array_type.h>
Public Types | |
using | DimensionType = std::size_t |
using | Dimensions = std::vector< DimensionType > |
Public Member Functions | |
std::shared_ptr< Type > | getElementType () const |
Returns element type. More... | |
const Dimensions & | getDimensions () const |
Returns array's dimensions. More... | |
Dimensions::size_type | getDimensionCount () const |
Returns array's dimensions count. More... | |
virtual bool | isArray () const override |
Returns true when Type is array, false otherwise. 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 | isEnum () 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< ArrayType > | create (const std::shared_ptr< Context > &context, const std::shared_ptr< Type > &elementType, const Dimensions &dimensions) |
Creates array type. More... | |
Static Public Attributes | |
static const DimensionType | UNKNOWN_DIMENSION = 0 |
Value used for unknown dimension. More... | |
Private Member Functions | |
ArrayType (const std::shared_ptr< Type > &elementType, const Dimensions &dimensions) | |
Constructs a new array type. More... | |
Private Attributes | |
std::shared_ptr< Type > | elementType |
Dimensions | dimensions |
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 array types.
using retdec::ctypes::ArrayType::Dimensions = std::vector<DimensionType> |
using retdec::ctypes::ArrayType::DimensionType = std::size_t |
|
private |
Constructs a new array 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 array type.
context | Storage for already created functions, types. |
elementType | Type that this array contains. |
dimensions | Array's dimensions. |
Does not create new array type, if one has already been created and stored in context
.
ArrayType::Dimensions::size_type retdec::ctypes::ArrayType::getDimensionCount | ( | ) | const |
Returns array's dimensions count.
const ArrayType::Dimensions & retdec::ctypes::ArrayType::getDimensions | ( | ) | const |
Returns array's dimensions.
std::shared_ptr< Type > retdec::ctypes::ArrayType::getElementType | ( | ) | const |
Returns element type.
|
overridevirtual |
Returns true
when Type is array, false
otherwise.
Reimplemented from retdec::ctypes::Type.
|
private |
|
private |
|
static |
Value used for unknown dimension.
Sets unknown dimension's value.