![]() |
An open-source, flexible 3D physical simulation framework
|
class containing a single value. More...
#include <DataItem.h>
Public Member Functions | |
DataItem () | |
~DataItem () | |
DataItem (const DataItem &other) | |
DataItem & | operator= (const DataItem &other) |
std::string | getName () const |
void | setName (const std::string &newName) |
bool | get (int *val) const |
tries to retrieve the value from this DataItem More... | |
bool | get (unsigned int *val) const |
tries to retrieve the value from this DataItem More... | |
bool | get (long *val) const |
tries to retrieve the value from this DataItem More... | |
bool | get (unsigned long *val) const |
tries to retrieve the value from this DataItem More... | |
bool | get (float *val) const |
tries to retrieve the value from this DataItem More... | |
bool | get (double *val) const |
tries to retrieve the value from this DataItem More... | |
bool | get (std::string *val) const |
tries to retrieve the value from this DataItem More... | |
bool | get (bool *val) const |
tries to retrieve the value from this DataItem More... | |
bool | set (int val) |
tries to set the value of this DataItem More... | |
bool | set (unsigned int val) |
tries to set the value of this DataItem More... | |
bool | set (long val) |
tries to set the value of this DataItem More... | |
bool | set (unsigned long val) |
tries to set the value of this DataItem More... | |
bool | set (float val) |
tries to set the value of this DataItem More... | |
bool | set (double val) |
tries to set the value of this DataItem More... | |
bool | set (const std::string &val) |
tries to set the value of this DataItem More... | |
bool | set (bool val) |
tries to set the value of this DataItem More... | |
Public Attributes | |
DataType | type |
the type of the DataItem More... | |
union { | |
int i | |
unsigned int ui | |
long l | |
unsigned long ul | |
float f | |
double d | |
bool b | |
}; | |
std::string | s |
Private Attributes | |
std::string | name |
class containing a single value.
Definition at line 60 of file DataItem.h.
mars::data_broker::DataItem::DataItem | ( | ) |
Definition at line 28 of file DataItem.cpp.
mars::data_broker::DataItem::~DataItem | ( | ) |
Definition at line 30 of file DataItem.cpp.
mars::data_broker::DataItem::DataItem | ( | const DataItem & | other | ) |
Definition at line 33 of file DataItem.cpp.
bool mars::data_broker::DataItem::get | ( | int * | val | ) | const |
tries to retrieve the value from this DataItem
val | A pointer to a variable where the value can be written to. |
true
if the value was successfully retrieved. false
if the pointer val was of the wrong type. In the latter case the content of the pointer remains unchanged. Definition at line 61 of file DataItem.cpp.
bool mars::data_broker::DataItem::get | ( | unsigned int * | val | ) | const |
tries to retrieve the value from this DataItem
val | A pointer to a variable where the value can be written to. |
true
if the value was successfully retrieved. false
if the pointer val was of the wrong type. In the latter case the content of the pointer remains unchanged. Definition at line 69 of file DataItem.cpp.
bool mars::data_broker::DataItem::get | ( | long * | val | ) | const |
tries to retrieve the value from this DataItem
val | A pointer to a variable where the value can be written to. |
true
if the value was successfully retrieved. false
if the pointer val was of the wrong type. In the latter case the content of the pointer remains unchanged. Definition at line 77 of file DataItem.cpp.
bool mars::data_broker::DataItem::get | ( | unsigned long * | val | ) | const |
tries to retrieve the value from this DataItem
val | A pointer to a variable where the value can be written to. |
true
if the value was successfully retrieved. false
if the pointer val was of the wrong type. In the latter case the content of the pointer remains unchanged. Definition at line 85 of file DataItem.cpp.
bool mars::data_broker::DataItem::get | ( | float * | val | ) | const |
tries to retrieve the value from this DataItem
val | A pointer to a variable where the value can be written to. |
true
if the value was successfully retrieved. false
if the pointer val was of the wrong type. In the latter case the content of the pointer remains unchanged. Definition at line 93 of file DataItem.cpp.
bool mars::data_broker::DataItem::get | ( | double * | val | ) | const |
tries to retrieve the value from this DataItem
val | A pointer to a variable where the value can be written to. |
true
if the value was successfully retrieved. false
if the pointer val was of the wrong type. In the latter case the content of the pointer remains unchanged. Definition at line 101 of file DataItem.cpp.
bool mars::data_broker::DataItem::get | ( | std::string * | val | ) | const |
tries to retrieve the value from this DataItem
val | A pointer to a variable where the value can be written to. |
true
if the value was successfully retrieved. false
if the pointer val was of the wrong type. In the latter case the content of the pointer remains unchanged. Definition at line 109 of file DataItem.cpp.
bool mars::data_broker::DataItem::get | ( | bool * | val | ) | const |
tries to retrieve the value from this DataItem
val | A pointer to a variable where the value can be written to. |
true
if the value was successfully retrieved. false
if the pointer val was of the wrong type. In the latter case the content of the pointer remains unchanged. Definition at line 117 of file DataItem.cpp.
std::string mars::data_broker::DataItem::getName | ( | ) | const |
Definition at line 57 of file DataItem.cpp.
Definition at line 38 of file DataItem.cpp.
bool mars::data_broker::DataItem::set | ( | int | val | ) |
tries to set the value of this DataItem
val | The value to which the DataItem should be set. |
true
if the value was successfully set. false
if the type of val does not match the type of this DataItem. In the latter case the current value of the DataItem is unchanged. Definition at line 134 of file DataItem.cpp.
bool mars::data_broker::DataItem::set | ( | unsigned int | val | ) |
tries to set the value of this DataItem
val | The value to which the DataItem should be set. |
true
if the value was successfully set. false
if the type of val does not match the type of this DataItem. In the latter case the current value of the DataItem is unchanged. Definition at line 142 of file DataItem.cpp.
bool mars::data_broker::DataItem::set | ( | long | val | ) |
tries to set the value of this DataItem
val | The value to which the DataItem should be set. |
true
if the value was successfully set. false
if the type of val does not match the type of this DataItem. In the latter case the current value of the DataItem is unchanged. Definition at line 150 of file DataItem.cpp.
bool mars::data_broker::DataItem::set | ( | unsigned long | val | ) |
tries to set the value of this DataItem
val | The value to which the DataItem should be set. |
true
if the value was successfully set. false
if the type of val does not match the type of this DataItem. In the latter case the current value of the DataItem is unchanged. Definition at line 158 of file DataItem.cpp.
bool mars::data_broker::DataItem::set | ( | float | val | ) |
tries to set the value of this DataItem
val | The value to which the DataItem should be set. |
true
if the value was successfully set. false
if the type of val does not match the type of this DataItem. In the latter case the current value of the DataItem is unchanged. Definition at line 166 of file DataItem.cpp.
bool mars::data_broker::DataItem::set | ( | double | val | ) |
tries to set the value of this DataItem
val | The value to which the DataItem should be set. |
true
if the value was successfully set. false
if the type of val does not match the type of this DataItem. In the latter case the current value of the DataItem is unchanged. Definition at line 174 of file DataItem.cpp.
bool mars::data_broker::DataItem::set | ( | const std::string & | val | ) |
tries to set the value of this DataItem
val | The value to which the DataItem should be set. |
true
if the value was successfully set. false
if the type of val does not match the type of this DataItem. In the latter case the current value of the DataItem is unchanged. Definition at line 182 of file DataItem.cpp.
bool mars::data_broker::DataItem::set | ( | bool | val | ) |
tries to set the value of this DataItem
val | The value to which the DataItem should be set. |
true
if the value was successfully set. false
if the type of val does not match the type of this DataItem. In the latter case the current value of the DataItem is unchanged. Definition at line 190 of file DataItem.cpp.
void mars::data_broker::DataItem::setName | ( | const std::string & | newName | ) |
Definition at line 130 of file DataItem.cpp.
union { ... } |
bool mars::data_broker::DataItem::b |
Definition at line 77 of file DataItem.h.
double mars::data_broker::DataItem::d |
Definition at line 76 of file DataItem.h.
float mars::data_broker::DataItem::f |
Definition at line 75 of file DataItem.h.
int mars::data_broker::DataItem::i |
Definition at line 71 of file DataItem.h.
long mars::data_broker::DataItem::l |
Definition at line 73 of file DataItem.h.
|
private |
Definition at line 133 of file DataItem.h.
std::string mars::data_broker::DataItem::s |
Definition at line 79 of file DataItem.h.
DataType mars::data_broker::DataItem::type |
the type of the DataItem
Definition at line 68 of file DataItem.h.
unsigned int mars::data_broker::DataItem::ui |
Definition at line 72 of file DataItem.h.
unsigned long mars::data_broker::DataItem::ul |
Definition at line 74 of file DataItem.h.