retdec
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
retdec::ctypes::PointerType Class Reference

A representation of pointer types. More...

#include <pointer_type.h>

Inheritance diagram for retdec::ctypes::PointerType:
Inheritance graph
[legend]
Collaboration diagram for retdec::ctypes::PointerType:
Collaboration graph
[legend]

Public Member Functions

std::shared_ptr< TypegetPointedType () const
 Returns pointed type. More...
 
virtual bool isPointer () const override
 
Visitor interface.
virtual void accept (Visitor *v) override
 Visitor pattern implementation. More...
 
- Public Member Functions inherited from retdec::ctypes::Type
virtual ~Type ()=default
 
const std::string & getName () const
 
unsigned getBitWidth () const
 
virtual bool isArray () const
 
virtual bool isEnum () const
 
virtual bool isFloatingPoint () const
 
virtual bool isFunction () const
 
virtual bool isIntegral () const
 
virtual bool isNamed () 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< PointerTypecreate (const std::shared_ptr< Context > &context, const std::shared_ptr< Type > &pointedType, unsigned bitWidth=0)
 Creates pointer type. More...
 

Private Member Functions

 PointerType (const std::shared_ptr< Type > &pointedType, unsigned bitWidth=0)
 Constructs a new pointer type. More...
 

Private Attributes

std::shared_ptr< TypepointedType
 

Additional Inherited Members

- Protected Member Functions inherited from retdec::ctypes::Type
 Type ()=default
 
 Type (const std::string &name, unsigned bitWidth)
 Constructs a new type. More...
 
- Protected Member Functions inherited from retdec::ctypes::Visitable
 Visitable ()=default
 
 ~Visitable ()=default
 
- Protected Attributes inherited from retdec::ctypes::Type
std::string name
 
unsigned bitWidth
 

Detailed Description

A representation of pointer types.

Constructor & Destructor Documentation

◆ PointerType()

retdec::ctypes::PointerType::PointerType ( const std::shared_ptr< Type > &  pointedType,
unsigned  bitWidth = 0 
)
private

Constructs a new pointer type.

Member Function Documentation

◆ accept()

void retdec::ctypes::PointerType::accept ( Visitor v)
overridevirtual

Visitor pattern implementation.

Subclasses should implement this method as:

v->visit(std::static_pointer_cast<T>(std::shared_from_this()));

where T is the name of the subclass.

Implements retdec::ctypes::Visitable.

◆ create()

std::shared_ptr< PointerType > retdec::ctypes::PointerType::create ( const std::shared_ptr< Context > &  context,
const std::shared_ptr< Type > &  pointedType,
unsigned  bitWidth = 0 
)
static

Creates pointer type.

Parameters
contextStorage for already created functions, types.
pointedTypeType that this pointer points to.
bitWidthNumber of bits used by this type.
Preconditions
  • context is not null
  • pointedType is not null

Does not create new pointer type, if one has already been created and stored in context.

◆ getPointedType()

std::shared_ptr< Type > retdec::ctypes::PointerType::getPointedType ( ) const

Returns pointed type.

◆ isPointer()

bool retdec::ctypes::PointerType::isPointer ( ) const
overridevirtual

Returns true when Type is pointer, false otherwise.

Reimplemented from retdec::ctypes::Type.

Member Data Documentation

◆ pointedType

std::shared_ptr<Type> retdec::ctypes::PointerType::pointedType
private

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