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

A representation of custom types. Named type represents class types and instatiated template class types, when only name of the type is known. More...

#include <named_type.h>

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

Public Member Functions

bool isNamed () const override
 
Visitor interface.
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 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< NamedTypecreate (const std::shared_ptr< Context > &context, const std::string &name)
 Creates named type. More...
 

Private Member Functions

 NamedType (const std::string &name)
 Constructs new NamedType. More...
 

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 custom types. Named type represents class types and instatiated template class types, when only name of the type is known.

Constructor & Destructor Documentation

◆ NamedType()

retdec::ctypes::NamedType::NamedType ( const std::string &  name)
explicitprivate

Constructs new NamedType.

Member Function Documentation

◆ accept()

void retdec::ctypes::NamedType::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< NamedType > retdec::ctypes::NamedType::create ( const std::shared_ptr< Context > &  context,
const std::string &  name 
)
static

Creates named type.

Parameters
contextStorage for already created functions, types.
nameName of new named type.
Preconditions
  • context is not null

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

◆ isNamed()

bool retdec::ctypes::NamedType::isNamed ( ) const
overridevirtual

Returns true when Type is class, false otherwise.

Reimplemented from retdec::ctypes::Type.


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