Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

Config Class Reference

#include <Config.h>

List of all members.


Detailed Description

provides global access to system configuration information

Definition at line 13 of file Config.h.

Public Types

 sec_wireless = 0
 denotes wireless section of config file
 sec_vision
 denotes vision section of config file
 sec_main
 denotes main section of config file, for misc. settings
 sec_behaviors
 denotes behaviors section of config file
 sec_controller
 denotes controller section of config file
 sec_motion
 denotes motion section of config file
 sec_sound
 denotes sound section of config file
 sec_invalid
 denotes an invalid section of config file
enum  section_t {
  sec_wireless = 0, sec_vision, sec_main, sec_behaviors,
  sec_controller, sec_motion, sec_sound, sec_invalid
}
 section IDs More...

Public Member Functions

 Config ()
 constructor
 Config (const std::string &filename)
 constructor
 ~Config ()
 destructor
void setFileSystemRoot (const std::string &fsr)
 sets fsRoot
const std::string & getFileSystemRoot () const
 returns fsRoot
std::string portPath (const std::string &path) const
 returns a portable version of path which should be usable on either the simulator or the robot
void readConfig (const std::string &filename)
 call this function when it's time to read the configuration file
section_t parseSection (const char *key)
 returns the section structure corresponding to the section name given
void * setValue (section_t section, const char *key, const char *value, bool updated=false)
 pass the section, item name string, item value string - sets the value and returns pointer to the item changed

Public Attributes

Config::wireless_config wireless
 wirless information
Config::vision_config vision
 vision information
Config::main_config main
 core functionality information
Config::behaviors_config behaviors
 placeholder
Config::controller_config controller
 controller information
Config::motion_config motion
 motion information
Config::sound_config sound
 sound information

Protected Member Functions

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 Protected Member Functions

static bool extractBool (const char *value)
 returns bool value corresponding to a value of "t", "f", "true", "false", "y", "n", "yes", "no", or zero/nonzero number

Protected Attributes

std::string fsRoot
 a prefix representing the file system root, usually indicating the robot's storage root.

Classes

struct  behaviors_config
 placeholder More...
struct  controller_config
 controller information More...
struct  main_config
 core functionality information More...
struct  motion_config
 motion information More...
struct  sound_config
 sound information More...
struct  vision_config
 vision information More...
struct  wireless_config
 wirless information More...


Member Enumeration Documentation

section IDs

Enumerator:
sec_wireless  denotes wireless section of config file
sec_vision  denotes vision section of config file
sec_main  denotes main section of config file, for misc. settings
sec_behaviors  denotes behaviors section of config file
sec_controller  denotes controller section of config file
sec_motion  denotes motion section of config file
sec_sound  denotes sound section of config file
sec_invalid  denotes an invalid section of config file

Definition at line 33 of file Config.h.


Constructor & Destructor Documentation

Config::Config (  )  [inline]

constructor

Definition at line 16 of file Config.h.

Config::Config ( const std::string &  filename  )  [inline]

constructor

Definition at line 21 of file Config.h.

Config::~Config (  )  [inline]

destructor

Definition at line 26 of file Config.h.


Member Function Documentation

bool Config::extractBool ( const char *  value  )  [static, protected]

returns bool value corresponding to a value of "t", "f", "true", "false", "y", "n", "yes", "no", or zero/nonzero number

Definition at line 668 of file Config.cc.

Referenced by setValue().

const std::string& Config::getFileSystemRoot (  )  const [inline]

returns fsRoot

Definition at line 29 of file Config.h.

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

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

Definition at line 643 of file Config.cc.

Referenced by readConfig().

Config::section_t Config::parseSection ( const char *  key  ) 

returns the section structure corresponding to the section name given

Definition at line 526 of file Config.cc.

Referenced by readConfig(), and Controller::setConfig().

std::string Config::portPath ( const std::string &  path  )  const

void Config::readConfig ( const std::string &  filename  ) 

call this function when it's time to read the configuration file

Definition at line 546 of file Config.cc.

Referenced by Config().

void Config::setFileSystemRoot ( const std::string &  fsr  ) 

sets fsRoot

Definition at line 28 of file Config.cc.

Referenced by Config().

void * Config::setValue ( section_t  section,
const char *  key,
const char *  value,
bool  updated = false 
)

pass the section, item name string, item value string - sets the value and returns pointer to the item changed

Definition at line 70 of file Config.cc.

Referenced by readConfig(), and Controller::setConfig().


Member Data Documentation

std::string Config::fsRoot [protected]

a prefix representing the file system root, usually indicating the robot's storage root.

When running in the simulator, this is used to pretend that a subdirectory in the project folder (e.g. 'ms') is the root file system

Definition at line 340 of file Config.h.

Referenced by getFileSystemRoot(), portPath(), and setFileSystemRoot().

wirless information

Referenced by setValue().


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

Tekkotsu v3.0
Generated Wed Oct 4 00:04:58 2006 by Doxygen 1.4.7