Classes | Public Member Functions | Protected Types | Protected Attributes | Friends
variant_topic_tools::DataType Class Reference

Data type. More...

#include <DataType.h>

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

List of all members.

Classes

class  Impl
 Data type implementation. More...

Public Member Functions

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

Protected Types

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

Protected Attributes

ImplPtr impl
 The data type's implementation adapter.

Friends

class DataTypeHash
class DataTypeRegistry
class Serializer

Detailed Description

Data type.

Definition at line 36 of file DataType.h.


Member Typedef Documentation

typedef boost::shared_ptr<boost::shared_ptr<Impl> > variant_topic_tools::DataType::ImplPtr [protected]

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

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.

Copy constructor.

Definition at line 57 of file DataType.cpp.

Destructor.

Definition at line 62 of file DataType.cpp.


Member Function Documentation

Clear the data type.

Definition at line 152 of file DataType.cpp.

Create a serializer for this data type.

Definition at line 161 of file DataType.cpp.

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.

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.

True, if this data type has type information.

Definition at line 137 of file DataType.cpp.

True, if this data type represents an array type.

Definition at line 98 of file DataType.cpp.

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

Definition at line 105 of file DataType.cpp.

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.

True, if this data type represents a message type.

Definition at line 112 of file DataType.cpp.

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.

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]
friend class Serializer [friend]

Definition at line 39 of file DataType.h.


Member Data Documentation

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 Tue Jul 9 2019 03:18:42