MADARA  3.1.8
SpliceTransportReadThread.h
Go to the documentation of this file.
1 #ifndef SPLICE_TRANSPORT_READ_THREAD_H
2 #define SPLICE_TRANSPORT_READ_THREAD_H
3 
12 #include <string>
13 
21 
22 #include "ccpp_dds_dcps.h"
23 #include "madara/transport/splice/ccpp_SpliceKnowledgeUpdate.h"
24 
25 #include "ace/Task.h"
26 #include "ace/Mutex.h"
27 #include "ace/Barrier.h"
28 #include "ace/Atomic_Op_T.h"
29 #include "ace/Thread_Mutex.h"
30 
31 #include "ace/Synch.h"
32 
33 namespace madara
34 {
35  namespace transport
36  {
42  {
43  public:
56  SpliceReadThread (const std::string & id,
57  const TransportSettings & settings,
59  Knowledge::UpdateDataReader_ptr & update_reader,
60  Knowledge::UpdateDataWriter_ptr & update_writer,
61  BandwidthMonitor & send_monitor,
62  BandwidthMonitor & receive_monitor,
63  PacketScheduler & packet_scheduler);
64 
70 
74  void cleanup (void);
75 
79  void run (void);
80 
89  void rebroadcast (
90  const char * print_prefix,
91  MessageHeader * header,
92  const knowledge::KnowledgeMap & records);
93 
99  ::std::vector< ::std::string> assignment_symbols_;
100 
105 
110 
115 
119  ::Knowledge::UpdateDataReader_var update_reader_;
120 
124  ::Knowledge::UpdateDataWriter_var update_writer_;
125 
128 
131 
134 
137 
140  };
141  }
142 }
143 
144 #endif
BandwidthMonitor & send_monitor_
monitor for sending bandwidth usage
SpliceReadThread(const std::string &id, const TransportSettings &settings, knowledge::ThreadSafeContext &context, Knowledge::UpdateDataReader_ptr &update_reader, Knowledge::UpdateDataWriter_ptr &update_writer, BandwidthMonitor &send_monitor, BandwidthMonitor &receive_monitor, PacketScheduler &packet_scheduler)
Constructor.
::Knowledge::UpdateDataWriter_var update_writer_
The DDS data writer that we can write to.
const QoSTransportSettings settings_
Transport settings.
This class stores variables and their values for use by any entity needing state information in a thr...
Provides scheduler for dropping packets.
BandwidthMonitor & receive_monitor_
monitor for receiving bandwidth usage
Holds basic transport settings.
Compiled, optimized KaRL logic.
madara::utility::ScopedArray< char > buffer_
buffer for receiving
void rebroadcast(const char *print_prefix, MessageHeader *header, const knowledge::KnowledgeMap &records)
Sends a rebroadcast packet.
knowledge::CompiledExpression on_data_received_
data received rules, defined in Transport settings
::std::vector< ::std::string > assignment_symbols_
We currently allow multiassignments completely through the key.
Abstract base class for implementing threads.
Definition: BaseThread.h:38
void init(knowledge::KnowledgeBase &knowledge)
Initializes MADARA context-related items.
::Knowledge::UpdateDataReader_var update_reader_
The DDS data reader that we will take from.
This class provides a distributed knowledge base to users.
Definition: KnowledgeBase.h:44
::std::map< std::string, KnowledgeRecord > KnowledgeMap
Thread for reading knowledge updates via waitsets.
void cleanup(void)
Cleanup function called by thread manager.
static constexpr struct madara::knowledge::tags::string_t string
Container for quality-of-service settings.
Provides monitoring capability of a transport&#39;s bandwidth.
Provides functions and classes for the distributed knowledge base.
const std::string id_
Unique identifier for this entity (e.g., host:port)
PacketScheduler & packet_scheduler_
scheduler for mimicking target network conditions
Copyright (c) 2015 Carnegie Mellon University.
Defines a robust message header which is the default for KaRL messages.
Definition: MessageHeader.h:56
knowledge::ThreadSafeContext * context_
The knowledge context that we will be updating.
void run(void)
The main loop internals for the read thread.