MADARA  3.1.8
UdpRegistryClient.h
Go to the documentation of this file.
1 #ifndef _MADARA_UDP_REGISTRY_CLIENT_TRANSPORT_H_
2 #define _MADARA_UDP_REGISTRY_CLIENT_TRANSPORT_H_
3 
4 #include <string>
5 
6 #include "madara/MADARA_export.h"
11 
12 #include <string>
13 #include <map>
14 
15 #include "ace/INET_Addr.h"
16 #include "ace/SOCK_Dgram.h"
17 
18 
19 namespace madara
20 {
21  namespace transport
22  {
35  class MADARA_Export UdpRegistryClient : public Base
36  {
37  public:
38 
39  enum {
41  };
42 
43  enum {
44  ERROR_UDP_NOT_STARTED = -1,
45  };
46 
47  static const int PROFILES = 1;
48 
56  UdpRegistryClient (const std::string & id,
58  TransportSettings & config, bool launch_transport);
59 
63  virtual ~UdpRegistryClient ();
64 
65 
69  void send_register (void);
70 
76  long send_data (const madara::knowledge::KnowledgeRecords & updates);
77 
83  int reliability (void) const;
84 
90  int reliability (const int & setting);
91  long read (void);
92  void close (void);
93  int setup (void);
94  protected:
95  private:
98 
101 
103  std::map <std::string, ACE_INET_Addr> servers_;
104 
106  std::map <std::string, ACE_INET_Addr> clients_;
107 
109 
111  ACE_SOCK_Dgram socket_;
112  };
113  }
114 }
115 
116 #endif // _MADARA_UDP_REGISTRY_CLIENT_TRANSPORT_H_
knowledge::containers::Map endpoints_
ACE_SOCK_Dgram socket_
underlying socket for sending and receiving
This class stores variables and their values for use by any entity needing state information in a thr...
std::map< std::string, ACE_INET_Addr > clients_
registry clients
std::map< std::string, ACE_INET_Addr > servers_
registry servers
Holds basic transport settings.
This class stores a map of strings to KaRL variables.
Definition: Map.h:32
This class provides a distributed knowledge base to users.
Definition: KnowledgeBase.h:44
::std::map< std::string, KnowledgeRecord * > KnowledgeRecords
static constexpr struct madara::knowledge::tags::string_t string
Starts threads with first class support of MADARA contexts.
Definition: Threader.h:35
knowledge::KnowledgeBase knowledge_
knowledge base for threads to use
Copyright (c) 2015 Carnegie Mellon University.
UDP-based transport for knowledge.
Base class from which all transports must be derived.
Definition: Transport.h:62
threads::Threader read_threads_
threads for reading knowledge updates