fw4spl
fwTools::DynamicType Class Reference

Class defining an elementary C++ type aka unsigned char, signed char, .... signed long, float, double. More...

#include <DynamicType.hpp>

+ Collaboration diagram for fwTools::DynamicType:

Public Types

typedef boost::mpl::vector< signed char, unsigned char, signed short, unsigned short, signed int, unsigned int, unsigned long, signed long, float, double >::type SupportedTypes
 

Public Member Functions

FWTOOLS_API DynamicType ()
 Default constructor.
 
FWTOOLS_API DynamicType (const DynamicType &)
 Constructor by copy.
 
FWTOOLS_API bool operator== (const DynamicType &) const
 comparison operator
 
FWTOOLS_API bool operator!= (const DynamicType &) const
 comparison operator
 
FWTOOLS_API bool operator< (const DynamicType &) const
 define an order (lexicographic) for dynamicType
 
template<class TYPE >
void setType ()
 Set DynamicType value according given template. More...
 
template<class TYPE >
bool isType () const
 Return true iff the DynamicType value represents the TYPE. More...
 
FWTOOLS_API unsigned char sizeOf () const
 Return the sizeof of the type.
 
virtual FWTOOLS_API ~DynamicType ()
 Default destrucor : do nothing.
 
FWTOOLS_API const std::string & string () const
 Return a human readable string.
 
template<class T >
std::pair< T, T > minMax ()
 return the min and max storable in the DynamicType. take care that min/max value are casted into template T
 
FWTOOLS_API bool isFixedPrecision ()
 return true iff the type use a fixed precision
 
FWTOOLS_API bool isSigned ()
 return true iff the type is signed
 

Static Public Member Functions

template<class NEWTYPE >
static void registerNewType (const std::string &newKey)
 Register a new type to be managed within DynamicType. More...
 
template<class TYPE >
static const std::string string ()
 Return a human readable string for type (static version no instanciation ...) More...
 

Protected Attributes

std::string m_value
 
unsigned char m_sizeof
 

Static Protected Attributes

static FWTOOLS_API std::list< std::string > m_managedTypes
 Container of types managed by DynamicType. More...
 
static FWTOOLS_API const std::string m_unSpecifiedType = std::string("UNSPECIFIED TYPE")
 Value for not specified type.
 

Detailed Description

Class defining an elementary C++ type aka unsigned char, signed char, .... signed long, float, double.

Date
2007-2009.

Definition at line 31 of file DynamicType.hpp.

Member Function Documentation

template<class TYPE >
bool fwTools::DynamicType::isType ( ) const

Return true iff the DynamicType value represents the TYPE.

Note
A BOOST_ASSERTION can be raised if TYPE is not managed by isMapping

Definition at line 89 of file DynamicType.hxx.

template<class NEWTYPE >
void fwTools::DynamicType::registerNewType ( const std::string &  newKey)
static

Register a new type to be managed within DynamicType.

Check are performed to ensure robsutess

Definition at line 105 of file DynamicType.hxx.

References setType().

+ Here is the call graph for this function:

template<class TYPE >
void fwTools::DynamicType::setType ( )

Set DynamicType value according given template.

Note
A BOOST_ASSERTION can be raised if TYPE is not managed by isMapping

Definition at line 69 of file DynamicType.hxx.

Referenced by registerNewType(), and string().

+ Here is the caller graph for this function:

template<class TYPE >
const std::string fwTools::DynamicType::string ( )
static

Return a human readable string for type (static version no instanciation ...)

Use a DynamicType::string<int>();

Definition at line 96 of file DynamicType.hxx.

References setType(), and string().

+ Here is the call graph for this function:

Member Data Documentation

std::list< std::string > fwTools::DynamicType::m_managedTypes
staticprotected
Initial value:
= {{ ("unsigned char"),
("signed char"),
("unsigned short"),
("signed short"),
("unsigned int"),
("signed int"),
("unsigned long"),
("signed long"),
("float"),
("double")}}

Container of types managed by DynamicType.

Definition at line 131 of file DynamicType.hpp.


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