Data type. More...
#include <DataType.h>
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 DataType & | operator= (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 |
Data type.
Definition at line 36 of file DataType.h.
typedef boost::shared_ptr<boost::shared_ptr<Impl> > variant_topic_tools::DataType::ImplPtr [protected] |
Declaration of the data type implementation pointer type.
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.
Default constructor.
Definition at line 33 of file DataType.cpp.
variant_topic_tools::DataType::DataType | ( | const char * | identifier | ) |
Constructor (overloaded version taking an identifier)
Definition at line 36 of file DataType.cpp.
variant_topic_tools::DataType::DataType | ( | const std::string & | identifier | ) |
Constructor (overloaded version taking a string identifier)
Definition at line 43 of file DataType.cpp.
variant_topic_tools::DataType::DataType | ( | const std::type_info & | typeInfo | ) |
Constructor (overloaded version taking type information)
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.
void variant_topic_tools::DataType::clear | ( | ) |
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.
size_t variant_topic_tools::DataType::getSize | ( | ) | const |
Retrieve the size of the instances of this data type.
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.
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.
Assignment operator.
Reimplemented in variant_topic_tools::MessageDataType, variant_topic_tools::ArrayDataType, and variant_topic_tools::BuiltinDataType.
Definition at line 179 of file DataType.cpp.
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.
friend class DataTypeHash [friend] |
Definition at line 37 of file DataType.h.
friend class DataTypeRegistry [friend] |
Reimplemented in variant_topic_tools::MessageDataType, variant_topic_tools::ArrayDataType, and variant_topic_tools::BuiltinDataType.
Definition at line 38 of file DataType.h.
friend class Serializer [friend] |
Definition at line 39 of file DataType.h.
ImplPtr variant_topic_tools::DataType::impl [protected] |
The data type's implementation adapter.
Definition at line 226 of file DataType.h.