Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | Static Public Member Functions | List of all members
om::lang::Type Class Reference

A class that represents a C++ type. More...

#include <omType.h>

Public Member Functions

 Type ()
 Create a new empty type object. More...
 
template<typename T >
 Type (const T &object)
 Create a type object from the type of the parameter. More...
 
 operator const String & () const
 Return a string representing the unique name of this type. More...
 
const String & toString () const
 Return a string representing the unique name of this type. More...
 
const String & getName () const
 Return a string representing the unique name of this type. More...
 
Hash getID () const
 Return an unsigned integer for this type. Different types may have the same ID. More...
 
Hash getHashCode () const
 Return an integer hash code for this type. More...
 
Bool operator== (const Type &type) const
 Return whether or not this type is equal to another. More...
 
Bool operator!= (const Type &type) const
 Return whether or not this type is not equal to another. More...
 

Static Public Member Functions

template<typename T >
static Type of ()
 Get a type object representing the templatized type of this method. More...
 
template<typename T >
static Type of (const T &object)
 Get a type object representing the type of the parameter. More...
 

Detailed Description

A class that represents a C++ type.

The class consists of a string uniquely identifying the type it represents. This string is retrieved from a C++ type_info object. This allows a C++ type to be used as a first-class object. Type objects can be created from both a statically defined type via the templatized method Type::of<>() or from the dynamic type of an object via a constructor or the Type::of() method. In order for the dynamic type of an object to be determined, at least one class in its inheritance hierarchy must have a virtual method.

Constructor & Destructor Documentation

om::lang::Type::Type ( )
inline

Create a new empty type object.

template<typename T >
om::lang::Type::Type ( const T &  object)
inline

Create a type object from the type of the parameter.

Member Function Documentation

template<typename T >
static Type om::lang::Type::of ( )
inlinestatic

Get a type object representing the templatized type of this method.

template<typename T >
static Type om::lang::Type::of ( const T &  object)
inlinestatic

Get a type object representing the type of the parameter.

om::lang::Type::operator const String & ( ) const
inline

Return a string representing the unique name of this type.

const String& om::lang::Type::toString ( ) const
inline

Return a string representing the unique name of this type.

const String& om::lang::Type::getName ( ) const
inline

Return a string representing the unique name of this type.

Hash om::lang::Type::getID ( ) const
inline

Return an unsigned integer for this type. Different types may have the same ID.

Hash om::lang::Type::getHashCode ( ) const
inline

Return an integer hash code for this type.

Bool om::lang::Type::operator== ( const Type type) const
inline

Return whether or not this type is equal to another.

Bool om::lang::Type::operator!= ( const Type type) const
inline

Return whether or not this type is not equal to another.


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