CStateList Class Reference
Class for logging a list
of States. More...
#include <cstate.h>
Inheritance diagram for CStateList:
List of all members.
Detailed Description
Class for logging a list of States.
The class maintains a list of double and a list of integer
vectors. For each state variable defined in its state properties
there is an own vector. So only states with the same properties as
the state list can be added. When a state is added with
addState(...) the state gets decomposed in its state variables, and
each value of the state variable is added to its vector. So the
CStateList class doesn't save the State object itself, it only
saves the state variables. This is done due to performance reasons
because by saving the state object a new CState object would have to be
instantiated each time.
To Retrieve a state from the List you have to call the function
getState(int num, CState *state). The values of the num th state
are then filled in the specified state object.
Constructor & Destructor Documentation
| |
Creates a state list.
The number of vectors for the discrete and continuous state
variables are taken from the properties
object
|
| virtual
CStateList::~CStateList
|
( |
|
) |
[virtual] |
|
Member Function Documentation
| void
CStateList::addState
|
( |
CState *
|
state |
) |
|
|
| |
add a state to the state list
The state must have the same properties as the state list
object. The state gets then decomposed in its state-variables and
the state variables are stored.
|
| void
CStateList::clear
|
( |
|
) |
|
|
| unsigned int
CStateList::getNumStates
|
( |
|
) |
|
|
| |
get the number of states in the list
|
| void
CStateList::getState
|
( |
unsigned int |
num,
|
|
|
CState *
|
state |
|
) |
|
|
| |
Get a state from the state list.
The state must have the same properties as the state list
object. The state variables of the num th state are retrieved from
the vectors and set in the state object.
- Parameters:
-
|
num
|
Number of the state to retrieve |
|
state
|
The state object in which the retrieved state variables are
filled in
|
|
| virtual void
CStateList::loadASCII
|
( |
FILE * |
stream |
) |
[virtual] |
|
| |
load a statelist from a text file
The saved statelist must have had the same properties as the
state list (at least same number of discrete and continuous
states).
|
| virtual void
CStateList::loadBIN
|
( |
FILE * |
stream |
) |
[virtual] |
|
| |
load a statelist from a binary file
The saved statelist must have had the same properties as the
state list (at least same number of discrete and continuous
states).
|
| void
CStateList::removeFirstState
|
( |
|
) |
|
|
| void
CStateList::removeLastState
|
( |
|
) |
|
|
| virtual void
CStateList::saveASCII
|
( |
FILE * |
stream |
) |
[virtual] |
|
| |
save the statelist to a text file
|
| virtual void
CStateList::saveBIN
|
( |
FILE * |
stream |
) |
[virtual] |
|
| |
save the statelist to a binary file
|
Member Data Documentation
| |
vectors for the continuous state variables
|
| |
vectors for the discrete state variables
|
The documentation for this class was generated from the following
file:
|