RSC  0.16.0
rsc::config::CollectingOptionHandler Class Reference

An OptionHandler which collects the options in an instance of Properties. More...

#include <CollectingOptionHandler.h>

Inheritance diagram for rsc::config::CollectingOptionHandler:
Inheritance graph
Collaboration diagram for rsc::config::CollectingOptionHandler:
Collaboration graph

Public Member Functions

 CollectingOptionHandler ()
 Creates a new handler which uses an empty Properties instance for collecting options. More...
 
 CollectingOptionHandler (const rsc::runtime::Properties &properties)
 Creates a new handler which will use a copy of the passed Properties instance. More...
 
void handleOption (const std::vector< std::string > &key, const std::string &value)
 This method is called once for each individual option available from a given ConfigSource. More...
 
rsc::runtime::Properties getOptions () const
 Returns the options this handler has collected so far. More...
 
- Public Member Functions inherited from rsc::config::OptionHandler
virtual ~OptionHandler ()
 

Private Attributes

rsc::runtime::Properties options
 

Detailed Description

An OptionHandler which collects the options in an instance of Properties.

Author
jwienke

Definition at line 42 of file CollectingOptionHandler.h.

Constructor & Destructor Documentation

rsc::config::CollectingOptionHandler::CollectingOptionHandler ( )

Creates a new handler which uses an empty Properties instance for collecting options.

Definition at line 34 of file CollectingOptionHandler.cpp.

rsc::config::CollectingOptionHandler::CollectingOptionHandler ( const rsc::runtime::Properties properties)

Creates a new handler which will use a copy of the passed Properties instance.

Attention
The Properties instance passed into this constructor will not be modified directly. After letting this handler process options you need to get the modified version using getOptions.
Parameters
propertiesA properties instance to start from. Won't be modified directly. A copy will be used.

Definition at line 37 of file CollectingOptionHandler.cpp.

Member Function Documentation

runtime::Properties rsc::config::CollectingOptionHandler::getOptions ( ) const

Returns the options this handler has collected so far.

Returns
Copy of the Properties object used for collecting options.

Definition at line 55 of file CollectingOptionHandler.cpp.

References options.

void rsc::config::CollectingOptionHandler::handleOption ( const std::vector< std::string > &  key,
const std::string &  value 
)
virtual

This method is called once for each individual option available from a given ConfigSource.

Parameters
keyA list of hierarchical key components that identify the option.
valueThe value of the option.

Implements rsc::config::OptionHandler.

Definition at line 42 of file CollectingOptionHandler.cpp.

References options.

Member Data Documentation

rsc::runtime::Properties rsc::config::CollectingOptionHandler::options
private

Definition at line 75 of file CollectingOptionHandler.h.

Referenced by getOptions(), and handleOption().


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