37 #ifndef _MultiTypeValue_H__ 38 #define _MultiTypeValue_H__ 65 virtual inline bool getValue(
char* value)
const override {
return convertValue<T, char >(value,
value_, 0); }
66 virtual inline bool getValue(
unsigned char* value)
const override {
return convertValue<T, unsigned char >(value,
value_, 0); }
67 virtual inline bool getValue(
short* value)
const override {
return convertValue<T, short >(value,
value_, 0); }
68 virtual inline bool getValue(
unsigned short* value)
const override {
return convertValue<T, unsigned short >(value,
value_, 0); }
69 virtual inline bool getValue(
int* value)
const override {
return convertValue<T, int >(value,
value_, 0); }
70 virtual inline bool getValue(
unsigned int* value)
const override {
return convertValue<T, unsigned int >(value,
value_, 0); }
71 virtual inline bool getValue(
long* value)
const override {
return convertValue<T, long >(value,
value_, 0); }
72 virtual inline bool getValue(
unsigned long* value)
const override {
return convertValue<T, unsigned long >(value,
value_, 0); }
73 virtual inline bool getValue(
long long* value)
const override {
return convertValue<T, long long >(value,
value_, 0); }
74 virtual inline bool getValue(
unsigned long long* value)
const override {
return convertValue<T, unsigned long long >(value,
value_, 0); }
75 virtual inline bool getValue(
float* value)
const override {
return convertValue<T, float >(value,
value_, 0); }
76 virtual inline bool getValue(
double* value)
const override {
return convertValue<T, double >(value,
value_, 0); }
77 virtual inline bool getValue(
long double* value)
const override {
return convertValue<T, long double >(value,
value_, 0); }
78 virtual inline bool getValue(
bool* value)
const override {
return convertValue<T, bool >(value,
value_, 0); }
79 virtual inline bool getValue(
void** value)
const override {
return convertValue<T, void* >(value,
value_,
nullptr); }
101 this->
value_ = zeroise<T>();
131 virtual inline void toString(std::ostream& outstream)
const override { outstream << this->
value_; }
virtual bool setValue(const unsigned long &value) override
Assigns the value by converting it to T.
Definition: MultiTypeValue.h:113
virtual bool setValue(const bool &value) override
Assigns the value by converting it to T.
Definition: MultiTypeValue.h:119
MT_ValueBase * value_
A pointer to the value container.
Definition: MultiType.h:490
bool bLastConversionSuccessful
True if the last conversion was successful.
Definition: MultiType.h:299
virtual bool setValue(const unsigned char &value) override
Assigns the value by converting it to T.
Definition: MultiTypeValue.h:107
MT_Value(const T &value, MultiType::Type type)
Constructor: Assigns the value and the type identifier.
Definition: MultiTypeValue.h:57
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...
Definition: MultiTypeValue.h:84
virtual bool setValue(const unsigned int &value) override
Assigns the value by converting it to T.
Definition: MultiTypeValue.h:111
virtual bool setValue(const int &value) override
Assigns the value by converting it to T.
Definition: MultiTypeValue.h:110
virtual bool setValue(const float &value) override
Assigns the value by converting it to T.
Definition: MultiTypeValue.h:116
MT_ValueBase(void *data, Type type)
Definition: MultiType.h:174
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...
Definition: MultiTypeValue.h:80
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...
Definition: MultiTypeValue.h:68
Functions to serialise most of the types/classed used in Orxonox.
Provides zero value symbols that can be returned as reference.
Definition: Math.h:223
virtual bool getValue(bool *value) const override
Assigns the value to the given pointer. The value gets converted if the types don't match...
Definition: MultiTypeValue.h:78
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...
Definition: MultiTypeValue.h:72
virtual bool setValue(const unsigned long long &value) override
Assigns the value by converting it to T.
Definition: MultiTypeValue.h:115
virtual bool setValue(const char &value) override
Assigns the value by converting it to T.
Definition: MultiTypeValue.h:106
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...
Definition: MultiTypeValue.h:86
virtual bool setValue(const orxonox::ColourValue &value) override
Assigns the value by converting it to T.
Definition: MultiTypeValue.h:125
::std::string string
Definition: gtest-port.h:756
virtual bool setValue(const orxonox::Vector4 &value) override
Assigns the value by converting it to T.
Definition: MultiTypeValue.h:124
uint32_t returnSize(T *&variable)
returns the size of the objectID needed to synchronise the pointer
Definition: Serialise.h:49
virtual bool getValue(float *value) const override
Assigns the value to the given pointer. The value gets converted if the types don't match...
Definition: MultiTypeValue.h:75
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...
Definition: MultiTypeValue.h:83
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...
Definition: MultiTypeValue.h:82
virtual bool getValue(long *value) const override
Assigns the value to the given pointer. The value gets converted if the types don't match...
Definition: MultiTypeValue.h:71
virtual bool setValue(const orxonox::Vector2 &value) override
Assigns the value by converting it to T.
Definition: MultiTypeValue.h:122
virtual bool getValue(double *value) const override
Assigns the value to the given pointer. The value gets converted if the types don't match...
Definition: MultiTypeValue.h:76
Type type_
The type of the current value.
Definition: MultiType.h:298
virtual bool setValue(const long double &value) override
Assigns the value by converting it to T.
Definition: MultiTypeValue.h:118
virtual bool setValue(const short &value) override
Assigns the value by converting it to T.
Definition: MultiTypeValue.h:108
virtual bool setValue(const orxonox::Vector3 &value) override
Assigns the value by converting it to T.
Definition: MultiTypeValue.h:123
virtual bool setValue(const long long &value) override
Assigns the value by converting it to T.
Definition: MultiTypeValue.h:114
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...
Definition: MultiTypeValue.h:73
virtual bool setValue(const std::string &value) override
Assigns the value by converting it to T.
Definition: MultiTypeValue.h:121
Type
Enum of all possible types of a MultiType.
Definition: MultiType.h:138
virtual MT_ValueBase * clone() const override
Creates a copy of itself.
Definition: MultiTypeValue.h:60
virtual bool setValue(const orxonox::Degree &value) override
Assigns the value by converting it to T.
Definition: MultiTypeValue.h:128
virtual void toString(std::ostream &outstream) const override
Puts the current value on the stream.
Definition: MultiTypeValue.h:131
virtual uint8_t getSize() const override
returns the size of the data that would be saved by exportData
Definition: MultiTypeValue.h:138
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...
Definition: MultiTypeValue.h:77
virtual void reset() override
Resets the current value to the default.
Definition: MultiTypeValue.h:63
virtual bool setValue(void *const &value) override
Assigns the value by converting it to T.
Definition: MultiTypeValue.h:120
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Declaration of the MultiType and some helper constructs.
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...
Definition: MultiTypeValue.h:85
void saveAndIncrease(T *&variable, uint8_t *&mem)
saves the objectID of a pointer into the bytestream and increases the mem pointer ...
Definition: Serialise.h:62
Shared library macros, enums, constants and forward declarations for the util library ...
virtual bool getValue(void **value) const override
Assigns the value to the given pointer. The value gets converted if the types don't match...
Definition: MultiTypeValue.h:79
virtual bool getValue(char *value) const override
Assigns the value to the given pointer. The value gets converted if the types don't match...
Definition: MultiTypeValue.h:65
virtual bool getValue(int *value) const override
Assigns the value to the given pointer. The value gets converted if the types don't match...
Definition: MultiTypeValue.h:69
The MultiType can hold a value of many possible types and convert them to other types.
Definition: MultiType.h:130
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...
Definition: MultiTypeValue.h:66
virtual bool setValue(const MultiType &other) override
Assigns the value of the other MultiType, converted to T.
Definition: MultiTypeValue.h:93
Definition: InputPrereqs.h:78
virtual bool setValue(const unsigned short &value) override
Assigns the value by converting it to T.
Definition: MultiTypeValue.h:109
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...
Definition: MultiTypeValue.h:70
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...
Definition: MultiTypeValue.h:87
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...
Definition: MultiTypeValue.h:74
Conversion functions for Math types like Ogre::Vector3 (definitions are in Math.cc) ...
T value_
The stored value.
Definition: MultiTypeValue.h:140
virtual bool setValue(const orxonox::Quaternion &value) override
Assigns the value by converting it to T.
Definition: MultiTypeValue.h:126
virtual bool getValue(short *value) const override
Assigns the value to the given pointer. The value gets converted if the types don't match...
Definition: MultiTypeValue.h:67
The MT_Value<T> class is used to hold a value of type T within a MultiType.
Definition: MultiTypeValue.h:53
virtual bool setValue(const orxonox::Radian &value) override
Assigns the value by converting it to T.
Definition: MultiTypeValue.h:127
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 ...
Definition: MultiTypeValue.h:134
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...
Definition: MultiTypeValue.h:81
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 ...
Definition: MultiTypeValue.h:136
virtual bool setValue(const double &value) override
Assigns the value by converting it to T.
Definition: MultiTypeValue.h:117
MT_ValueBase is an almost pure virtual baseclass of MT_Value<T>, which holds the value of the MultiTy...
Definition: MultiType.h:171
virtual bool getValue(char *value) const =0
void loadAndIncrease(T *&variable, uint8_t *&mem)
reads the objectID of a pointer out of the bytestream and increases the mem pointer ...
Definition: Serialise.h:55
virtual bool setValue(const long &value) override
Assigns the value by converting it to T.
Definition: MultiTypeValue.h:112