COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
ActionDirector.hpp
Go to the documentation of this file.
1 // Copyright (C) 2010-2013 von Karman Institute for Fluid Dynamics, Belgium
2 //
3 // This software is distributed under the terms of the
4 // GNU Lesser General Public License version 3 (LGPLv3).
5 // See doc/lgpl.txt and doc/gpl.txt for the license text.
6 
7 #ifndef cf3_common_ActionDirector_hpp
8 #define cf3_common_ActionDirector_hpp
9 
10 #include <set>
11 
12 #include "common/Action.hpp"
13 
14 #include "LibCommon.hpp"
15 
17 
18 namespace cf3 {
19 namespace common {
20 
22 
26 {
27 public: // functions
28 
31  ActionDirector ( const std::string& name );
32 
34  static std::string type_name () { return "ActionDirector"; }
35 
37  virtual void execute();
38 
39 protected:
41  bool is_disabled(const std::string& name);
42 
43 private:
44  void trigger_disabled_actions();
45  std::set<std::string> m_disabled_actions;
46 };
47 
50 
52 template<typename ActionT>
53 ActionDirector& operator<<(ActionDirector& action_director, const Handle<ActionT>& action)
54 {
55  return action_director << *action;
56 }
57 
59 ActionDirector& operator<<(ActionDirector& action_director, const boost::shared_ptr<Action>& action);
60 
62 const boost::shared_ptr<ActionDirector>& operator<<(const boost::shared_ptr<ActionDirector>& action_director, Action& action);
63 
65 template<typename ActionT>
66 const boost::shared_ptr<ActionDirector>& operator<<(const boost::shared_ptr<ActionDirector>& action_director, const Handle<ActionT>& action)
67 {
68  return action_director << *action;
69 }
70 
72 const boost::shared_ptr<ActionDirector>& operator<<(const boost::shared_ptr<ActionDirector>& action_director, const boost::shared_ptr<Action>& action);
73 
75 
76 } // common
77 } // cf3
78 
80 
81 #endif // cf3_common_ActionDirector_hpp
std::string name(ComponentWrapper &self)
std::set< std::string > m_disabled_actions
ActionDirector & operator<<(ActionDirector &action_director, Action &action)
Add a link to the passed action as a child.
Top-level namespace for coolfluid.
Definition: Action.cpp:18
static std::string type_name()
Get the class name.
Component that executes an action. Implementation of the IAction interface as a component, exposing the execute function as a signal.
Definition: Action.hpp:21
#define Common_API
Definition: CommonAPI.hpp:29
Send comments to:
COOLFluiD Web Admin