PWToolBox::Configuration::ConfigurationSetting Struct Reference

This represents a setting in the configuration file. More...

#include <ConfigurationSetting.h>

List of all members.

Public Types

typedef boost::shared_ptr<
ConfigurationSetting
SharedPtr
 A shared pointer to this type.
typedef boost::shared_ptr<
ConfigurationSetting const > 
ConstSharedPtr
 A shared pointer to constant data of this type.
typedef std::map< std::string,
std::string > 
AttributeList
 A list of attributes.

Public Member Functions

 ConfigurationSetting (std::string const &name_, std::string const &value_="", AttributeList const &attributes_=AttributeList())
template<typename T>
getValueAs () const
 Returns the value as a specific data type.
template<typename T>
void setValue (T const &newValue)
 Sets the value of the setting.

Public Attributes

std::string const name
 The name of the setting.
std::string value
 The value of the setting.
AttributeList attributes
 The attributes of the setting.


Detailed Description

This represents a setting in the configuration file.

The setting consists of a name, a value, and a list of attributes that are associated with it.


Member Typedef Documentation

typedef boost::shared_ptr<ConfigurationSetting> PWToolBox::Configuration::ConfigurationSetting::SharedPtr

A shared pointer to this type.

typedef boost::shared_ptr<ConfigurationSetting const> PWToolBox::Configuration::ConfigurationSetting::ConstSharedPtr

A shared pointer to constant data of this type.

typedef std::map<std::string,std::string> PWToolBox::Configuration::ConfigurationSetting::AttributeList

A list of attributes.


Constructor & Destructor Documentation

PWToolBox::Configuration::ConfigurationSetting::ConfigurationSetting ( std::string const &  name_,
std::string const &  value_ = "",
AttributeList const &  attributes_ = AttributeList() 
) [inline]

Parameters:
name_ The name of the setting
value_ The value of the setting
attributes_ The attributes associated with the setting
Exceptions:
InvalidArgumentException Thrown if name is empty


Member Function Documentation

template<typename T>
T PWToolBox::Configuration::ConfigurationSetting::getValueAs (  )  const [inline]

Returns the value as a specific data type.

The type must be convertable from std::string and it must be copyable.

Exceptions:
IllegalOperationException Thrown if the setting is not convertable from std::string to the requested type
Returns:
The value of the setting as a specific data type

template<typename T>
void PWToolBox::Configuration::ConfigurationSetting::setValue ( T const &  newValue  )  [inline]

Sets the value of the setting.

newValue must be convertable to std::string

Parameters:
newValue The new value of the setting
Exceptions:
IllegalOperationException Thrown if newValue could not be converted to a std::string


Member Data Documentation

std::string const PWToolBox::Configuration::ConfigurationSetting::name

The name of the setting.

std::string PWToolBox::Configuration::ConfigurationSetting::value

The value of the setting.

AttributeList PWToolBox::Configuration::ConfigurationSetting::attributes

The attributes of the setting.


The documentation for this struct was generated from the following file:
Generated on Sun Jul 13 14:18:27 2008 for PWToolBox by  doxygen 1.5.1