ICG 2
Electric Boogaloo
Public Member Functions | List of all members
DataType Class Referenceabstract

Abstract base class for DataTypes. More...

#include <DataType.hpp>

Inheritance diagram for DataType:
ArrayDataType CompositeDataType EnumDataType PointerDataType PrimitiveDataType SequenceDataType StringDataType SpecifiedCompositeType< T > SpecifiedPrimitiveDataType< T > SpecifiedSequenceDataType< T >

Public Member Functions

virtual ~DataType ()
 
virtual bool validate (DataTypeInator *dataTypeInator)=0
 Verify that all of the types that are named by this DataType or subordinate DataTypes are resolvable to actual DataTypes in the TypeDictionary. More...
 
virtual bool isValid () const =0
 Determine whether this type has already been successfully validated. More...
 
virtual size_t getSize () const =0
 The size (in bytes) of an instance of the DataType. More...
 
virtual std::string getTypeSpecName () const =0
 Get the Type Spec Name object. More...
 
virtual void * createInstance (unsigned int n=1) const =0
 Create one or more instances of this type. More...
 
virtual void deleteInstance (void *address) const =0
 Delete this instance. More...
 
virtual std::string makeDeclaration (std::string declarator) const
 
virtual std::string toString () const
 
virtual bool accept (DataTypeVisitor *visitor) const =0
 

Detailed Description

Abstract base class for DataTypes.

Constructor & Destructor Documentation

◆ ~DataType()

virtual DataType::~DataType ( )
inlinevirtual

Member Function Documentation

◆ accept()

virtual bool DataType::accept ( DataTypeVisitor visitor) const
pure virtual

◆ createInstance()

virtual void* DataType::createInstance ( unsigned int  n = 1) const
pure virtual

Create one or more instances of this type.

Parameters
nnumber to create
Returns
void* address of the beginnning of the allocation

Implemented in StringDataType, SpecifiedPrimitiveDataType< T >, SequenceDataType, PointerDataType, EnumDataType, CompositeDataType, ArrayDataType, SpecifiedPrimitiveDataType< T >, and SpecifiedPrimitiveDataType< T >.

◆ deleteInstance()

virtual void DataType::deleteInstance ( void *  address) const
pure virtual

Delete this instance.

Parameters
addressof instance to delete
Note
Is this compatible with the createInstance?

Implemented in StringDataType, SpecifiedPrimitiveDataType< T >, SequenceDataType, PointerDataType, EnumDataType, CompositeDataType, ArrayDataType, SpecifiedPrimitiveDataType< T >, and SpecifiedPrimitiveDataType< T >.

◆ getSize()

virtual size_t DataType::getSize ( ) const
pure virtual

◆ getTypeSpecName()

virtual std::string DataType::getTypeSpecName ( ) const
pure virtual

◆ isValid()

virtual bool DataType::isValid ( ) const
pure virtual

Determine whether this type has already been successfully validated.

Returns
true if validated, false otherwise

Implemented in StringDataType, SpecifiedPrimitiveDataType< T >, SequenceDataType, PointerDataType, EnumDataType, CompositeDataType, and ArrayDataType.

◆ makeDeclaration()

std::string DataType::makeDeclaration ( std::string  declarator) const
virtual

Generate a declaration of this DataType.

Parameters
declaratorA declarator, which can be a 1) a variable name or an array declarator (both are direct-declarators) or 2) a pointer declarator ( not a direct-declarator ).

Reimplemented in SequenceDataType, PointerDataType, and ArrayDataType.

◆ toString()

std::string DataType::toString ( ) const
virtual

Generate a definition of this DataType.

Reimplemented in EnumDataType, and CompositeDataType.

◆ validate()

virtual bool DataType::validate ( DataTypeInator dataTypeInator)
pure virtual

Verify that all of the types that are named by this DataType or subordinate DataTypes are resolvable to actual DataTypes in the TypeDictionary.

Parameters
dataTypeInator- type resolver machine
Returns
true if successful, false otherwise

Implemented in StringDataType, SpecifiedPrimitiveDataType< T >, EnumDataType, SequenceDataType, PointerDataType, CompositeDataType, and ArrayDataType.


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