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

A representation of L-Value and R-Value reference types. More...

#include <reference_type.h>

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

Public Member Functions

std::shared_ptr< TypegetReferencedType () const
 Returns referencedType. More...
 
bool isReference () 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 isPointer () 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< ReferenceTypecreate (const std::shared_ptr< Context > &context, const std::shared_ptr< Type > &referencedType, unsigned bitWidth=0)
 

Private Member Functions

 ReferenceType (const std::shared_ptr< Type > &referencedType, unsigned bitWidth=0)
 Constructs new reference type. More...
 

Private Attributes

std::shared_ptr< TypereferencedType
 

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 L-Value and R-Value reference types.

Constructor & Destructor Documentation

◆ ReferenceType()

retdec::ctypes::ReferenceType::ReferenceType ( const std::shared_ptr< Type > &  referencedType,
unsigned  bitWidth = 0 
)
explicitprivate

Constructs new reference type.

Member Function Documentation

◆ accept()

void retdec::ctypes::ReferenceType::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< ReferenceType > retdec::ctypes::ReferenceType::create ( const std::shared_ptr< Context > &  context,
const std::shared_ptr< Type > &  referencedType,
unsigned  bitWidth = 0 
)
static

Creates reference type.

Parameters
contextStorage for already created functions, types.
referencedTypeType that reference references.
bitWidthNumber of bits used by this type.
Preconditions
  • context is not null
  • referencedType is not null

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

◆ getReferencedType()

std::shared_ptr< Type > retdec::ctypes::ReferenceType::getReferencedType ( ) const

Returns referencedType.

◆ isReference()

bool retdec::ctypes::ReferenceType::isReference ( ) const
overridevirtual

Returns true when Type is pointer, false otherwise.

Reimplemented from retdec::ctypes::Type.

Member Data Documentation

◆ referencedType

std::shared_ptr<Type> retdec::ctypes::ReferenceType::referencedType
private

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