SimObjectAttributesDefinition Class Reference

Hold the definition of a set of attributes. More...

#include <SimObjectAttributesDefinition.h>

Collaboration diagram for SimObjectAttributesDefinition:

Collaboration graph
[legend]

List of all members.

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.


Detailed Description

Hold the definition of a set 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.


Constructor & Destructor Documentation

SimObjectAttributesDefinition::SimObjectAttributesDefinition (  ) 

Definition at line 14 of file SimObjectAttributesDefinition.cpp.

SimObjectAttributesDefinition::~SimObjectAttributesDefinition (  ) 

Definition at line 71 of file SimObjectAttributesDefinition.cpp.


Member Function Documentation

template<typename T>
template void SimObjectAttributesDefinition::add< long long > ( string  name  )  [inline]

Add a new attribute.

Parameters:
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  ) 

Add a new attribute of type int.

Definition at line 36 of file SimObjectAttributesDefinition.cpp.

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]

Return the number of attributes.

Definition at line 67 of file SimObjectAttributesDefinition.h.


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

Generated on Wed Jul 9 16:34:53 2008 for PCSIM by  doxygen 1.5.5