Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

ConfigDictionary Class Reference

#include <Config.h>

Inheritance diagram for ConfigDictionary:

List of all members.


Detailed Description

a subclass of plist::Dictionary which adds support for filtering settings by robot model, each configuration section is based on this

As a slight extension to standard plists, you can specify model-specific settings by prepending a key with: Model:MODEL_PATTERN:KEY_NAME For example, to use different 'thresh' settings on the ERS-2xx series vs. the ERS-7 model, you would use the keys:

  • Model:ERS-2*:thresh
  • Model:ERS-7:thresh You can filter several items as a group by leaving off the second ':' and name, and providing a dictionary as the value. If the model matches, all entries from the dictionary are imported into the parent dictionary.

Definition at line 35 of file Config.h.


Public Member Functions

 ConfigDictionary ()

Protected Member Functions

virtual bool loadXMLNode (const std::string &key, xmlNode *val, const std::string &comment)
 called with each node being loaded so subclass can handle appropriately
virtual bool saveOverXMLNode (xmlNode *k, xmlNode *val, const std::string &key, std::string comment, const std::string &indentStr, std::set< std::string > &seen) const
 called with each node being saved so subclass can handle appropriately, return true if successful and reset key if changed

Static Protected Member Functions

static bool matchNoCase (const std::string &model, const std::string &pattern)
 returns true if pattern matches model - pattern may have up to 1 '*', case insensitive
static void initCurModel ()
 function to initialize curModel

Static Protected Attributes

static const std::string msPrefix = "Model"
 the prefix indicating a model-specific key
static const std::string msSep = ":"
 the separator string which splits the key into the prefix, model pattern, and (optionally) a single key name
static std::string curModel
 will be set to the model identifier of the currently running hardware

Constructor & Destructor Documentation

ConfigDictionary::ConfigDictionary (  )  [inline]

Definition at line 37 of file Config.h.


Member Function Documentation

bool ConfigDictionary::loadXMLNode ( const std::string &  name,
xmlNode val,
const std::string &  comment 
) [protected, virtual]

called with each node being loaded so subclass can handle appropriately

Reimplemented from plist::DictionaryOf< ObjectBase >.

Reimplemented in OutputConfig< T >, and OutputConfig< plist::Primitive< float > >.

Definition at line 64 of file Config.cc.

Referenced by OutputConfig< plist::Primitive< float > >::loadXMLNode().

bool ConfigDictionary::saveOverXMLNode ( xmlNode k,
xmlNode val,
const std::string &  key,
std::string  comment,
const std::string &  indentStr,
std::set< std::string > &  seen 
) const [protected, virtual]

called with each node being saved so subclass can handle appropriately, return true if successful and reset key if changed

Reimplemented from plist::DictionaryBase.

Definition at line 94 of file Config.cc.

bool ConfigDictionary::matchNoCase ( const std::string &  model,
const std::string &  pattern 
) [static, protected]

returns true if pattern matches model - pattern may have up to 1 '*', case insensitive

Definition at line 126 of file Config.cc.

Referenced by loadXMLNode(), Config::parseLine(), and saveOverXMLNode().

static void ConfigDictionary::initCurModel (  )  [static, protected]

function to initialize curModel


Member Data Documentation

const std::string ConfigDictionary::msPrefix = "Model" [static, protected]

the prefix indicating a model-specific key

Definition at line 51 of file Config.h.

Referenced by loadXMLNode(), and saveOverXMLNode().

const std::string ConfigDictionary::msSep = ":" [static, protected]

the separator string which splits the key into the prefix, model pattern, and (optionally) a single key name

Definition at line 52 of file Config.h.

Referenced by loadXMLNode(), and saveOverXMLNode().

std::string ConfigDictionary::curModel [static, protected]

will be set to the model identifier of the currently running hardware

Definition at line 54 of file Config.h.

Referenced by ConfigDictionary(), loadXMLNode(), Config::parseLine(), and saveOverXMLNode().


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

Tekkotsu v4.0
Generated Thu Nov 22 00:58:15 2007 by Doxygen 1.5.4