Odyssey::Option Class Reference

Multi-valued containers for setting configurable options. More...

#include <Config.h>

List of all members.

Public Types

typedef ContainerIterator<
ValueList
ValueIterator
typedef ConstContainerIterator<
ValueList
ConstValueIterator

Public Member Functions

 Option ()
 Constructs an empty instance.
 Option (const Option &rhs)
 Share the values from the given option with this one.
void copy (const Option &rhs)
 Forces a copy of the values from the given Option to this one.
const Stringoperator[] (size_t index) const
 Operator access to values.
Stringoperator[] (size_t index)
 Operator access to values.
Optionoperator= (const Option &rhs)
 Share the values from the given option with this one.
Optionvalue (const String &value)
 Defines a new value to be appended.
const StringgetValue (size_t index, const String &def="") const
 Returns the value at the given index.
void removeValue (size_t index)
 Removes the value at the given index.
size_t getValueCount () const
 Returns the current number of values.
ValueIterator getValueIterator ()
 Provides iterator access to the values.
ConstValueIterator getValueIterator () const
 Provides iterator access to the values.
template<class Archive>
void serialize (Archive &ar, const unsigned int version)
 This is an archiver function for options.

Protected Types

typedef std::vector< StringValueList
typedef boost::shared_ptr<
OptionData
OptionDataPtr

Protected Attributes

OptionDataPtr _ptr

Friends

class Config

Classes

struct  OptionData


Detailed Description

Multi-valued containers for setting configurable options.

This class represents a configuration option, that may contains multiple assigned values. The Option uses strings to store data in a generic format.


Member Typedef Documentation

typedef ConstContainerIterator<ValueList> Odyssey::Option::ConstValueIterator
 

typedef boost::shared_ptr<OptionData> Odyssey::Option::OptionDataPtr [protected]
 

typedef ContainerIterator<ValueList> Odyssey::Option::ValueIterator
 

typedef std::vector<String> Odyssey::Option::ValueList [protected]
 


Constructor & Destructor Documentation

Odyssey::Option::Option  ) 
 

Constructs an empty instance.

Odyssey::Option::Option const Option rhs  ) 
 

Share the values from the given option with this one.


Member Function Documentation

void Odyssey::Option::copy const Option rhs  ) 
 

Forces a copy of the values from the given Option to this one.

This function will explicitely copy all values to this Option.

Parameters:
rhs the Option to copy values from

const String& Odyssey::Option::getValue size_t  index,
const String def = ""
const
 

Returns the value at the given index.

This function attempts to return the value at the given index. If no value is found, then the function will return the provided default value.

Parameters:
index the index to find the value
def the default to return in case of lookup failure

size_t Odyssey::Option::getValueCount  )  const
 

Returns the current number of values.

ConstValueIterator Odyssey::Option::getValueIterator  )  const
 

Provides iterator access to the values.

ValueIterator Odyssey::Option::getValueIterator  ) 
 

Provides iterator access to the values.

Option& Odyssey::Option::operator= const Option rhs  ) 
 

Share the values from the given option with this one.

String& Odyssey::Option::operator[] size_t  index  ) 
 

Operator access to values.

const String& Odyssey::Option::operator[] size_t  index  )  const
 

Operator access to values.

void Odyssey::Option::removeValue size_t  index  ) 
 

Removes the value at the given index.

template<class Archive>
void Odyssey::Option::serialize Archive &  ar,
const unsigned int  version
[inline]
 

This is an archiver function for options.

Option& Odyssey::Option::value const String value  ) 
 

Defines a new value to be appended.

Appends a new value to the end of the list of values. This function returns an Option to allow for chaining.

Parameters:
value the value to append


Friends And Related Function Documentation

friend class Config [friend]
 


Member Data Documentation

OptionDataPtr Odyssey::Option::_ptr [protected]
 


The documentation for this class was generated from the following file:
Generated on Sun Jan 7 01:18:52 2007 for Odyssey Meta-Engine by  doxygen 1.4.6-NO