Classes | Public Member Functions | Protected Types | Protected Attributes | Friends | List of all members
variant_topic_tools::DataType Class Reference

Data type. More...

#include <DataType.h>

Inheritance diagram for variant_topic_tools::DataType:
Inheritance graph
[legend]

Classes

class  Impl
 Data type implementation. More...
 

Public Member Functions

void clear ()
 Clear the data type. More...
 
Serializer createSerializer () const
 Create a serializer for this data type. More...
 
Variant createVariant () const
 Create a variant from this data type. More...
 
 DataType ()
 Default constructor. More...
 
 DataType (const char *identifier)
 Constructor (overloaded version taking an identifier) More...
 
 DataType (const std::string &identifier)
 Constructor (overloaded version taking a string identifier) More...
 
 DataType (const std::type_info &typeInfo)
 Constructor (overloaded version taking type information) More...
 
 DataType (const DataType &src)
 Copy constructor. More...
 
const std::string & getIdentifier () const
 Retrieve the identifier representing this data type. More...
 
size_t getSize () const
 Retrieve the size of the instances of this data type. More...
 
const std::type_info & getTypeInfo () const
 Retrieve the type information associated with this data type. More...
 
bool hasTypeInfo () const
 True, if this data type has type information. More...
 
bool isArray () const
 True, if this data type represents an array type. More...
 
bool isBuiltin () const
 True, if this data type represents a built-in type. More...
 
bool isFixedSize () const
 True, if this data type represents a fixed-size data type, as opposed to a variable-size data type. More...
 
bool isMessage () const
 True, if this data type represents a message type. More...
 
bool isSimple () const
 True, if this data type represents a simple data type, i.e., a data type such that an array of its instances can safely be shallow copied. More...
 
bool isValid () const
 True, if this data type is valid. More...
 
 operator void * () const
 Void pointer conversion. More...
 
bool operator!= (const DataType &dataType) const
 Inequality comparison operator. More...
 
virtual DataTypeoperator= (const DataType &src)
 Assignment operator. More...
 
bool operator== (const DataType &dataType) const
 Equality comparison operator. More...
 
void write (std::ostream &stream) const
 Write the data type to a stream. More...
 
virtual ~DataType ()
 Destructor. More...
 

Protected Types

typedef boost::shared_ptr< boost::shared_ptr< Impl > > ImplPtr
 Declaration of the data type implementation pointer type. More...
 
typedef boost::shared_ptr< boost::weak_ptr< Impl > > ImplWPtr
 Declaration of the data type implementation weak pointer type. More...
 

Protected Attributes

ImplPtr impl
 The data type's implementation adapter. More...
 

Friends

class DataTypeHash
 
class DataTypeRegistry
 
class Serializer
 

Detailed Description

Data type.

Definition at line 36 of file DataType.h.

Member Typedef Documentation

Declaration of the data type implementation pointer type.

Note
This pointer uses two layers of indirection to allow for updating the underlying implementation for all instances of data type pointing to the same implementation.

Definition at line 217 of file DataType.h.

typedef boost::shared_ptr<boost::weak_ptr<Impl> > variant_topic_tools::DataType::ImplWPtr
protected

Declaration of the data type implementation weak pointer type.

Definition at line 222 of file DataType.h.

Constructor & Destructor Documentation

variant_topic_tools::DataType::DataType ( )

Default constructor.

Definition at line 33 of file DataType.cpp.

variant_topic_tools::DataType::DataType ( const char *  identifier)

Constructor (overloaded version taking an identifier)

Note
If the data type matching the specified identifier cannot be found in the data type registry, the instantiated data type will be invalid.

Definition at line 36 of file DataType.cpp.

variant_topic_tools::DataType::DataType ( const std::string &  identifier)

Constructor (overloaded version taking a string identifier)

Note
If the data type matching the specified identifier cannot be found in the data type registry, the instantiated data type will be invalid.

Definition at line 43 of file DataType.cpp.

variant_topic_tools::DataType::DataType ( const std::type_info &  typeInfo)

Constructor (overloaded version taking type information)

Note
If the data type matching the specified type information cannot be found in the data type registry, the instantiated data type will be invalid.

Definition at line 50 of file DataType.cpp.

variant_topic_tools::DataType::DataType ( const DataType src)

Copy constructor.

Definition at line 57 of file DataType.cpp.

variant_topic_tools::DataType::~DataType ( )
virtual

Destructor.

Definition at line 62 of file DataType.cpp.

Member Function Documentation

void variant_topic_tools::DataType::clear ( )

Clear the data type.

Definition at line 152 of file DataType.cpp.

Serializer variant_topic_tools::DataType::createSerializer ( ) const

Create a serializer for this data type.

Definition at line 161 of file DataType.cpp.

Variant variant_topic_tools::DataType::createVariant ( ) const

Create a variant from this data type.

Definition at line 168 of file DataType.cpp.

const std::string & variant_topic_tools::DataType::getIdentifier ( ) const

Retrieve the identifier representing this data type.

Definition at line 75 of file DataType.cpp.

size_t variant_topic_tools::DataType::getSize ( ) const

Retrieve the size of the instances of this data type.

Note
For variable-size data types, the reported size will be zero.

Definition at line 91 of file DataType.cpp.

const std::type_info & variant_topic_tools::DataType::getTypeInfo ( ) const

Retrieve the type information associated with this data type.

Note
If no type information is available for this data type, the type information for void will be returned.

Definition at line 84 of file DataType.cpp.

bool variant_topic_tools::DataType::hasTypeInfo ( ) const

True, if this data type has type information.

Definition at line 137 of file DataType.cpp.

bool variant_topic_tools::DataType::isArray ( ) const

True, if this data type represents an array type.

Definition at line 98 of file DataType.cpp.

bool variant_topic_tools::DataType::isBuiltin ( ) const

True, if this data type represents a built-in type.

Definition at line 105 of file DataType.cpp.

bool variant_topic_tools::DataType::isFixedSize ( ) const

True, if this data type represents a fixed-size data type, as opposed to a variable-size data type.

Definition at line 119 of file DataType.cpp.

bool variant_topic_tools::DataType::isMessage ( ) const

True, if this data type represents a message type.

Definition at line 112 of file DataType.cpp.

bool variant_topic_tools::DataType::isSimple ( ) const

True, if this data type represents a simple data type, i.e., a data type such that an array of its instances can safely be shallow copied.

Definition at line 126 of file DataType.cpp.

bool variant_topic_tools::DataType::isValid ( ) const

True, if this data type is valid.

Definition at line 133 of file DataType.cpp.

variant_topic_tools::DataType::operator void * ( ) const
inline

Void pointer conversion.

Definition at line 147 of file DataType.h.

bool variant_topic_tools::DataType::operator!= ( const DataType dataType) const
inline

Inequality comparison operator.

Definition at line 160 of file DataType.h.

DataType & variant_topic_tools::DataType::operator= ( const DataType src)
virtual
bool variant_topic_tools::DataType::operator== ( const DataType dataType) const
inline

Equality comparison operator.

Definition at line 153 of file DataType.h.

void variant_topic_tools::DataType::write ( std::ostream &  stream) const

Write the data type to a stream.

Definition at line 156 of file DataType.cpp.

Friends And Related Function Documentation

friend class DataTypeHash
friend

Definition at line 37 of file DataType.h.

friend class DataTypeRegistry
friend

Definition at line 38 of file DataType.h.

friend class Serializer
friend

Definition at line 39 of file DataType.h.

Member Data Documentation

ImplPtr variant_topic_tools::DataType::impl
protected

The data type's implementation adapter.

Definition at line 226 of file DataType.h.


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


variant_topic_tools
Author(s): Ralf Kaestner
autogenerated on Sat Jan 9 2021 03:56:50