rad  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
actionMgr.hpp
Go to the documentation of this file.
1 
10 #ifndef RAD_ACTION_MGR_HPP
11 #define RAD_ACTION_MGR_HPP
12 
13 #include <rad/actionGroup.hpp>
14 
15 #include <scxml4cpp/Action.h>
16 #include <scxml4cpp/Activity.h>
17 
18 #include <list>
19 
20 namespace rad {
21 
22 /*
23  * @TODO For the moment we keep it as lists since scxml4cpp interface
24  * requires it. Later we could modify it to a map. However actions and
25  * activities are resolved at startup/init time so there is no performance
26  * issues.
27  */
28 typedef std::list<scxml4cpp::Action*> ActionList;
29 typedef std::list<rad::ActionGroup*> ActionGroupList;
30 typedef std::list<scxml4cpp::Activity*> ActivityList;
31 
36 class ActionMgr {
37  public:
38  ActionMgr();
39  virtual ~ActionMgr();
40 
41  void AddAction(scxml4cpp::Action* the_action);
42  void AddActionGroup(rad::ActionGroup* the_action_group);
43  void AddActivity(scxml4cpp::Activity* the_activity);
44 
48 
49  scxml4cpp::Action* FindAction(const std::string& id);
50  ActionGroup* FindActionGroup(const std::string& id);
51 
52  ActionMgr(const ActionMgr&) = delete;
53  ActionMgr& operator=(const ActionMgr&) = delete;
54 
55  private:
56  ActionList m_actions;
57  ActionGroupList m_action_groups;
58  ActivityList m_activities;
59 };
60 
61 } // namespace rad
62 
63 #endif // RAD_ACTION_MGR_HPP
void AddActivity(scxml4cpp::Activity *the_activity)
Definition: actionMgr.cpp:79
ActionGroupList & GetActionGroups()
Definition: actionMgr.cpp:96
Definition: Activity.h:39
scxml4cpp::Action * FindAction(const std::string &id)
Definition: actionMgr.cpp:115
virtual ~ActionMgr()
Definition: actionMgr.cpp:24
ActionMgr()
Definition: actionMgr.cpp:19
Definition: actionMgr.hpp:36
Definition: Action.h:40
ActionList & GetActions()
Definition: actionMgr.cpp:88
std::list< rad::ActionGroup * > ActionGroupList
Definition: actionMgr.hpp:29
ActivityList & GetActivities()
Definition: actionMgr.cpp:104
std::list< scxml4cpp::Activity * > ActivityList
Definition: actionMgr.hpp:30
void AddAction(scxml4cpp::Action *the_action)
Definition: actionMgr.cpp:57
ActionGroup * FindActionGroup(const std::string &id)
Definition: actionMgr.cpp:133
void AddActionGroup(rad::ActionGroup *the_action_group)
Definition: actionMgr.cpp:68
std::list< scxml4cpp::Action * > ActionList
Definition: actionMgr.hpp:28
Definition: actionGroup.hpp:20
ActionMgr & operator=(const ActionMgr &)=delete
Disable copy constructor.