Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Public Attributes | List of all members
orxonox::MT_Value< T > Class Template Reference

The MT_Value<T> class is used to hold a value of type T within a MultiType. More...

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/util/MultiTypeValue.h>

Inheritance diagram for orxonox::MT_Value< T >:
orxonox::MultiType::MT_ValueBase

Public Member Functions

 MT_Value (const T &value, MultiType::Type type)
 Constructor: Assigns the value and the type identifier. More...
 
virtual MT_ValueBaseclone () const override
 Creates a copy of itself. More...
 
virtual void exportData (uint8_t *&mem) const override
 saves data from the MT into the bytestream (mem) and increases the bytestream pointer by the size of the data More...
 
template<>
void exportData (uint8_t *&mem) const
 
template<>
void exportData (uint8_t *&mem) const
 
template<>
void exportData (uint8_t *&mem) const
 
template<>
void exportData (uint8_t *&mem) const
 
template<>
void exportData (uint8_t *&mem) const
 
template<>
void exportData (uint8_t *&) const
 
virtual uint8_t getSize () const override
 returns the size of the data that would be saved by exportData More...
 
template<>
uint8_t getSize () const
 
template<>
uint8_t getSize () const
 
template<>
uint8_t getSize () const
 
template<>
uint8_t getSize () const
 
template<>
uint8_t getSize () const
 
template<>
uint8_t getSize () const
 
virtual bool getValue (char *value) const override
 Assigns the value to the given pointer. The value gets converted if the types don't match. More...
 
virtual bool getValue (unsigned char *value) const override
 Assigns the value to the given pointer. The value gets converted if the types don't match. More...
 
virtual bool getValue (short *value) const override
 Assigns the value to the given pointer. The value gets converted if the types don't match. More...
 
virtual bool getValue (unsigned short *value) const override
 Assigns the value to the given pointer. The value gets converted if the types don't match. More...
 
virtual bool getValue (int *value) const override
 Assigns the value to the given pointer. The value gets converted if the types don't match. More...
 
virtual bool getValue (unsigned int *value) const override
 Assigns the value to the given pointer. The value gets converted if the types don't match. More...
 
virtual bool getValue (long *value) const override
 Assigns the value to the given pointer. The value gets converted if the types don't match. More...
 
virtual bool getValue (unsigned long *value) const override
 Assigns the value to the given pointer. The value gets converted if the types don't match. More...
 
virtual bool getValue (long long *value) const override
 Assigns the value to the given pointer. The value gets converted if the types don't match. More...
 
virtual bool getValue (unsigned long long *value) const override
 Assigns the value to the given pointer. The value gets converted if the types don't match. More...
 
virtual bool getValue (float *value) const override
 Assigns the value to the given pointer. The value gets converted if the types don't match. More...
 
virtual bool getValue (double *value) const override
 Assigns the value to the given pointer. The value gets converted if the types don't match. More...
 
virtual bool getValue (long double *value) const override
 Assigns the value to the given pointer. The value gets converted if the types don't match. More...
 
virtual bool getValue (bool *value) const override
 Assigns the value to the given pointer. The value gets converted if the types don't match. More...
 
virtual bool getValue (void **value) const override
 Assigns the value to the given pointer. The value gets converted if the types don't match. More...
 
virtual bool getValue (std::string *value) const override
 Assigns the value to the given pointer. The value gets converted if the types don't match. More...
 
virtual bool getValue (orxonox::Vector2 *value) const override
 Assigns the value to the given pointer. The value gets converted if the types don't match. More...
 
virtual bool getValue (orxonox::Vector3 *value) const override
 Assigns the value to the given pointer. The value gets converted if the types don't match. More...
 
virtual bool getValue (orxonox::Vector4 *value) const override
 Assigns the value to the given pointer. The value gets converted if the types don't match. More...
 
virtual bool getValue (orxonox::ColourValue *value) const override
 Assigns the value to the given pointer. The value gets converted if the types don't match. More...
 
virtual bool getValue (orxonox::Quaternion *value) const override
 Assigns the value to the given pointer. The value gets converted if the types don't match. More...
 
virtual bool getValue (orxonox::Radian *value) const override
 Assigns the value to the given pointer. The value gets converted if the types don't match. More...
 
virtual bool getValue (orxonox::Degree *value) const override
 Assigns the value to the given pointer. The value gets converted if the types don't match. More...
 
virtual void importData (uint8_t *&mem) override
 loads data from the bytestream (mem) into the MT and increases the bytestream pointer by the size of the data More...
 
template<>
void importData (uint8_t *&mem)
 
template<>
void importData (uint8_t *&mem)
 
template<>
void importData (uint8_t *&mem)
 
template<>
void importData (uint8_t *&mem)
 
template<>
void importData (uint8_t *&mem)
 
template<>
void importData (uint8_t *&)
 
virtual void reset () override
 Resets the current value to the default. More...
 
virtual bool setValue (const MultiType &other) override
 Assigns the value of the other MultiType, converted to T. More...
 
virtual bool setValue (const char &value) override
 Assigns the value by converting it to T. More...
 
virtual bool setValue (const unsigned char &value) override
 Assigns the value by converting it to T. More...
 
virtual bool setValue (const short &value) override
 Assigns the value by converting it to T. More...
 
virtual bool setValue (const unsigned short &value) override
 Assigns the value by converting it to T. More...
 
virtual bool setValue (const int &value) override
 Assigns the value by converting it to T. More...
 
virtual bool setValue (const unsigned int &value) override
 Assigns the value by converting it to T. More...
 
virtual bool setValue (const long &value) override
 Assigns the value by converting it to T. More...
 
virtual bool setValue (const unsigned long &value) override
 Assigns the value by converting it to T. More...
 
virtual bool setValue (const long long &value) override
 Assigns the value by converting it to T. More...
 
virtual bool setValue (const unsigned long long &value) override
 Assigns the value by converting it to T. More...
 
virtual bool setValue (const float &value) override
 Assigns the value by converting it to T. More...
 
virtual bool setValue (const double &value) override
 Assigns the value by converting it to T. More...
 
virtual bool setValue (const long double &value) override
 Assigns the value by converting it to T. More...
 
virtual bool setValue (const bool &value) override
 Assigns the value by converting it to T. More...
 
virtual bool setValue (void *const &value) override
 Assigns the value by converting it to T. More...
 
virtual bool setValue (const std::string &value) override
 Assigns the value by converting it to T. More...
 
virtual bool setValue (const orxonox::Vector2 &value) override
 Assigns the value by converting it to T. More...
 
virtual bool setValue (const orxonox::Vector3 &value) override
 Assigns the value by converting it to T. More...
 
virtual bool setValue (const orxonox::Vector4 &value) override
 Assigns the value by converting it to T. More...
 
virtual bool setValue (const orxonox::ColourValue &value) override
 Assigns the value by converting it to T. More...
 
virtual bool setValue (const orxonox::Quaternion &value) override
 Assigns the value by converting it to T. More...
 
virtual bool setValue (const orxonox::Radian &value) override
 Assigns the value by converting it to T. More...
 
virtual bool setValue (const orxonox::Degree &value) override
 Assigns the value by converting it to T. More...
 
virtual void toString (std::ostream &outstream) const override
 Puts the current value on the stream. More...
 
- Public Member Functions inherited from orxonox::MultiType::MT_ValueBase
 MT_ValueBase (void *data, Type type)
 
virtual ~MT_ValueBase ()
 
template<typename T >
get () const
 
const TypegetType () const
 Returns the type of the current value. More...
 
template<typename T >
std::enable_if<!std::is_enum< T >::value, bool >::type getValue (T *value) const
 
template<typename T >
std::enable_if< std::is_enum< T >::value, bool >::type getValue (T *value) const
 
template<typename T >
std::enable_if<!std::is_enum< T >::value, bool >::type isType () const
 Returns true if the type of the stored value is T. Note: the actual implementations for all supported types are defined outside of the class. More...
 
template<typename T >
std::enable_if< std::is_enum< T >::value, bool >::type isType () const
 Implementation for enum classes: Returns true if the type of the stored value is the underlying type of T. More...
 
template<>
bool isType () const
 
template<>
bool isType () const
 
template<>
bool isType () const
 
template<>
bool isType () const
 
template<>
bool isType () const
 
template<>
bool isType () const
 
template<>
bool isType () const
 
template<>
bool isType () const
 
template<>
bool isType () const
 
template<>
bool isType () const
 
template<>
bool isType () const
 
template<>
bool isType () const
 
template<>
bool isType () const
 
template<>
bool isType () const
 
template<>
bool isType () const
 
bool lastConversionSuccessful () const
 Checks whether the value is a default one. More...
 
template<typename T >
std::enable_if<!std::is_enum< T >::value, bool >::type setValue (const T &value)
 
template<typename T >
std::enable_if< std::is_enum< T >::value, bool >::type setValue (const T &value)
 

Public Attributes

value_
 The stored value. More...
 
- Public Attributes inherited from orxonox::MultiType::MT_ValueBase
bool bLastConversionSuccessful
 True if the last conversion was successful. More...
 
voiddata_
 For direct access to the value if the type is known. More...
 
Type type_
 The type of the current value. More...
 

Detailed Description

template<typename T>
class orxonox::MT_Value< T >

The MT_Value<T> class is used to hold a value of type T within a MultiType.

Constructor & Destructor Documentation

template<typename T>
orxonox::MT_Value< T >::MT_Value ( const T &  value,
MultiType::Type  type 
)
inline

Constructor: Assigns the value and the type identifier.

Member Function Documentation

template<typename T>
virtual MT_ValueBase* orxonox::MT_Value< T >::clone ( ) const
inlineoverridevirtual

Creates a copy of itself.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual void orxonox::MT_Value< T >::exportData ( uint8_t *&  mem) const
inlineoverridevirtual

saves data from the MT into the bytestream (mem) and increases the bytestream pointer by the size of the data

Implements orxonox::MultiType::MT_ValueBase.

template<>
void orxonox::MT_Value< ColourValue >::exportData ( uint8_t *&  mem) const
inlinevirtual
template<>
void orxonox::MT_Value< Ogre::Quaternion >::exportData ( uint8_t *&  mem) const
inlinevirtual
template<>
void orxonox::MT_Value< Ogre::Vector2 >::exportData ( uint8_t *&  mem) const
inlinevirtual
template<>
void orxonox::MT_Value< Ogre::Vector3 >::exportData ( uint8_t *&  mem) const
inlinevirtual
template<>
void orxonox::MT_Value< Ogre::Vector4 >::exportData ( uint8_t *&  mem) const
inlinevirtual
template<>
void orxonox::MT_Value< void * >::exportData ( uint8_t *&  ) const
inlinevirtual
template<typename T>
virtual uint8_t orxonox::MT_Value< T >::getSize ( void  ) const
inlineoverridevirtual

returns the size of the data that would be saved by exportData

Implements orxonox::MultiType::MT_ValueBase.

template<>
uint8_t orxonox::MT_Value< ColourValue >::getSize ( void  ) const
inlinevirtual
template<>
uint8_t orxonox::MT_Value< Ogre::Quaternion >::getSize ( void  ) const
inlinevirtual
template<>
uint8_t orxonox::MT_Value< Ogre::Vector2 >::getSize ( void  ) const
inlinevirtual
template<>
uint8_t orxonox::MT_Value< Ogre::Vector3 >::getSize ( void  ) const
inlinevirtual
template<>
uint8_t orxonox::MT_Value< Ogre::Vector4 >::getSize ( void  ) const
inlinevirtual
template<>
uint8_t orxonox::MT_Value< void * >::getSize ( void  ) const
inlinevirtual
template<typename T>
virtual bool orxonox::MT_Value< T >::getValue ( char *  value) const
inlineoverridevirtual

Assigns the value to the given pointer. The value gets converted if the types don't match.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::getValue ( unsigned char *  value) const
inlineoverridevirtual

Assigns the value to the given pointer. The value gets converted if the types don't match.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::getValue ( short *  value) const
inlineoverridevirtual

Assigns the value to the given pointer. The value gets converted if the types don't match.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::getValue ( unsigned short *  value) const
inlineoverridevirtual

Assigns the value to the given pointer. The value gets converted if the types don't match.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::getValue ( int *  value) const
inlineoverridevirtual

Assigns the value to the given pointer. The value gets converted if the types don't match.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::getValue ( unsigned int *  value) const
inlineoverridevirtual

Assigns the value to the given pointer. The value gets converted if the types don't match.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::getValue ( long *  value) const
inlineoverridevirtual

Assigns the value to the given pointer. The value gets converted if the types don't match.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::getValue ( unsigned long *  value) const
inlineoverridevirtual

Assigns the value to the given pointer. The value gets converted if the types don't match.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::getValue ( long long *  value) const
inlineoverridevirtual

Assigns the value to the given pointer. The value gets converted if the types don't match.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::getValue ( unsigned long long *  value) const
inlineoverridevirtual

Assigns the value to the given pointer. The value gets converted if the types don't match.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::getValue ( float *  value) const
inlineoverridevirtual

Assigns the value to the given pointer. The value gets converted if the types don't match.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::getValue ( double *  value) const
inlineoverridevirtual

Assigns the value to the given pointer. The value gets converted if the types don't match.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::getValue ( long double *  value) const
inlineoverridevirtual

Assigns the value to the given pointer. The value gets converted if the types don't match.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::getValue ( bool *  value) const
inlineoverridevirtual

Assigns the value to the given pointer. The value gets converted if the types don't match.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::getValue ( void **  value) const
inlineoverridevirtual

Assigns the value to the given pointer. The value gets converted if the types don't match.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::getValue ( std::string *  value) const
inlineoverridevirtual

Assigns the value to the given pointer. The value gets converted if the types don't match.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::getValue ( orxonox::Vector2 *  value) const
inlineoverridevirtual

Assigns the value to the given pointer. The value gets converted if the types don't match.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::getValue ( orxonox::Vector3 *  value) const
inlineoverridevirtual

Assigns the value to the given pointer. The value gets converted if the types don't match.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::getValue ( orxonox::Vector4 *  value) const
inlineoverridevirtual

Assigns the value to the given pointer. The value gets converted if the types don't match.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::getValue ( orxonox::ColourValue *  value) const
inlineoverridevirtual

Assigns the value to the given pointer. The value gets converted if the types don't match.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::getValue ( orxonox::Quaternion *  value) const
inlineoverridevirtual

Assigns the value to the given pointer. The value gets converted if the types don't match.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::getValue ( orxonox::Radian *  value) const
inlineoverridevirtual

Assigns the value to the given pointer. The value gets converted if the types don't match.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::getValue ( orxonox::Degree *  value) const
inlineoverridevirtual

Assigns the value to the given pointer. The value gets converted if the types don't match.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual void orxonox::MT_Value< T >::importData ( uint8_t *&  mem)
inlineoverridevirtual

loads data from the bytestream (mem) into the MT and increases the bytestream pointer by the size of the data

Implements orxonox::MultiType::MT_ValueBase.

template<>
void orxonox::MT_Value< ColourValue >::importData ( uint8_t *&  mem)
inlinevirtual
template<>
void orxonox::MT_Value< Ogre::Quaternion >::importData ( uint8_t *&  mem)
inlinevirtual
template<>
void orxonox::MT_Value< Ogre::Vector2 >::importData ( uint8_t *&  mem)
inlinevirtual
template<>
void orxonox::MT_Value< Ogre::Vector3 >::importData ( uint8_t *&  mem)
inlinevirtual
template<>
void orxonox::MT_Value< Ogre::Vector4 >::importData ( uint8_t *&  mem)
inlinevirtual
template<>
void orxonox::MT_Value< void * >::importData ( uint8_t *&  )
inlinevirtual
template<typename T>
virtual void orxonox::MT_Value< T >::reset ( )
inlineoverridevirtual

Resets the current value to the default.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::setValue ( const MultiType other)
inlineoverridevirtual

Assigns the value of the other MultiType, converted to T.

Parameters
otherThe other MultiType

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::setValue ( const char &  value)
inlineoverridevirtual

Assigns the value by converting it to T.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::setValue ( const unsigned char &  value)
inlineoverridevirtual

Assigns the value by converting it to T.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::setValue ( const short &  value)
inlineoverridevirtual

Assigns the value by converting it to T.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::setValue ( const unsigned short &  value)
inlineoverridevirtual

Assigns the value by converting it to T.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::setValue ( const int &  value)
inlineoverridevirtual

Assigns the value by converting it to T.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::setValue ( const unsigned int &  value)
inlineoverridevirtual

Assigns the value by converting it to T.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::setValue ( const long &  value)
inlineoverridevirtual

Assigns the value by converting it to T.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::setValue ( const unsigned long &  value)
inlineoverridevirtual

Assigns the value by converting it to T.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::setValue ( const long long &  value)
inlineoverridevirtual

Assigns the value by converting it to T.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::setValue ( const unsigned long long &  value)
inlineoverridevirtual

Assigns the value by converting it to T.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::setValue ( const float &  value)
inlineoverridevirtual

Assigns the value by converting it to T.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::setValue ( const double &  value)
inlineoverridevirtual

Assigns the value by converting it to T.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::setValue ( const long double &  value)
inlineoverridevirtual

Assigns the value by converting it to T.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::setValue ( const bool &  value)
inlineoverridevirtual

Assigns the value by converting it to T.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::setValue ( void *const &  value)
inlineoverridevirtual

Assigns the value by converting it to T.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::setValue ( const std::string &  value)
inlineoverridevirtual

Assigns the value by converting it to T.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::setValue ( const orxonox::Vector2 &  value)
inlineoverridevirtual

Assigns the value by converting it to T.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::setValue ( const orxonox::Vector3 &  value)
inlineoverridevirtual

Assigns the value by converting it to T.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::setValue ( const orxonox::Vector4 &  value)
inlineoverridevirtual

Assigns the value by converting it to T.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::setValue ( const orxonox::ColourValue &  value)
inlineoverridevirtual

Assigns the value by converting it to T.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::setValue ( const orxonox::Quaternion &  value)
inlineoverridevirtual

Assigns the value by converting it to T.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::setValue ( const orxonox::Radian &  value)
inlineoverridevirtual

Assigns the value by converting it to T.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual bool orxonox::MT_Value< T >::setValue ( const orxonox::Degree &  value)
inlineoverridevirtual

Assigns the value by converting it to T.

Implements orxonox::MultiType::MT_ValueBase.

template<typename T>
virtual void orxonox::MT_Value< T >::toString ( std::ostream &  outstream) const
inlineoverridevirtual

Puts the current value on the stream.

Implements orxonox::MultiType::MT_ValueBase.

Member Data Documentation

template<typename T>
T orxonox::MT_Value< T >::value_

The stored value.


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