#include <parameterlist.h>
Public Types | |
typedef std::vector< boost::any > | TVector |
Public Member Functions | |
ParameterList () | |
virtual | ~ParameterList () |
void | AddValue (const boost::any &value) |
inserts a value at the end of the managed sequence | |
ParameterList & | AddList () |
inserts an empty ParameterList as a new value at the end of the managed sequence and returns a reference to the new list. | |
int | GetSize () const |
returns the number of values contained in the managed sequence | |
bool | IsEmpty () const |
returns true if the managed sequence is empty | |
void | Clear () |
removes all elements from the managed sequence | |
void | Pop_Front () |
removes the first element from the managed sequence | |
void | Pop_Back () |
removes the last element from the managed sequence | |
TVector::const_iterator | begin () const |
returns an iterator pointing at the begin of the managed sequence | |
TVector::const_iterator | end () const |
returns an iterator pointing at the end of the managed sequence | |
TVector::const_iterator | operator[] (int n) const |
returns an iterator pointing at the nth element of the managed sequence | |
TVector::iterator | operator[] (int n) |
returns an iterator pointing at the nth element of the managed sequence | |
TVector::iterator | begin () |
returns an iterator pointing at the begin of the managed sequence | |
TVector::iterator | end () |
returns an iterator pointing at the end of the managed sequence | |
template<typename T> | |
bool | AdvanceAnyValue (TVector::const_iterator &iter, T &value) const |
AdvanceAnyValue is a generic templated helper function for consumers of ParameterLists. | |
template<typename T> | |
f_inline bool | GetValue (const TVector::const_iterator &iter, T &value) const |
GetValue is a generic templated helper function for consumers of ParameterLists. | |
template<typename T> | |
f_inline bool | GetAnyValue (const TVector::const_iterator &iter, T &value) const |
bool | AdvanceValue (TVector::const_iterator &iter, std::string &value) const |
Below are AdvanceValue helper functions spezialiced for a type. | |
bool | AdvanceValue (TVector::const_iterator &iter, float &value) const |
bool | AdvanceValue (TVector::const_iterator &iter, double &value) const |
bool | AdvanceValue (TVector::const_iterator &iter, int &value) const |
bool | AdvanceValue (TVector::const_iterator &iter, bool &value) const |
bool | AdvanceValue (TVector::const_iterator &iter, unsigned int &value) const |
bool | AdvanceValue (TVector::const_iterator &iter, salt::Vector3f &value) const |
bool | AdvanceValue (TVector::const_iterator &iter, salt::Vector2f &value) const |
Protected Member Functions | |
template<typename DATATYPE, int ELEMENTS, typename TYPE> | |
f_inline bool | GetVectorValue (TVector::const_iterator &iter, salt::TVector< DATATYPE, ELEMENTS, TYPE > &value) const |
This is a specialized GetValue helper to read any salt::TVector from a TParameterList. | |
template<typename TYPE> | |
f_inline bool | ConvertStringValue (TVector::const_iterator &iter, TYPE &value) const |
This is a specialized GetValue helper to read a scalar value from a TParameterList. | |
template<typename TFrom, typename TTo> | |
f_inline bool | GetValueInternal (TVector::const_iterator &iter, TTo &value) const |
helper that tries to any_cast the TFrom value at iter to a TTo Value, on success it returns true and advances the iterator | |
Protected Attributes | |
TVector | mList |
Boost::Any is used as a typesafe container to realize a sequence of values of arbitrary types.
Definition at line 38 of file parameterlist.h.
|
Definition at line 41 of file parameterlist.h. |
|
Definition at line 29 of file parameterlist.cpp. Referenced by AddList(). |
|
Definition at line 33 of file parameterlist.cpp. |
|
inserts an empty ParameterList as a new value at the end of the managed sequence and returns a reference to the new list. Using AddList instead of AddValue avoids copying a list on insertion. Definition at line 44 of file parameterlist.cpp. References mList, and ParameterList(). Referenced by VisionPerceptor::AddSense(), RestrictedVisionPerceptor::AddSense(), RestrictedVisionPerceptor::DynamicAxisPercept(), UniversalJointPerceptor::InsertAxisAngle(), HingePerceptor::InsertAxisAngle(), Hinge2Perceptor::InsertAxisAngle(), UniversalJointPerceptor::InsertAxisRate(), HingePerceptor::InsertAxisRate(), Hinge2Perceptor::InsertAxisRate(), GameStatePerceptor::InsertInitialPercept(), GameStatePerceptor::InsertSoccerParam(), PerfectVisionPerceptor::Percept(), GameStatePerceptor::Percept(), AgentStatePerceptor::Percept(), SexpParser::SexpToList(), VisionPerceptor::StaticAxisPercept(), and RestrictedVisionPerceptor::StaticAxisPercept(). Here is the call graph for this function: ![]() |
|
|
AdvanceAnyValue is a generic templated helper function for consumers of ParameterLists. It tries to cast the parameter at iter to a value of type T. If successful it returns true, assigns the casted parameter to value and increments the iterator iter. Otherwise false is returned and value and iter are unchanged. Note that AdvanceValue increments iter to transparently allow specialized functions for types that are represented by more than one entry in the ParameterList. An example is a three dimensional vector represented by a sequence of three floats. Note: the AdvanceAnyValue and AdvanceValue have distinct names, as C++ does not support partly specialized template function (currently only partly specialized classes) and would always call the generic template function instead of a partly specialized variant.
Definition at line 123 of file parameterlist.h. Referenced by GetAnyValue(). |
|
Definition at line 271 of file parameterlist.cpp. References GetVectorValue(). Here is the call graph for this function: ![]() |
|
Definition at line 265 of file parameterlist.cpp. References GetVectorValue(). Here is the call graph for this function: ![]() |
|
Definition at line 255 of file parameterlist.cpp. |
|
Definition at line 215 of file parameterlist.cpp. References str. |
|
Definition at line 204 of file parameterlist.cpp. |
|
Definition at line 192 of file parameterlist.cpp. |
|
Definition at line 180 of file parameterlist.cpp. |
|
Below are AdvanceValue helper functions spezialiced for a type.
Definition at line 137 of file parameterlist.cpp. References str. Referenced by SexpMonitor::AddPredicates(), oxygen::Predicate::AdvanceValue(), GetValue(), GetVectorValue(), and SoccerMonitor::ParsePlayModes(). |
|
returns an iterator pointing at the begin of the managed sequence
Definition at line 111 of file parameterlist.cpp. References mList. |
|
returns an iterator pointing at the begin of the managed sequence
Definition at line 85 of file parameterlist.cpp. References mList. Referenced by SexpMonitor::AddPredicates(), oxygen::Predicate::begin(), oxygen::Predicate::Iterator::begin(), and SoccerMonitor::ParsePlayModes(). |
|
removes all elements from the managed sequence
Definition at line 63 of file parameterlist.cpp. References mList. Referenced by VisionPerceptor::DynamicAxisPercept(), RestrictedVisionPerceptor::DynamicAxisPercept(), PerfectVisionPerceptor::Percept(), HearPerceptor::Percept(), GameStatePerceptor::Percept(), AgentStatePerceptor::Percept(), VisionPerceptor::StaticAxisPercept(), and RestrictedVisionPerceptor::StaticAxisPercept(). |
|
This is a specialized GetValue helper to read a scalar value from a TParameterList. It tries to generate the value from a string representation Definition at line 228 of file parameterlist.h. References str. |
|
returns an iterator pointing at the end of the managed sequence
Definition at line 117 of file parameterlist.cpp. References mList. |
|
returns an iterator pointing at the end of the managed sequence
Definition at line 91 of file parameterlist.cpp. References mList. Referenced by SexpMonitor::AddPredicates(), oxygen::Predicate::Iterator::end(), oxygen::Predicate::Iterator::operator++(), and SoccerMonitor::ParsePlayModes(). |
|
Definition at line 141 of file parameterlist.h. References AdvanceAnyValue(). Referenced by oxygen::Predicate::GetAnyValue(). Here is the call graph for this function: ![]() |
|
returns the number of values contained in the managed sequence
Definition at line 51 of file parameterlist.cpp. References mList. Referenced by readRGBA(), and oxygen::StdMeshImporter::UnitCCylinder(). |
|
GetValue is a generic templated helper function for consumers of ParameterLists. It has the same semantics as it's corresponding AdvanceValue except that it takes a const reference to iter that it does not increment. Definition at line 134 of file parameterlist.h. References AdvanceValue(). Referenced by oxygen::Predicate::GetValue(), readRGBA(), and oxygen::StdMeshImporter::UnitCCylinder(). Here is the call graph for this function: ![]() |
|
helper that tries to any_cast the TFrom value at iter to a TTo Value, on success it returns true and advances the iterator
Definition at line 263 of file parameterlist.h. |
|
This is a specialized GetValue helper to read any salt::TVector from a TParameterList. It first tries to interprete a single element of the TParameterList as a TVector. If this fails it tries to build a vector from a sequence of values in the ParameterList. Depending on the way the Vector is built iter is incremented either by one element or the number of scalar elements that make up a vector of the given type. Note: If GetVectorValue builds a vector from a sequence of scalars it uses the AdvanceValue function specialized for the scalar value type of that TVector. For example in the common case of a float vector this enables GetVectorValue to handle any mixture of float, int and string representation within the TParameterList.
Definition at line 180 of file parameterlist.h. References AdvanceValue(), and mList. Referenced by AdvanceValue(). Here is the call graph for this function: ![]() |
|
returns true if the managed sequence is empty
Definition at line 57 of file parameterlist.cpp. References mList. |
|
returns an iterator pointing at the nth element of the managed sequence
Definition at line 123 of file parameterlist.cpp. References mList. |
|
returns an iterator pointing at the nth element of the managed sequence
Definition at line 97 of file parameterlist.cpp. References mList. |
|
removes the last element from the managed sequence
Definition at line 76 of file parameterlist.cpp. References mList. |
|
removes the first element from the managed sequence
Definition at line 68 of file parameterlist.cpp. References mList. Referenced by FUNCTION(). |
|
Definition at line 44 of file parameterlist.h. Referenced by AddList(), AddValue(), begin(), Clear(), end(), GetSize(), GetVectorValue(), IsEmpty(), operator[](), Pop_Back(), and Pop_Front(). |