COOLFluiD
Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
|
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 Option & | option (const std::string &pname) const |
get a constant option from the list More... | |
Option & | option (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 Option & | operator[] (const std::string &pname) const |
contant access operator to properties More... | |
Option & | operator[] (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< Option > | xml_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 |
Abstracts the use of XML when adding options to a signal frame.
Definition at line 31 of file SignalOptions.hpp.
SignalOptions | ( | ) |
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.
frame | The 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.
list | List to copy |
Definition at line 243 of file SignalOptions.cpp.
~SignalOptions | ( | ) |
Desctructor. Flushes the options.
Definition at line 276 of file SignalOptions.cpp.
|
static |
Adds options to a provided map.
map | Map 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.
name | Frame name. Can be empty. |
sender | Sender path. Can be empty. |
receiver | Receiver path. Can be empty. |
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.
frame | The frame to add the reply to. Must be valid. |
sender | The reply sender. Can be empty. |
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.
Converts an XML node to an option (if possible).
This function handles all kind of options supported by COOLFluiD :
node | The node to convert. Must be valid. |
ProtocolError | if the "key" attribute is missing |
CastingFailed | if the value could not be cast to the destination type |
ShouldNotBeHere | if the option type is not recognized |
Definition at line 99 of file SignalOptions.cpp.
Map main_map |
The managed map.
Definition at line 98 of file SignalOptions.hpp.
Send comments to: COOLFluiD Web Admin |