COOLFluiD
Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
|
Base class for defining CF components. More...
#include <Component.hpp>
Inherits noncopyable, SignalHandler, ConnectionManager, TaggedObject, and enable_shared_from_this< Component >.
Inherited by CAbstract, Action, BinaryDataReader, BinaryDataWriter, Builder, CAbstract, CodeProfiler, DynTable< T >, Environment, Factories, Factory, Group, Journal, Libraries, Library, Link, List< ValueT >, Map< KEY, DATA >, CommPattern, CommWrapper, Manager, WorkerGroup, Table< ValueT >, Matrix, ParameterList, ParameterListDefaults, SolutionStrategy, System, Vector, VariableManager, VariablesDescriptor, AInterpolator, APointInterpolator, BlockArrays, BoundingBox, Dictionary, Domain, ElementFinder, ElementType, Entities, FaceCellConnectivity, FaceConnectivity, FieldManager, InterpolationFunction, LoadMesh, MergedParallelDistribution, Mesh, MeshMetadata, Node2FaceCellConnectivity, NodeConnectivity, NodeElementConnectivity, Octtree, ParallelDistribution, Quadrature, Region, ShapeFunction, Space, StencilComputer, UnifiedData, PhysModel, Variables, NetworkXPython, ScriptEngine, TestAllOptions, TestSignals, Criterion, History, Model, PDE, Plotter, PlotXY, RiemannSolver< DATA, NB_DIM, NB_EQS >, Term, Time, Wizard, Notifier, Notifier, CWorker, Hello, CNode, C3DView, C3DViewBuilder, CCore, CSmall, HolderT< SubCompT >, List< bool >, List< int >, List< Uint >, MyC, Part, Table< Real >, and Table< Uint >.
Public Types | |
typedef ComponentIterator< Component > | iterator |
type of the iterator to Component More... | |
typedef ComponentIterator< Component const > | const_iterator |
type of the iterator to constant Component More... | |
Public Types inherited from SignalHandler | |
typedef std::vector< SignalPtr > | storage_t |
storage type for signals More... | |
Public Member Functions | |||
Component (const std::string &name) | |||
virtual | ~Component () | ||
Virtual destructor. More... | |||
const std::string & | name () const | ||
Access the name of the component. More... | |||
void | rename (const std::string &name) | ||
Rename the component. More... | |||
URI | uri () const | ||
Construct the full path. More... | |||
void | complete_path (URI &path) const | ||
Handle< Component > | access_component (const URI &path) const | ||
Handle< Component > | access_component_checked (const URI &path) | ||
Handle< Component const > | access_component_checked (const URI &path) const | ||
Handle< Component > | handle () | ||
Get a handle to the component. More... | |||
Handle< Component const > | handle () const | ||
template<typename ComponentT > | |||
Handle< ComponentT > | handle () | ||
template<typename ComponentT > | |||
Handle< ComponentT const > | handle () const | ||
Handle< Component > | parent () const | ||
Handle< Component const > | root () const | ||
Handle< Component > | root () | ||
Handle< Component > | get_child (const std::string &name) | ||
Handle< Component const > | get_child (const std::string &name) const | ||
Handle< Component > | get_child_checked (const std::string &name) | ||
Handle< Component const > | get_child_checked (const std::string &name) const | ||
Handle< Component > | create_component (const std::string &name, const std::string &builder) | ||
Build a (sub)component of this component using the extended type_name of the component. More... | |||
template<typename T > | |||
Handle< T > | create_component (const std::string &name) | ||
Create a (sub)component of this component automatically cast to the specified type. More... | |||
template<typename T > | |||
Handle< T > | create_static_component (const std::string &name) | ||
Create a static "always there" subcomponent. More... | |||
Component & | add_component (const boost::shared_ptr< Component > &subcomp) | ||
Add the passed component as a subcomponent. More... | |||
void | add_link (Component &linked_component) | ||
boost::shared_ptr< Component > | remove_component (const std::string &name) | ||
Remove a (sub)component of this component. More... | |||
boost::shared_ptr< Component > | remove_component (Component &subcomp) | ||
Remove a (sub)component of this component. More... | |||
void | clear () | ||
Remove all sub-components of this component, except for the static ones. More... | |||
void | move_to (Component &to_parent) | ||
std::string | tree (bool basic_mode=false, Uint depth=0, Uint recursion_level=0) const | ||
std::string | info (const std::string &what=std::string("cospt")) const | ||
size_t | count_children () const | ||
virtual std::string | derived_type_name () const =0 | ||
PropertyList & | properties () | ||
const PropertyList & | properties () const | ||
OptionList & | options () | ||
const OptionList & | options () const | ||
void | reset_options () | ||
Reset all options to their default value. More... | |||
void | configure_option_recursively (const std::string &optname, const boost::any &val) | ||
Component & | mark_basic () | ||
marks this component as basic. More... | |||
template<typename ComponentT > | |||
void | put_components (std::vector< boost::shared_ptr< ComponentT > > &vec, const bool recurse) | ||
template<typename ComponentT > | |||
void | put_components (std::vector< boost::shared_ptr< ComponentT const > > &vec, const bool recurse) const | ||
template<> | |||
void | put_components (std::vector< boost::shared_ptr< Component > > &vec, const bool recurse) | ||
template<> | |||
void | put_components (std::vector< boost::shared_ptr< Component const > > &vec, const bool recurse) const | ||
ITERATORS | |||
Component::iterator | begin () | ||
The begin iterator for a range containing Components. More... | |||
Component::iterator | end () | ||
The end iterator for a range containing Components. More... | |||
Component::const_iterator | begin () const | ||
The begin iterator for a range containing Components (const version) More... | |||
Component::const_iterator | end () const | ||
The end iterator for a range containing Components (const version) More... | |||
Component::iterator | recursive_begin () | ||
The begin iterator for a recursive range containing Components. More... | |||
Component::iterator | recursive_end () | ||
The end iterator for a recursive range containing Components. More... | |||
Component::const_iterator | recursive_begin () const | ||
The begin iterator for a recursive range containing Components (const version) More... | |||
Component::const_iterator | recursive_end () const | ||
The end iterator for a recursive range containing Components (const version) More... | |||
name to give to the created omponent | |||
Create a component of a given abstract type using a reduced builder name
| |||
template<typename T > | |||
Handle< T > | create_component (const std::string &name, const std::string &builder) | ||
Create a component using the reduced builder name. More... | |||
SIGNALS | |||
void | signal_configure (SignalArgs &args) | ||
configures all the options on this class More... | |||
void | signal_create_component (SignalArgs &args) | ||
creates a component from this component More... | |||
void | signal_delete_component (SignalArgs &args) | ||
delete this component More... | |||
void | signal_move_component (SignalArgs &args) | ||
moves a component from this component to another More... | |||
void | signal_list_tree (SignalArgs &args) const | ||
lists the sub components and puts them on the xml_tree More... | |||
void | signal_list_tree_recursive (SignalArgs &args) const | ||
prints tree recursively More... | |||
void | signal_list_properties (SignalArgs &args) const | ||
lists the properties of this component More... | |||
void | signal_list_options (SignalArgs &args) const | ||
lists the properties of this component More... | |||
void | signal_list_options_recursive (SignalArgs &args) const | ||
prints all options recursive More... | |||
void | signal_list_signals (SignalArgs &args) const | ||
lists the signals of this component More... | |||
void | signal_list_signals_recursive (SignalArgs &args) const | ||
prints all signals recursive More... | |||
void | signal_print_info (SignalArgs &args) const | ||
gets info on this component More... | |||
void | signal_print_tree (SignalArgs &args) const | ||
signal to print the tree More... | |||
void | signature_print_tree (SignalArgs &args) const | ||
signature to signal_print_tree More... | |||
void | signal_rename_component (SignalArgs &args) | ||
renames this component More... | |||
void | signal_save_tree (SignalArgs &args) | ||
dumps the tree to a file More... | |||
void | signal_list_content (SignalArgs &args) | ||
gives information about this component such as options, signals, ... More... | |||
void | signal_signature (SignalArgs &args) | ||
Gives a signal signature, if any. More... | |||
void | signature_create_component (SignalArgs &args) | ||
void | signature_rename_component (SignalArgs &args) | ||
void | signature_move_component (SignalArgs &args) | ||
void | signal_store_timings (SignalArgs &args) | ||
Signal to store the timings (if enabled) into properties, i.e. for readout from python or the GUI. More... | |||
void | signal_clear (SignalArgs &args) | ||
Signal to remove all sub-components. More... | |||
void | signal_reset_options (SignalArgs &args) | ||
Signal to set all options to their default value. More... | |||
void | signal_add_tag (SignalArgs &args) | ||
Signal to add a tag. More... | |||
void | signature_add_tag (SignalArgs &args) | ||
Public Member Functions inherited from SignalHandler | |||
~SignalHandler () | |||
const storage_t & | signal_list () const | ||
SignalPtr | signal (const SignalID &sname) | ||
SignalCPtr | signal (const SignalID &sname) const | ||
SignalRet | call_signal (const SignalID &sname, SignalArgs &sinput) | ||
Calls the signal by providing its name and input. More... | |||
SignalRet | call_signal (const SignalID &sname, std::vector< std::string > &sinput) | ||
Calls the signal by providing its name and input. More... | |||
bool | signal_exists (const SignalID &sname) const | ||
Checks if a signal exists or not. More... | |||
Signal & | regist_signal (const SignalID &sname) | ||
Regist signal. More... | |||
void | unregist_signal (const SignalID &sname) | ||
Unregist signal. More... | |||
Public Member Functions inherited from ConnectionManager | |||
~ConnectionManager () | |||
destructor closes all connections More... | |||
Connection * | connection (const std::string &name) | ||
Connection * | manage_connection (const std::string &name) | ||
manages a connection (creates if necessary) More... | |||
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) | ||
Static Public Member Functions | |
static std::string | type_name () |
Get the class name. More... | |
Protected Member Functions | |
Component & | add_static_component (const boost::shared_ptr< Component > &subcomp) |
Add a static (sub)component of this component. More... | |
void | raise_tree_updated_event () |
raise event that the path has changed More... | |
Private Types | |
typedef std::vector< boost::shared_ptr< Component > > | CompStorageT |
type for storing the sub components More... | |
typedef std::map< std::string, Uint > | CompLookupT |
Type for storing component lookup-by-name. More... | |
Private Member Functions | |
void | change_parent (Handle< Component > to_parent) |
Modify the parent of this component. More... | |
std::string | ensure_unique_name (Component &subcomp) |
insures the sub component has a unique name within this component More... | |
void | write_xml_tree (XML::XmlNode &node, bool put_all_content) const |
void | on_ping_event (SignalArgs &args) |
Triggered when the "ping" event is raised. Useful to find out what components still exist. More... | |
Private Attributes | |
std::string | m_name |
component name (stored as path to ensure validity) More... | |
boost::shared_ptr< PropertyList > | m_properties |
storage of the property list (pointer to avoid header include) More... | |
boost::shared_ptr< OptionList > | m_options |
storage of the option list (pointer to avoid header include) More... | |
CompStorageT | m_components |
list of sub-components More... | |
CompLookupT | m_component_lookup |
lookup of the index of a component More... | |
Component * | m_parent |
pointer to parent, naked pointer because of static components More... | |
Friends | |
template<class T > | |
class | boost::enable_shared_from_this |
Friend declarations allow enable_shared_from_this to be private. More... | |
template<class T > | |
class | boost::shared_ptr |
Additional Inherited Members | |
Public Attributes inherited from SignalHandler | |
storage_t | m_signals |
storage of the signals More... | |
Base class for defining CF components.
The Component class is the base principle of COOLFluiD. Components can hold other components, much like the filesystem of your OS. See this page for a more complete understanding.
Components:
See this page for a tutorial how to work with components.
Definition at line 82 of file Component.hpp.
|
private |
Type for storing component lookup-by-name.
Definition at line 102 of file Component.hpp.
|
private |
type for storing the sub components
Definition at line 99 of file Component.hpp.
typedef ComponentIterator<Component const> const_iterator |
type of the iterator to constant Component
Definition at line 94 of file Component.hpp.
typedef ComponentIterator<Component> iterator |
type of the iterator to Component
Definition at line 92 of file Component.hpp.
Component | ( | const std::string & | name | ) |
|
virtual |
Virtual destructor.
Definition at line 207 of file Component.cpp.
Looks for a component via its path
path | to the component |
Definition at line 487 of file Component.cpp.
path | to the component |
InvalidURI | in case a component is not found at that path |
Definition at line 550 of file Component.cpp.
Definition at line 558 of file Component.cpp.
Add the passed component as a subcomponent.
Definition at line 289 of file Component.cpp.
void add_link | ( | Component & | linked_component | ) |
Add a link to the passed component, as child. The name of the link will be the same as the name of the passed component.
Definition at line 317 of file Component.cpp.
Add a static (sub)component of this component.
Definition at line 324 of file Component.cpp.
Component::iterator begin | ( | ) |
The begin iterator for a range containing Components.
Definition at line 1318 of file Component.cpp.
Component::const_iterator begin | ( | ) | const |
The begin iterator for a range containing Components (const version)
Definition at line 1336 of file Component.cpp.
Modify the parent of this component.
Definition at line 469 of file Component.cpp.
void clear | ( | ) |
Remove all sub-components of this component, except for the static ones.
Definition at line 409 of file Component.cpp.
void complete_path | ( | URI & | path | ) | const |
Resolves relative elements within a path to complete it. The path may be relative to this component or absolute.
path | to a component |
Definition at line 426 of file Component.cpp.
void configure_option_recursively | ( | const std::string & | optname, |
const boost::any & | val | ||
) |
Configures one property recursevely through this component children, triggering its actions. If an option has the tag "norecurse" recursion is inhibited on that option
[in] | optname | The option name |
[in] | val | The new value assigned to the option |
Definition at line 1157 of file Component.cpp.
size_t count_children | ( | ) | const |
Definition at line 835 of file Component.cpp.
Build a (sub)component of this component using the extended type_name of the component.
The Library is extracted from the extended type_name, and inside is searched for the builder. The builder creates the component. The component is then added as a subcomponent. See here for a tutorial
Definition at line 568 of file Component.cpp.
|
inline |
Create a (sub)component of this component automatically cast to the specified type.
Definition at line 214 of file Component.hpp.
Handle< T > create_component | ( | const std::string & | name, |
const std::string & | builder | ||
) |
Create a component using the reduced builder name.
Definition at line 598 of file Component.hpp.
|
inline |
Create a static "always there" subcomponent.
Definition at line 227 of file Component.hpp.
|
pure virtual |
cf3::common::TypeInfo
Component::iterator end | ( | ) |
The end iterator for a range containing Components.
Definition at line 1327 of file Component.cpp.
Component::const_iterator end | ( | ) | const |
The end iterator for a range containing Components (const version)
Definition at line 1345 of file Component.cpp.
|
private |
insures the sub component has a unique name within this component
Definition at line 342 of file Component.cpp.
Gets the named child component from the list of direct subcomponents.l
Definition at line 441 of file Component.cpp.
Definition at line 433 of file Component.cpp.
Gets the named child component from the list of direct subcomponents.
ValueNotFound | in case a component with given name is not found |
Definition at line 458 of file Component.cpp.
Definition at line 449 of file Component.cpp.
Get a handle to the component.
Definition at line 179 of file Component.hpp.
Definition at line 180 of file Component.hpp.
|
inline |
Definition at line 183 of file Component.hpp.
|
inline |
Definition at line 185 of file Component.hpp.
std::string info | ( | const std::string & | what = std::string("cospt") | ) | const |
[in] | what | every character of this string represents what to output: c : sub components o : options s : signals p : properties t : tags |
Definition at line 630 of file Component.cpp.
Component & mark_basic | ( | ) |
marks this component as basic.
Definition at line 1076 of file Component.cpp.
void move_to | ( | Component & | to_parent | ) |
Move this component to within another one
to_parent | will be the new parent of this component |
Definition at line 477 of file Component.cpp.
|
inline |
Access the name of the component.
Definition at line 146 of file Component.hpp.
|
private |
Triggered when the "ping" event is raised. Useful to find out what components still exist.
Definition at line 1311 of file Component.cpp.
OptionList & options | ( | ) |
Definition at line 856 of file Component.cpp.
const OptionList & options | ( | ) | const |
Definition at line 863 of file Component.cpp.
Definition at line 256 of file Component.cpp.
PropertyList & properties | ( | ) |
Definition at line 842 of file Component.cpp.
const PropertyList & properties | ( | ) | const |
Definition at line 849 of file Component.cpp.
|
inline |
Put all subcomponents in a given vector, optionally recursive
[out] | vec | A vector of all (recursive) subcomponents |
[in] | recurse | If true, recurse through all subcomponents. If false, puts only direct children |
Definition at line 457 of file Component.hpp.
void put_components | ( | std::vector< boost::shared_ptr< ComponentT const > > & | vec, |
const bool | recurse | ||
) | const |
Put all subcomponents in a given vector, optionally recursive
[out] | vec | A vector of all (recursive) subcomponents |
[in] | recurse | If true, recurse through all subcomponents. If false, puts only direct children |
Definition at line 474 of file Component.hpp.
|
inline |
Definition at line 492 of file Component.hpp.
|
inline |
Definition at line 509 of file Component.hpp.
|
protected |
raise event that the path has changed
Definition at line 1068 of file Component.cpp.
Component::iterator recursive_begin | ( | ) |
The begin iterator for a recursive range containing Components.
Definition at line 1354 of file Component.cpp.
Component::const_iterator recursive_begin | ( | ) | const |
The begin iterator for a recursive range containing Components (const version)
Definition at line 1372 of file Component.cpp.
Component::iterator recursive_end | ( | ) |
The end iterator for a recursive range containing Components.
Definition at line 1363 of file Component.cpp.
Component::const_iterator recursive_end | ( | ) | const |
The end iterator for a recursive range containing Components (const version)
Definition at line 1381 of file Component.cpp.
boost::shared_ptr< Component > remove_component | ( | const std::string & | name | ) |
Remove a (sub)component of this component.
Definition at line 357 of file Component.cpp.
Remove a (sub)component of this component.
Definition at line 402 of file Component.cpp.
void rename | ( | const std::string & | name | ) |
Rename the component.
Definition at line 215 of file Component.cpp.
void reset_options | ( | ) |
Reset all options to their default value.
Definition at line 870 of file Component.cpp.
Definition at line 266 of file Component.cpp.
Definition at line 277 of file Component.cpp.
void signal_add_tag | ( | SignalArgs & | args | ) |
Signal to add a tag.
Definition at line 1141 of file Component.cpp.
void signal_clear | ( | SignalArgs & | args | ) |
Signal to remove all sub-components.
Definition at line 1127 of file Component.cpp.
void signal_configure | ( | SignalArgs & | args | ) |
configures all the options on this class
Definition at line 962 of file Component.cpp.
void signal_create_component | ( | SignalArgs & | args | ) |
creates a component from this component
Definition at line 580 of file Component.cpp.
void signal_delete_component | ( | SignalArgs & | args | ) |
delete this component
Definition at line 609 of file Component.cpp.
void signal_list_content | ( | SignalArgs & | args | ) |
gives information about this component such as options, signals, ...
Definition at line 1036 of file Component.cpp.
void signal_list_options | ( | SignalArgs & | args | ) | const |
lists the properties of this component
Definition at line 899 of file Component.cpp.
void signal_list_options_recursive | ( | SignalArgs & | args | ) | const |
prints all options recursive
Definition at line 907 of file Component.cpp.
void signal_list_properties | ( | SignalArgs & | args | ) | const |
lists the properties of this component
Definition at line 880 of file Component.cpp.
void signal_list_signals | ( | SignalArgs & | args | ) | const |
lists the signals of this component
Definition at line 926 of file Component.cpp.
void signal_list_signals_recursive | ( | SignalArgs & | args | ) | const |
prints all signals recursive
Definition at line 947 of file Component.cpp.
void signal_list_tree | ( | SignalArgs & | args | ) | const |
lists the sub components and puts them on the xml_tree
Definition at line 765 of file Component.cpp.
void signal_list_tree_recursive | ( | SignalArgs & | args | ) | const |
prints tree recursively
Definition at line 774 of file Component.cpp.
void signal_move_component | ( | SignalArgs & | args | ) |
moves a component from this component to another
Definition at line 617 of file Component.cpp.
void signal_print_info | ( | SignalArgs & | args | ) | const |
gets info on this component
Definition at line 710 of file Component.cpp.
void signal_print_tree | ( | SignalArgs & | args | ) | const |
signal to print the tree
Definition at line 815 of file Component.cpp.
void signal_rename_component | ( | SignalArgs & | args | ) |
renames this component
Definition at line 1003 of file Component.cpp.
void signal_reset_options | ( | SignalArgs & | args | ) |
Signal to set all options to their default value.
Definition at line 1134 of file Component.cpp.
void signal_save_tree | ( | SignalArgs & | args | ) |
dumps the tree to a file
Definition at line 1014 of file Component.cpp.
void signal_signature | ( | SignalArgs & | args | ) |
Gives a signal signature, if any.
Definition at line 1047 of file Component.cpp.
void signal_store_timings | ( | SignalArgs & | args | ) |
Signal to store the timings (if enabled) into properties, i.e. for readout from python or the GUI.
Definition at line 1120 of file Component.cpp.
void signature_add_tag | ( | SignalArgs & | args | ) |
Definition at line 1149 of file Component.cpp.
void signature_create_component | ( | SignalArgs & | args | ) |
Defines the signature of "create_component" signal.
args | The frame under which signature is added. |
Definition at line 1085 of file Component.cpp.
void signature_move_component | ( | SignalArgs & | args | ) |
Defines the signature of "move_component" signal.
args | The frame under which signature is added. |
Definition at line 1109 of file Component.cpp.
void signature_print_tree | ( | SignalArgs & | args | ) | const |
signature to signal_print_tree
Definition at line 823 of file Component.cpp.
void signature_rename_component | ( | SignalArgs & | args | ) |
Defines the signature of "rename_component" signal.
args | The frame under which signature is added. |
Definition at line 1099 of file Component.cpp.
[in] | basic_mode | if true, only components marked_basic will be printed |
[in] | depth | defines howmany recursions should maximally be performed (default value depth=0 means full tree) |
[in] | level | recursion parameter, should not be touched |
Definition at line 785 of file Component.cpp.
|
inlinestatic |
Get the class name.
Definition at line 107 of file Component.hpp.
URI uri | ( | ) | const |
Construct the full path.
Definition at line 248 of file Component.cpp.
|
private |
writes the underlying component tree to the xml node
node | xml node to write |
put_all_content | If false , options and properties are not put in the node. |
Definition at line 717 of file Component.cpp.
|
friend |
Friend declarations allow enable_shared_from_this to be private.
Definition at line 444 of file Component.hpp.
|
friend |
Definition at line 445 of file Component.hpp.
|
private |
lookup of the index of a component
Definition at line 434 of file Component.hpp.
|
private |
list of sub-components
Definition at line 432 of file Component.hpp.
|
private |
component name (stored as path to ensure validity)
Definition at line 426 of file Component.hpp.
|
private |
storage of the option list (pointer to avoid header include)
Definition at line 430 of file Component.hpp.
|
private |
pointer to parent, naked pointer because of static components
Definition at line 436 of file Component.hpp.
|
private |
storage of the property list (pointer to avoid header include)
Definition at line 428 of file Component.hpp.
Send comments to: COOLFluiD Web Admin |