OpenTracker

An Open Architecture for Reconfigurable Tracking based on XML | Contact

ot::StringTable Class Reference

#include <StringTable.h>

List of all members.


Public Member Functions

 StringTable ()
 StringTable (const StringTable &table)
 ~StringTable ()
const std::string & get (const std::string &key)
void put (const std::string &key, const std::string &value)
void remove (const std::string &key)
int containsKey (const std::string &)
unsigned size ()
void put (const std::string &key, const int value)
void put (const std::string &key, const float value)
void put (const std::string &key, const double value)
void put (const std::string &key, const int *value, int len)
void put (const std::string &key, const float *value, int len)
void put (const std::string &key, const double *value, int len)
int get (const std::string &key, int *value, int len=1)
int get (const std::string &key, float *value, int len=1)
int get (const std::string &key, std::vector< float > &vector, int len=1)
int get (const std::string &key, double *value, int len=1)

Protected Attributes

StringMap map

Friends

class KeyIterator

Detailed Description

Definition at line 67 of file StringTable.h.


Constructor & Destructor Documentation

ot::StringTable::StringTable (  ) 

constructor

Definition at line 59 of file StringTable.cxx.

ot::StringTable::StringTable ( const StringTable table  ) 

copy constructor, builds a new table by copying another

Parameters:
table StringTable to copy from

Definition at line 63 of file StringTable.cxx.

ot::StringTable::~StringTable (  ) 

destructor

Definition at line 68 of file StringTable.cxx.

References map.


Member Function Documentation

int ot::StringTable::containsKey ( const std::string &   ) 

int ot::StringTable::get ( const std::string &  key,
double *  value,
int  len = 1 
)

parses a stored entry into an array of doubles.

It assumes that the doubles are separated by spaces. It returns the number of actually converted doubles.

Parameters:
key the key of the entry to parse
value pointer to the array of doubles to store the parsed values
len the length of the array, default 1 to use it for a single double only
Returns:
number of actually parsed values

Definition at line 235 of file StringTable.cxx.

References map.

int ot::StringTable::get ( const std::string &  key,
std::vector< float > &  vector,
int  len = 1 
)

parses a stored entry into a vector of floats.

It assumes that the floats are separated by spaces. It returns the number of actually converted floats.

Parameters:
key the key of the entry to parse
reference to the vector of floats to store the parsed values
len the length of the array, default 1 to use it for a single float only
Returns:
number of actually parsed values

Definition at line 222 of file StringTable.cxx.

References ot::copyA2V(), get(), and map.

int ot::StringTable::get ( const std::string &  key,
float *  value,
int  len = 1 
)

parses a stored entry into an array of floats.

It assumes that the floats are separated by spaces. It returns the number of actually converted floats.

Parameters:
key the key of the entry to parse
value pointer to the array of integers to store the parsed values
len the length of the array, default 1 to use it for a single float only
Returns:
number of actually parsed values

Definition at line 205 of file StringTable.cxx.

References map.

int ot::StringTable::get ( const std::string &  key,
int *  value,
int  len = 1 
)

parses a stored entry into an array of integers.

It assumes that the integers are separated by spaces. It returns the number of actually converted integers.

Parameters:
key the key of the entry to parse
value pointer to the array of integers to store the parsed values
len the length of the array, default 1 to use it for a single int only
Returns:
number of actually parsed values

Definition at line 188 of file StringTable.cxx.

References map.

const std::string & ot::StringTable::get ( const std::string &  key  ) 

returns a value stored in the map

Parameters:
key the key the value is for
Returns:
the string value or an empty string, if the key is not found

Definition at line 75 of file StringTable.cxx.

References ot::empty(), and map.

Referenced by ot::XSensModule::createNode(), ot::VRPNModule::createNode(), ot::UltraTrakModule::createNode(), ot::UbisenseModule::createNode(), ot::TestModule::createNode(), ot::TCPModule::createNode(), ot::SpeechModule::createNode(), ot::QtMouseEventModuleBase::createNode(), ot::ParButtonModule::createNode(), ot::NetworkSourceModule::createNode(), ot::NetworkSinkModule::createNode(), ot::MulticastInputModule::createNode(), ot::MagicYModule::createNode(), ot::InterSenseModule::createNode(), ot::InterpolatorModule::createNode(), ot::GroupGateModule::createNode(), ot::FOBModule::createNode(), ot::FileModule::createNode(), ot::FastTrakModule::createNode(), ot::DynaSightModule::createNode(), ot::CORBAModule::createNode(), ot::Context::createNode(), ot::CommonNodeFactory::createNode(), ot::CallbackModule::createNode(), ot::ButtonHoldFilterModule::createNode(), ot::ARToolKitPlusModule::createNode(), ot::ARTDataTrackerModule::createNode(), ot::OTQtMEMCalibProc::exec(), get(), ot::VRPNModule::init(), ot::UltraTrakModule::init(), ot::UbisenseModule::init(), ot::TimeModule::init(), ot::TCPModule::init(), ot::SpeechModule::init(), ot::QtMouseEventModule::init(), ot::P5GloveModule::init(), ot::OpenVideoModule::init(), ot::NetworkSinkModule::init(), ot::MulticastInputModule::init(), ot::MagicYModule::init(), ot::LogModule::init(), ot::InterSenseModule::init(), ot::GPSModule::init(), ot::FOBModule::init(), ot::FileModule::init(), ot::FastTrakModule::init(), ot::DynaSightModule::init(), ot::DwarfModule::init(), ot::CORBAModule::init(), ot::ARToolKitPlusModule::init(), ot::ARTDataTrackerModule::init(), ot::QtAppScreen::QtAppScreen(), ot::QtMouseEventSinkBase::QtMouseEventSinkBase(), and ot::OTQtMEMCalibProc::trackASCorner().

void ot::StringTable::put ( const std::string &  key,
const double *  value,
int  len 
)

sets an array of double values.

It is converted to a string where the values are separated by spaces and stored under the given key.

Parameters:
key key string of the entry
value pointer to the array of double values to store
len the length of the array

Definition at line 173 of file StringTable.cxx.

References map.

void ot::StringTable::put ( const std::string &  key,
const float *  value,
int  len 
)

sets an array of float values.

It is converted to a string where the values are separated by spaces and stored under the given key.

Parameters:
key key string of the entry
value pointer to the array of floating point values to store
len the length of the array

Definition at line 158 of file StringTable.cxx.

References map.

void ot::StringTable::put ( const std::string &  key,
const int *  value,
int  len 
)

sets an array of int values.

It is converted to a string where the values are separated by spaces and stored under the given key.

Parameters:
key key string of the entry
value pointer to the array of integer values to store
len the length of the array

Definition at line 143 of file StringTable.cxx.

References map.

void ot::StringTable::put ( const std::string &  key,
const double  value 
)

sets a double value, the value is converted to a string and stored under the given key.

Parameters:
key key string of the entry
value the double precision value to store

Definition at line 135 of file StringTable.cxx.

References map.

void ot::StringTable::put ( const std::string &  key,
const float  value 
)

sets a float value, the value is converted to a string and stored under the given key.

Parameters:
key key string of the entry
value the floating point value to store

Definition at line 127 of file StringTable.cxx.

References map.

void ot::StringTable::put ( const std::string &  key,
const int  value 
)

sets an int value, the value is converted to a string and stored under the given key.

Parameters:
key key string of the entry
value the integer value to store

Definition at line 119 of file StringTable.cxx.

References map.

void ot::StringTable::put ( const std::string &  key,
const std::string &  value 
)

stores a key value pair in the table, overwritting a possible prior value

Parameters:
key the key to store it under
value the value to store

Definition at line 85 of file StringTable.cxx.

References map.

Referenced by ot::QtAppScreen::convert(), ot::QtMouseEventModuleBase::createNode(), ot::QtMouseEventModule::init(), and ot::ConfigurationParser::parseElement().

void ot::StringTable::remove ( const std::string &  key  ) 

removes a key value pair from the table

Parameters:
key the key to the pair

Definition at line 92 of file StringTable.cxx.

References map.

unsigned ot::StringTable::size (  ) 

returns the number of pairs stored

Returns:
unsigned with the number of pairs

Definition at line 112 of file StringTable.cxx.

References map.

Referenced by ot::OTQtMEMCalibProc::exec().


Friends And Related Function Documentation

friend class KeyIterator [friend]

Definition at line 192 of file StringTable.h.


Member Data Documentation

the underlying STL map implementing the functionality

Definition at line 70 of file StringTable.h.

Referenced by containsKey(), get(), put(), remove(), size(), and ~StringTable().


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

copyright (c) 2006 Graz University of Technology