MoochoPack: Miscellaneous Utilities for MOOCHO  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Protected Member Functions | List of all members
OptionsFromStreamPack::SetOptionsFromStreamNode Class Referenceabstract

Node class for setting options from a stream. More...

#include <OptionsFromStreamPack_SetOptionsFromStreamNode.hpp>

Inheritance diagram for OptionsFromStreamPack::SetOptionsFromStreamNode:
Inheritance graph
[legend]

Public Member Functions

 SetOptionsFromStreamNode (const std::string &options_group, int num_options, const char *option_names[], bool exists_optional=true)
 Constructs with the name of the options group and the names of the options. More...
 
void set_options (const OptionsFromStream &options)
 Overridden from SetOptionsFromStream and calls setOption(...). More...
 
- Public Member Functions inherited from OptionsFromStreamPack::SetOptionsFromStream
virtual ~SetOptionsFromStream ()
 

Protected Member Functions

virtual void setOption (int option_num, const std::string &option_value)=0
 To be overridden by the subclass to set an option given its integer position and the option value. More...
 

Detailed Description

Node class for setting options from a stream.

This class uses the template method pattern to delegate the setting of options.

Definition at line 55 of file OptionsFromStreamPack_SetOptionsFromStreamNode.hpp.

Constructor & Destructor Documentation

OptionsFromStreamPack::SetOptionsFromStreamNode::SetOptionsFromStreamNode ( const std::string &  options_group,
int  num_options,
const char *  option_names[],
bool  exists_optional = true 
)

Constructs with the name of the options group and the names of the options.

Parameters
options_groupThe name of the options group to access
num_optionsThe number of options in the opitons group.
option_nameAn array (length num_options) containing the names of the options.
exists_optionalSpecifies if the options group must exist.

Definition at line 50 of file OptionsFromStreamPack_SetOptionsFromStreamNode.cpp.

Member Function Documentation

void OptionsFromStreamPack::SetOptionsFromStreamNode::set_options ( const OptionsFromStream options)
virtual

Overridden from SetOptionsFromStream and calls setOption(...).

The options group #options_group# is used. If this options group does not exist and #exists_optional# == false then an #std::invalid_argument# exception will be thrown.

Implements OptionsFromStreamPack::SetOptionsFromStream.

Definition at line 56 of file OptionsFromStreamPack_SetOptionsFromStreamNode.cpp.

virtual void OptionsFromStreamPack::SetOptionsFromStreamNode::setOption ( int  option_num,
const std::string &  option_value 
)
protectedpure virtual

To be overridden by the subclass to set an option given its integer position and the option value.

The integer possition returned is the possition of the option in option_names[option_num] that was passed to the constructor.


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