MADARA  3.1.8
TcpTransport.h
Go to the documentation of this file.
1 #ifndef _MADARA_TCP_TRANSPORT_H_
2 #define _MADARA_TCP_TRANSPORT_H_
3 
4 #include <string>
5 
10 
11 namespace madara
12 {
13  namespace transport
14  {
19  class TcpTransport : public Base
20  {
21  public:
22 
23  enum {
25  };
26 
27  enum {
29  };
30 
31  static const int PROFILES = 1;
32 
40  TcpTransport (const std::string & id,
42  TransportSettings & config, bool launch_transport);
43 
47  virtual ~TcpTransport ();
48 
54  long send_data (const madara::knowledge::KnowledgeRecords & updates);
55 
61  int reliability (void) const;
62 
68  int reliability (const int & setting);
69  long read (void);
70  void close (void);
71  int setup (void);
72  protected:
73  private:
76 
79 
80  std::map <std::string, ACE_INET_Addr> addresses_;
81 
82  };
83  }
84 }
85 
86 #endif // _MADARA_TCP_TRANSPORT_H_
threads::Threader read_threads_
threads for reading knowledge updates
Definition: TcpTransport.h:78
long send_data(const madara::knowledge::KnowledgeRecords &updates)
Sends a list of knowledge updates to listeners.
int setup(void)
all subclasses should call this method at the end of its setup
virtual ~TcpTransport()
Destructor.
knowledge::KnowledgeBase knowledge_
knowledge base for threads to use
Definition: TcpTransport.h:75
This class stores variables and their values for use by any entity needing state information in a thr...
void close(void)
Closes this transport.
std::map< std::string, ACE_INET_Addr > addresses_
Definition: TcpTransport.h:80
Holds basic transport settings.
int reliability(void) const
Accesses reliability setting.
This class provides a distributed knowledge base to users.
Definition: KnowledgeBase.h:44
::std::map< std::string, KnowledgeRecord * > KnowledgeRecords
TcpTransport(const std::string &id, madara::knowledge::ThreadSafeContext &context, TransportSettings &config, bool launch_transport)
Constructor.
static constexpr struct madara::knowledge::tags::string_t string
Starts threads with first class support of MADARA contexts.
Definition: Threader.h:35
Copyright (c) 2015 Carnegie Mellon University.
Base class from which all transports must be derived.
Definition: Transport.h:62
TCP-based transport (skeleton code)
Definition: TcpTransport.h:19