#include <SimObjectAttributesDefinition.h>
Public Member Functions | |
SimObjectAttributesDefinition () | |
~SimObjectAttributesDefinition () | |
template<typename T> | |
void | add (string name) |
Add a new attribute. | |
void | addDouble (string const &name) |
Add a new attribute of type double. | |
void | addInt (string const &name) |
Add a new attribute of type int. | |
void | addString (string const &name, string const &value) |
Add a new attribute of type string. | |
size_t | offset (string const &name) const |
Return the offset of the attribute with the given name. | |
size_t | mem_size () const |
Return the number of bytes needed to store all the attributes in a linear chunk of memory. | |
void | lock () |
Lock the definition: After lockin no more attributes can be added. | |
vector< string > | names () const |
Return a list with the names of all attributes. | |
size_t | size () const |
Return the number of attributes. |
This class has the responsibilty to map names to storge locations. This class is used in SimObjectAttributes where one can actually access the fields and where also the memory for the fields is managed.
Definition at line 26 of file SimObjectAttributesDefinition.h.
SimObjectAttributesDefinition::SimObjectAttributesDefinition | ( | ) |
Definition at line 14 of file SimObjectAttributesDefinition.cpp.
SimObjectAttributesDefinition::~SimObjectAttributesDefinition | ( | ) |
Definition at line 71 of file SimObjectAttributesDefinition.cpp.
template void SimObjectAttributesDefinition::add< long long > | ( | string | name | ) | [inline] |
Add a new attribute.
T | The type of the attribute (e.g. double, int, ...) | |
name | The name of the attribute |
Definition at line 19 of file SimObjectAttributesDefinition.cpp.
void SimObjectAttributesDefinition::addDouble | ( | string const & | name | ) |
Add a new attribute of type double.
Definition at line 31 of file SimObjectAttributesDefinition.cpp.
void SimObjectAttributesDefinition::addInt | ( | string const & | name | ) |
void SimObjectAttributesDefinition::addString | ( | string const & | name, | |
string const & | value | |||
) |
Add a new attribute of type string.
Definition at line 41 of file SimObjectAttributesDefinition.cpp.
size_t SimObjectAttributesDefinition::offset | ( | string const & | name | ) | const |
Return the offset of the attribute with the given name.
Definition at line 47 of file SimObjectAttributesDefinition.cpp.
size_t SimObjectAttributesDefinition::mem_size | ( | ) | const [inline] |
Return the number of bytes needed to store all the attributes in a linear chunk of memory.
Definition at line 55 of file SimObjectAttributesDefinition.h.
void SimObjectAttributesDefinition::lock | ( | ) |
Lock the definition: After lockin no more attributes can be added.
Definition at line 67 of file SimObjectAttributesDefinition.cpp.
vector< string > SimObjectAttributesDefinition::names | ( | ) | const |
Return a list with the names of all attributes.
Definition at line 56 of file SimObjectAttributesDefinition.cpp.
size_t SimObjectAttributesDefinition::size | ( | ) | const [inline] |