ifw  0.0.1-dev
 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 
14 #include <rad/ActionGroup.hpp>
15 
16 #include <scxml4cpp/Action.h>
17 #include <scxml4cpp/Activity.h>
18 
19 #include <list>
20 
21 
22 namespace rad {
23 
24 /*
25  * @TODO For the moment we keep it as lists since scxml4cpp interface
26  * requires it. Later we could modify it to a map. However actions and
27  * activities are resolved at startup/init time so there is no performance
28  * issues.
29  */
30 typedef std::list<scxml4cpp::Action*> ActionList;
31 typedef std::list<rad::ActionGroup*> ActionGroupList;
32 typedef std::list<scxml4cpp::Activity*> ActivityList;
33 
38 class ActionMgr
39 {
40 public:
41  ActionMgr();
42  virtual ~ActionMgr();
43 
47 
51 
52  scxml4cpp::Action* FindAction(const std::string& id);
53  ActionGroup* FindActionGroup(const std::string& id);
54 
55  ActionMgr(const ActionMgr&) = delete;
56  ActionMgr& operator= (const ActionMgr&) = delete;
57 
58 private:
59  ActionList mActions;
60  ActionGroupList mActionGroups;
61  ActivityList mActivities;
62 };
63 
64 } // namespace rad
65 
66 #endif
ActionGroupList & GetActionGroups()
Definition: ActionMgr.cpp:107
Definition: Activity.h:40
scxml4cpp::Action * FindAction(const std::string &id)
Definition: ActionMgr.cpp:128
virtual ~ActionMgr()
Definition: ActionMgr.cpp:27
ActionMgr()
Definition: ActionMgr.cpp:19
void AddActivity(scxml4cpp::Activity *a)
Definition: ActionMgr.cpp:88
Definition: ActionMgr.hpp:38
Definition: Action.h:41
void AddAction(scxml4cpp::Action *a)
Definition: ActionMgr.cpp:64
ActionList & GetActions()
Definition: ActionMgr.cpp:98
void AddActionGroup(rad::ActionGroup *a)
Definition: ActionMgr.cpp:76
std::list< rad::ActionGroup * > ActionGroupList
Definition: ActionMgr.hpp:31
ActivityList & GetActivities()
Definition: ActionMgr.cpp:116
std::list< scxml4cpp::Activity * > ActivityList
Definition: ActionMgr.hpp:32
ActionGroup * FindActionGroup(const std::string &id)
Definition: ActionMgr.cpp:147
std::list< scxml4cpp::Action * > ActionList
Definition: ActionMgr.hpp:30
Definition: ActionGroup.hpp:22
ActionMgr & operator=(const ActionMgr &)=delete
Disable copy constructor.