fipa_acl  1.4
statemachine_factory.h
Go to the documentation of this file.
1 #ifndef FIPA_ACL_CONVERSATIONMONITOR_STATEMACHINE_FACTORY_H
2 #define FIPA_ACL_CONVERSATIONMONITOR_STATEMACHINE_FACTORY_H
3 
4 #include <string>
5 #include <map>
6 #include <fipa_acl/conversation_monitor/statemachine.h>
7 #include <fipa_acl/conversation_monitor/state.h>
8 
9 namespace fipa {
10 namespace acl {
11 
12 class StateMachineReader;
13 
15 {
16  private:
17  // Reader for state machine files
18  static StateMachineReader msStateMachineReader;
19 
20  static std::vector<std::string> msResourceDirs;
21 
22  // Marked when the function prepareProtocolFromResourceDir has already been called
23  // Used for lazy initialization in getStateMachine
24  static bool msPreparedResourceDir;
25 
26  static std::map<std::string, StateMachine> msStateMachines;
27 
31  static void prepareProtocolsFromResourceDirs();
32 
33 public:
39  static void setProtocolResourceDir(const std::string& resourceDir);
40 
45  static void addProtocolResourceDir(const std::string& resourceDir);
46 
51  static StateMachine getStateMachine(const std::string& protocol);
52 
56  static void prepareProtocolsFromResourceDir(const std::string& directory);
57 };
58 
59 } // end namespace acl
60 } // end namespace fipa
61 #endif //FIPA_ACL_CONVERSATIONMONITOR_STATEMACHINE_FACTORY_H
static StateMachine getStateMachine(const std::string &protocol)
static void prepareProtocolsFromResourceDir(const std::string &directory)
implements a XML parser that generates a state machine from a given spec. file; uses the tinyXML libr...
static void setProtocolResourceDir(const std::string &resourceDir)
static void addProtocolResourceDir(const std::string &resourceDir)