MADARA  3.1.8
BroadcastTransport.h
Go to the documentation of this file.
1 #ifndef _MADARA_BROADCAST_TRANSPORT_H_
2 #define _MADARA_BROADCAST_TRANSPORT_H_
3 
12 #include <string>
13 
14 #include "madara/MADARA_export.h"
19 #include "ace/SOCK_Dgram_Bcast.h"
20 #include "madara/utility/stdint.h"
23 
24 
25 namespace madara
26 {
27  namespace transport
28  {
41  class MADARA_Export BroadcastTransport : public Base
42  {
43  public:
51  BroadcastTransport (const std::string & id,
53  TransportSettings & config, bool launch_transport);
54 
58  virtual ~BroadcastTransport ();
59 
65  long send_data (const madara::knowledge::KnowledgeRecords & updates);
66 
70  void close (void);
71 
76  int reliability (void) const;
77 
82  int reliability (const int & setting);
83 
88  int setup (void);
89 
90  private:
91 
94 
97 
99  std::vector <ACE_INET_Addr> addresses_;
100 
102  std::vector <std::string> splitters_;
103 
105  ACE_SOCK_Dgram_Bcast socket_;
106  };
107  }
108 }
109 
110 #endif // _MADARA_BROADCAST_TRANSPORT_H_
Multicast-based transport for knowledge.
threads::Threader read_threads_
threads for reading knowledge updates
knowledge::KnowledgeBase knowledge_
knowledge base for threads to use
This class stores variables and their values for use by any entity needing state information in a thr...
Holds basic transport settings.
ACE_SOCK_Dgram_Bcast socket_
underlying socket for sending
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
std::vector< ACE_INET_Addr > addresses_
holds all multicast addresses we are sending to
Copyright (c) 2015 Carnegie Mellon University.
std::vector< std::string > splitters_
holds splitters for knowledge multiassignment expression for speed
Base class from which all transports must be derived.
Definition: Transport.h:62