COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
SignalOptions Class Reference

Abstracts the use of XML when adding options to a signal frame. More...

#include <SignalOptions.hpp>

Inherits OptionList.

Public Member Functions

 SignalOptions ()
 Default constructor. More...
 
 SignalOptions (SignalFrame &frame, const std::string &name=std::string())
 Constructor. More...
 
 SignalOptions (const OptionList &list)
 
 ~SignalOptions ()
 
SignalFrame create_frame (const std::string &name=std::string(), const URI &sender=URI(), const URI &receiver=URI()) const
 Creates a frame and puts the options in an "options" map. More...
 
SignalFrame create_reply_to (SignalFrame &frame, const URI &sender=URI()) const
 
void flush ()
 
- Public Member Functions inherited from OptionList
template<typename T >
SelectOptionType< T >::type & add (const std::string &name, const T &default_value=T())
 
template<typename OPTION_TYPE >
OPTION_TYPE & add (const boost::shared_ptr< OPTION_TYPE > &option)
 
template<typename TYPE >
void link_to_parameter (const std::string &pname, TYPE *par)
 sets a link to the option More...
 
const Optionoption (const std::string &pname) const
 get a constant option from the list More...
 
Optionoption (const std::string &pname)
 get an option from the list More...
 
const boost::shared_ptr< Option > & option_ptr (const std::string &pname)
 get a constant option from the list More...
 
const Optionoperator[] (const std::string &pname) const
 contant access operator to properties More...
 
Optionoperator[] (const std::string &pname)
 access operator to properties More...
 
void set (const std::string &pname, const boost::any &val)
 
bool set_if_exists (const std::string &pname, const boost::any &val)
 
template<typename TYPE >
const TYPE value (const std::string &opt_name) const
 Get the value of the option with given name. More...
 
bool check (const std::string &opt_name) const
 
void erase (const std::string &name)
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
std::string list_options () const
 list the options as a string More...
 
void set (const std::string &arg)
 Parses the strings to options. More...
 
void set (const std::vector< std::string > &args)
 Configure an option on this class from a list of human readable strings. More...
 

Static Public Member Functions

static boost::shared_ptr< Optionxml_to_option (const XmlNode &node)
 Converts an XML node to an option (if possible). More...
 
static void add_to_map (Map &main_map, const OptionList &list)
 

Public Attributes

Map main_map
 The managed map. More...
 
- Public Attributes inherited from OptionList
OptionStorage_t store
 storage of options More...
 

Additional Inherited Members

- Public Types inherited from OptionList
typedef std::map< std::string, boost::shared_ptr< Option > > OptionStorage_t
 type to store the options per name More...
 
typedef OptionStorage_t::iterator iterator
 
typedef OptionStorage_t::const_iterator const_iterator
 

Detailed Description

Abstracts the use of XML when adding options to a signal frame.

Author
Quentin Gasper.

Definition at line 31 of file SignalOptions.hpp.

Constructor & Destructor Documentation

Default constructor.

No map is managed when using this constructor.

Definition at line 235 of file SignalOptions.cpp.

SignalOptions ( SignalFrame frame,
const std::string &  name = std::string() 
)

Constructor.

Parses the XML data to options.

Parameters
frameThe frame to parse. Must be valid.

Definition at line 251 of file SignalOptions.cpp.

SignalOptions ( const OptionList list)

Constructor. Creates a copy of the provided list.

Parameters
listList to copy

Definition at line 243 of file SignalOptions.cpp.

Desctructor. Flushes the options.

Definition at line 276 of file SignalOptions.cpp.

Member Function Documentation

void add_to_map ( Map main_map,
const OptionList list 
)
static

Adds options to a provided map.

Parameters
mapMap options will be added to. Must be valid.

Definition at line 297 of file SignalOptions.cpp.

SignalFrame create_frame ( const std::string &  name = std::string(),
const URI sender = URI(),
const URI receiver = URI() 
) const

Creates a frame and puts the options in an "options" map.

This method does not need a valid managed map. It is ignored if it exists.

Parameters
nameFrame name. Can be empty.
senderSender path. Can be empty.
receiverReceiver path. Can be empty.
Returns
Returns the created frame.

Definition at line 283 of file SignalOptions.cpp.

SignalFrame create_reply_to ( SignalFrame frame,
const URI sender = URI() 
) const

Creates a reply to a specified frame and puts options to it. This method does not need a valid managed map. It is ignored if it exists.

Parameters
frameThe frame to add the reply to. Must be valid.
senderThe reply sender. Can be empty.
Returns
Returns the created frame.

Definition at line 320 of file SignalOptions.cpp.

void flush ( )

Writes option to the managed map. If the managed map is not valid, nothing is done.

Definition at line 312 of file SignalOptions.cpp.

boost::shared_ptr< Option > xml_to_option ( const XmlNode node)
static

Converts an XML node to an option (if possible).

This function handles all kind of options supported by COOLFluiD :

  • single values or arrays
  • advanced or basic options
  • with or without a restricted list of values
    Parameters
    nodeThe node to convert. Must be valid.
    Returns
    Returns the converted.
    Exceptions
    ProtocolErrorif the "key" attribute is missing
    CastingFailedif the value could not be cast to the destination type
    ShouldNotBeHereif the option type is not recognized

Definition at line 99 of file SignalOptions.cpp.

Member Data Documentation

Map main_map

The managed map.

Definition at line 98 of file SignalOptions.hpp.


The documentation for this class was generated from the following files:
Send comments to:
COOLFluiD Web Admin