COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
Public Types | Public Member Functions | Private Member Functions | List of all members
OptionArray< TYPE > Class Template Reference

#include <OptionArray.hpp>

Inherits Option.

Public Types

typedef std::vector< TYPE > value_type
 
typedef TYPE ElementT
 
- Public Types inherited from Option
typedef boost::function< void() > TriggerT
 Typedef for trigger functions. More...
 
typedef Uint TriggerID
 ID for triggers. More...
 
typedef std::map< TriggerID, TriggerTTriggerStorageT
 Typedef for trigger functions storage. More...
 

Public Member Functions

 OptionArray (const std::string &name, const value_type &def)
 
virtual ~OptionArray ()
 
VIRTUAL FUNCTIONS
virtual std::string element_type () const
 Returns a C-strng representation of element type. More...
 
virtual std::string value_str () const
 
virtual boost::any value () const
 
template<typename OutputT >
OutputT value () const
 Redirect form the base class due to conflict with the non-template. More...
 
virtual std::string restricted_list_str () const
 Return the restricted list as string. More...
 
virtual void set_restricted_list_str (const std::vector< std::string > &list)
 Set the restricted list using a vector of strings. More...
 
- Public Member Functions inherited from Option
 Option (const std::string &name, boost::any def)
 
virtual ~Option ()
 Desctructor. More...
 
template<typename TYPE >
TYPE value () const
 Casts the value to the provided TYPE. More...
 
template<typename OPTION_TYPE >
OPTION_TYPE & cast_to ()
 
template<typename OPTION_TYPE >
const OPTION_TYPE & cast_to () const
 
Optionpretty_name (const std::string &pretty_name)
 Sets the option pretty name. More...
 
Optiondescription (const std::string &description)
 Sets the option description. More...
 
Optionseparator (const std::string &separator)
 Sets the option operator. The separator is used in some convertions to string to separate items, i.e. the restricted list of values or the option value if it is an array. More...
 
void set (XML::XmlNode &node)
 configure this option using the passed xml node More...
 
Optionattach_trigger (TriggerT trigger)
 
TriggerID attach_trigger_tracked (TriggerT trigger)
 Attach a trigger, returning an ID that can be used to detach again. More...
 
void detach_trigger (const TriggerID trigger_id)
 Detach the given trigger. More...
 
std::string name () const
 
std::string pretty_name () const
 
std::string description () const
 
std::string separator () const
 
Optionoperator= (const boost::any &new_value)
 
template<typename TYPE >
Optionlink_to (TYPE *par)
 
Optionlink_option (const boost::shared_ptr< common::Option > &linked)
 Link another option to this option. More...
 
Optionmark_basic ()
 
virtual void change_value (const boost::any &value)
 change the value of this option More...
 
std::vector< boost::any > & restricted_list ()
 Gives a reference to the restricted list. More...
 
const std::vector< boost::any > & restricted_list () const
 Gives a const reference to the restricted list. More...
 
virtual bool has_restricted_list () const
 Checks whether the option has a list of restricted values. More...
 
void trigger () const
 Calls the triggers connected to this option. More...
 
void restore_default ()
 restore the default value of the option More...
 
virtual std::string type () const
 
- Public Member Functions inherited from TaggedObject
 TaggedObject ()
 Constructor. More...
 
bool has_tag (const std::string &tag) const
 
void add_tag (const std::string &tag)
 
std::vector< std::string > get_tags () const
 
void remove_tag (const std::string &tag)
 

Private Member Functions

virtual void copy_to_linked_params (std::vector< boost::any > &linked_params)
 copy the configured update value to all linked parameters More...
 
virtual boost::any extract_configured_value (XML::XmlNode &node)
 
virtual void change_value_impl (const boost::any &value)
 Concrete implementation of the value changing. More...
 

Additional Inherited Members

- Protected Attributes inherited from Option
boost::any m_value
 storage of the value of the option More...
 
std::vector< boost::any > m_linked_params
 parameters that also get updated when option is changed More...
 
std::vector< Handle< Option > > m_linked_opts
 options that also get updated when option is changed More...
 

Detailed Description

template<typename TYPE>
class cf3::common::OptionArray< TYPE >

Class defines an array of options of the same type

Author
Tiago Quintino
Bart Janssens

Definition at line 28 of file OptionArray.hpp.

Member Typedef Documentation

typedef TYPE ElementT

Definition at line 32 of file OptionArray.hpp.

typedef std::vector<TYPE> value_type

Definition at line 31 of file OptionArray.hpp.

Constructor & Destructor Documentation

OptionArray ( const std::string &  name,
const value_type def 
)
inline

Definition at line 34 of file OptionArray.hpp.

virtual ~OptionArray ( )
inlinevirtual

Definition at line 38 of file OptionArray.hpp.

Member Function Documentation

virtual void change_value_impl ( const boost::any &  value)
inlineprivatevirtual

Concrete implementation of the value changing.

Implements Option.

Definition at line 114 of file OptionArray.hpp.

virtual void copy_to_linked_params ( std::vector< boost::any > &  linked_params)
inlineprivatevirtual

copy the configured update value to all linked parameters

Implements Option.

Definition at line 87 of file OptionArray.hpp.

virtual std::string element_type ( ) const
inlinevirtual

Returns a C-strng representation of element type.

Reimplemented from Option.

Definition at line 44 of file OptionArray.hpp.

virtual boost::any extract_configured_value ( XML::XmlNode node)
inlineprivatevirtual

Get the value to use from XML

Parameters
nodeXML node with data for this option

Implements Option.

Definition at line 97 of file OptionArray.hpp.

virtual std::string restricted_list_str ( ) const
inlinevirtual

Return the restricted list as string.

Implements Option.

Definition at line 66 of file OptionArray.hpp.

virtual void set_restricted_list_str ( const std::vector< std::string > &  list)
inlinevirtual

Set the restricted list using a vector of strings.

Implements Option.

Definition at line 76 of file OptionArray.hpp.

virtual boost::any value ( ) const
inlinevirtual
Returns
A copy of the stored value

Reimplemented from Option.

Definition at line 54 of file OptionArray.hpp.

OutputT value ( ) const
inlinevirtual

Redirect form the base class due to conflict with the non-template.

Reimplemented from Option.

Definition at line 61 of file OptionArray.hpp.

virtual std::string value_str ( ) const
inlinevirtual
Returns
Returns the value cast to string.

Implements Option.

Definition at line 46 of file OptionArray.hpp.


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