fipa_acl  1.4
conversation_monitor.h
Go to the documentation of this file.
1 #ifndef FIPA_ACL_CONVERSATION_MONITOR_H
2 #define FIPA_ACL_CONVERSATION_MONITOR_H
3 
4 #include <map>
5 #include <vector>
6 #include <boost/thread/mutex.hpp>
7 
8 #include <fipa_acl/conversation_monitor/conversation.h>
9 #include <fipa_acl/message_generator/acl_message.h>
10 
11 namespace fipa {
12 namespace acl {
13 
14 class Configuration;
15 
76 {
77 
78 public:
86  ConversationMonitor(const AgentID& self, const std::string& protocolDirectory = "");
87 
91  virtual ~ConversationMonitor();
92 
103 
112  ConversationPtr startConversation(const std::string& topic);
113 
117  bool removeConversation(const fipa::acl::ConversationID& conversationId);
118 
124 
130 
134  void cleanup();
135 
140  std::vector<fipa::acl::ConversationID> getActiveConversations();
141 
142 private:
143  AgentID mSelf;
144 
145  std::map<fipa::acl::ConversationID, ConversationPtr> mActiveConversations;
146 
147  boost::mutex mMutex;
148 };
149 
150 } // end namespace acl
151 } // end namespace fipa
152 #endif // FIPA_ACL_CONVERSATION_MONITOR_H
std::string ConversationID
Definition: acl_message.h:28
ConversationPtr getConversation(const fipa::acl::ConversationID &conversationId)
boost::shared_ptr< Conversation > ConversationPtr
Definition: conversation.h:408
bool removeConversation(const fipa::acl::ConversationID &conversationId)
ConversationMonitor(const AgentID &self, const std::string &protocolDirectory="")
ConversationPtr getOrCreateConversation(const fipa::acl::ConversationID &conversationId)
std::vector< fipa::acl::ConversationID > getActiveConversations()
This library provides a statemachine to monitor a message flow based on performatives. The conversation monitor is capable of monitoring the conversation based on the protocol specified in the messages. There are scxml documents specifying how these protocols are defined. Protocols may contain subprotocols, which is partially supported.
ConversationPtr updateConversation(const fipa::acl::ACLMessage &msg)
This class provides a representation of a message conforming to the FIPA specification SC00061...
Definition: acl_message.h:55
ConversationPtr startConversation(const std::string &topic)
Implements the general AgentID functionality, which is present throughout the fipa specifications(FIP...
Definition: agent_id.h:37
Foundation of Physical Intelligent Agents.
Definition: conversation.cpp:6