Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

TeRKDriver::TeRKProperties Class Reference

#include <TeRKDriver.h>

Inheritance diagram for TeRKDriver::TeRKProperties:

List of all members.


Detailed Description

Grafts a Ice::Properties interface on a plist::Dictionary so we can use the Tekkotsu configuration system to control ICE.

The constructor assigns various default values to defaults - these will be used unless a value is found in the plist::Dictionary storage. We keep these values separate because they shouldn't be written to persistent storage unless explicitly set. (Default values may change in the future, could break things if the defaults were written to file... most of these values are not really configurable by end user)

Definition at line 150 of file TeRKDriver.h.


Public Types

typedef ::Ice::PropertiesPtr PointerType
 forwarding typedef for good form
typedef plist::Dictionary::iterator iterator
 forwarding typedef for good form
typedef
plist::Dictionary::const_iterator 
const_iterator
 forwarding typedef for good form

Public Member Functions

 TeRKProperties ()
 constructor, initialize defaults from defaultValues (C++0x will make this much more elegant!)
virtual ::std::string getProperty (const ::std::string &key)
 returns value associated with key, or empty string if not found
virtual ::std::string getPropertyWithDefault (const ::std::string &key, const ::std::string &def)
 returns value associated with key, or def if not found
virtual ::Ice::Int getPropertyAsInt (const ::std::string &key)
 returns value associated with key, or 0 if not found
virtual ::Ice::Int getPropertyAsIntWithDefault (const ::std::string &key,::Ice::Int def)
 returns value associated with key, or def if not found
virtual ::Ice::PropertyDict getPropertiesForPrefix (const ::std::string &prefix)
 returns a sub-map, selecting keys which match the specified prefix
virtual void setProperty (const ::std::string &key, const ::std::string &val)
 assigns a new value to a key
virtual ::Ice::StringSeq getCommandLineOptions ()
 returns an empty sequence
virtual ::Ice::StringSeq parseCommandLineOptions (const ::std::string &, const ::Ice::StringSeq &options)
 returns the same sequence it is passed (doesn't handle parsing command line options, we're not using that interface)
virtual ::Ice::StringSeq parseIceCommandLineOptions (const ::Ice::StringSeq &options)
 returns the same sequence it is passed (doesn't handle parsing command line options, we're not using that interface)
virtual void load (const ::std::string &filename)
 tries to load the specified file name (assumes plist format, not the ICE format!)
virtual ::Ice::PropertiesPtr clone ()
 makes a copy of the current property list
virtual TeRKPropertiesclone () const

Public Attributes

::Ice::PropertyDict defaults
 These provide the TeRK configuration parameters for ICE communication, unless overridden by a setting in the class itself (see class notes).

Static Protected Attributes

static const unsigned int NUM_DEFAULT_VALUES = 14
static std::pair< std::string,
std::string > 
defaultValues [NUM_DEFAULT_VALUES]
 this array defines the values for TeRKDriver::TeRKProperties::defaults

Member Typedef Documentation

typedef ::Ice::PropertiesPtr PointerType

forwarding typedef for good form

Definition at line 152 of file TeRKDriver.h.

forwarding typedef for good form

Reimplemented from DictionaryBase.

Definition at line 153 of file TeRKDriver.h.

forwarding typedef for good form

Reimplemented from DictionaryBase.

Definition at line 154 of file TeRKDriver.h.


Constructor & Destructor Documentation

TeRKProperties (  )  [inline]

constructor, initialize defaults from defaultValues (C++0x will make this much more elegant!)

Definition at line 157 of file TeRKDriver.h.

Referenced by clone().


Member Function Documentation

virtual ::std::string getProperty ( const ::std::string &  key  )  [inline]

returns value associated with key, or empty string if not found

Definition at line 168 of file TeRKDriver.h.

std::string getPropertyWithDefault ( const ::std::string &  key,
const ::std::string &  def 
)

returns value associated with key, or def if not found

Definition at line 286 of file TeRKDriver.cc.

Referenced by getProperty().

virtual ::Ice::Int getPropertyAsInt ( const ::std::string &  key  )  [inline]

returns value associated with key, or 0 if not found

Definition at line 172 of file TeRKDriver.h.

Ice::Int getPropertyAsIntWithDefault ( const ::std::string &  key,
::Ice::Int  def 
)

returns value associated with key, or def if not found

Definition at line 294 of file TeRKDriver.cc.

Referenced by getPropertyAsInt().

Ice::PropertyDict getPropertiesForPrefix ( const ::std::string &  prefix  ) 

returns a sub-map, selecting keys which match the specified prefix

Definition at line 302 of file TeRKDriver.cc.

virtual void setProperty ( const ::std::string &  key,
const ::std::string &  val 
) [inline, virtual]

assigns a new value to a key

Definition at line 178 of file TeRKDriver.h.

virtual ::Ice::StringSeq getCommandLineOptions (  )  [inline]

returns an empty sequence

Definition at line 180 of file TeRKDriver.h.

virtual ::Ice::StringSeq parseCommandLineOptions ( const ::std::string &  ,
const ::Ice::StringSeq &  options 
) [inline]

returns the same sequence it is passed (doesn't handle parsing command line options, we're not using that interface)

Definition at line 182 of file TeRKDriver.h.

virtual ::Ice::StringSeq parseIceCommandLineOptions ( const ::Ice::StringSeq &  options  )  [inline]

returns the same sequence it is passed (doesn't handle parsing command line options, we're not using that interface)

Definition at line 184 of file TeRKDriver.h.

void load ( const ::std::string &  filename  )  [virtual]

tries to load the specified file name (assumes plist format, not the ICE format!)

Definition at line 315 of file TeRKDriver.cc.

virtual ::Ice::PropertiesPtr clone (  )  [inline]

makes a copy of the current property list

Definition at line 188 of file TeRKDriver.h.

virtual TeRKProperties* clone (  )  const [inline, virtual]

Reimplemented from DictionaryOf< ObjectBase >.

Definition at line 189 of file TeRKDriver.h.


Member Data Documentation

::Ice::PropertyDict defaults

These provide the TeRK configuration parameters for ICE communication, unless overridden by a setting in the class itself (see class notes).

These may be changed from the initial defaultValues settings if a corresponding TeRKDriver setting (e.g. port) is modified. This is to avoid user confusion with having settings appear twice (once in the more human-readable driver settings, and again in this dictionary.) So settings stored in TeRKProperties itself is reserved for explicit overrides from the user

Definition at line 165 of file TeRKDriver.h.

Referenced by getPropertiesForPrefix(), getPropertyAsIntWithDefault(), and getPropertyWithDefault().

const unsigned int NUM_DEFAULT_VALUES = 14 [static, protected]

Definition at line 192 of file TeRKDriver.h.

pair< string, string > defaultValues [static, protected]

Initial value:

 {
  make_pair( "Ice.Package.peer", "edu.cmu.ri.mrpl" ),
  make_pair( "Ice.Package.TeRK", "edu.cmu.ri.mrpl" ),
  make_pair( "Ice.Default.Package", "edu.cmu.ri.mrpl" ),
  
  make_pair( "TerkClient.Client.Endpoints", "tcp" ),
  
  
  make_pair( "Ice.ACM.Client", "0" ),
  make_pair( "Ice.ACM.Server", "0" ),
  
  
  make_pair( "Ice.Warn.Connections", "1" ),
  
  make_pair( "Ice.Logger.Timestamp", "1" ),
  
  make_pair( "Ice.ThreadPool.Client.Size", "5" ),
  make_pair( "Ice.ThreadPool.Client.SizeMax", "20" ),
  make_pair( "Ice.ThreadPool.Server.Size", "5" ),
  make_pair( "Ice.ThreadPool.Server.SizeMax", "20" ),
  
  
  make_pair( "TeRK.direct-connect.protocol", "tcp" ),
  make_pair( "TeRK.direct-connect.port", "10101" ),
}
this array defines the values for TeRKDriver::TeRKProperties::defaults

Definition at line 193 of file TeRKDriver.h.


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

Tekkotsu Hardware Abstraction Layer 4.0
Generated Thu Nov 22 01:01:25 2007 by Doxygen 1.5.4