MADARA
3.1.8
|
Thread for reading knowledge updates via waitsets. More...
#include <SpliceTransportReadThread.h>
Public Member Functions | |
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. More... | |
void | cleanup (void) |
Cleanup function called by thread manager. More... | |
void | init (knowledge::KnowledgeBase &knowledge) |
Initializes MADARA context-related items. More... | |
void | rebroadcast (const char *print_prefix, MessageHeader *header, const knowledge::KnowledgeMap &records) |
Sends a rebroadcast packet. More... | |
void | run (void) |
The main loop internals for the read thread. More... | |
Public Attributes | |
::std::vector< ::std::string > | assignment_symbols_ |
We currently allow multiassignments completely through the key. More... | |
madara::utility::ScopedArray< char > | buffer_ |
buffer for receiving More... | |
knowledge::ThreadSafeContext * | context_ |
The knowledge context that we will be updating. More... | |
const std::string | id_ |
Unique identifier for this entity (e.g., host:port) More... | |
knowledge::CompiledExpression | on_data_received_ |
data received rules, defined in Transport settings More... | |
PacketScheduler & | packet_scheduler_ |
scheduler for mimicking target network conditions More... | |
BandwidthMonitor & | receive_monitor_ |
monitor for receiving bandwidth usage More... | |
BandwidthMonitor & | send_monitor_ |
monitor for sending bandwidth usage More... | |
const QoSTransportSettings | settings_ |
Transport settings. More... | |
::Knowledge::UpdateDataReader_var | update_reader_ |
The DDS data reader that we will take from. More... | |
::Knowledge::UpdateDataWriter_var | update_writer_ |
The DDS data writer that we can write to. More... | |
Protected Member Functions | |
virtual void | init_control_vars (knowledge::KnowledgeBase &control) |
Initializes the Java thread implementation's control plane variables. More... | |
Protected Attributes | |
std::string | name |
The unique name of your thread. More... | |
madara::knowledge::containers::Integer | paused |
thread safe paused flag that may be set by the Threader More... | |
madara::knowledge::containers::Integer | terminated |
thread safe terminated flag that may be set by the Threader base More... | |
Thread for reading knowledge updates via waitsets.
Definition at line 41 of file SpliceTransportReadThread.h.
madara::transport::SpliceReadThread::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.
id | unique identifier of this participant (e.g., host:port) |
context | where to store and access knowledge |
update_reader | reader created in |
update_writer | writer created in |
settings | Transport settings |
send_monitor | bandwidth monitor for enforcing send limits |
receive_monitor | bandwidth monitor for enforcing receive limits |
packet_scheduler | scheduler for mimicking network conditions |
Definition at line 12 of file SpliceTransportReadThread.cpp.
|
virtual |
Cleanup function called by thread manager.
Reimplemented from madara::threads::BaseThread.
Definition at line 66 of file SpliceTransportReadThread.cpp.
|
virtual |
Initializes MADARA context-related items.
knowledge | context for querying current program state |
Reimplemented from madara::threads::BaseThread.
Definition at line 31 of file SpliceTransportReadThread.cpp.
|
inlineprotectedvirtualinherited |
Initializes the Java thread implementation's control plane variables.
control | the control plane between Threader and threads |
Reimplemented in madara::threads::JavaThread.
Definition at line 86 of file BaseThread.h.
void madara::transport::SpliceReadThread::rebroadcast | ( | const char * | print_prefix, |
MessageHeader * | header, | ||
const knowledge::KnowledgeMap & | records | ||
) |
Sends a rebroadcast packet.
print_prefix | prefix to include before every log message, e.g., "MyTransport::svc" |
header | header for the rebroadcasted packet |
records | records to rebroadcast (already filtered for rebroadcast) |
get current lamport clock.
Definition at line 71 of file SpliceTransportReadThread.cpp.
|
virtual |
The main loop internals for the read thread.
Implements madara::threads::BaseThread.
Definition at line 128 of file SpliceTransportReadThread.cpp.
::std::vector< ::std::string> madara::transport::SpliceReadThread::assignment_symbols_ |
We currently allow multiassignments completely through the key.
This is probably the least efficient way to handle this and should be changed.
Definition at line 99 of file SpliceTransportReadThread.h.
madara::utility::ScopedArray<char> madara::transport::SpliceReadThread::buffer_ |
buffer for receiving
Definition at line 130 of file SpliceTransportReadThread.h.
knowledge::ThreadSafeContext* madara::transport::SpliceReadThread::context_ |
The knowledge context that we will be updating.
Definition at line 114 of file SpliceTransportReadThread.h.
const std::string madara::transport::SpliceReadThread::id_ |
Unique identifier for this entity (e.g., host:port)
Definition at line 104 of file SpliceTransportReadThread.h.
|
protectedinherited |
The unique name of your thread.
Definition at line 96 of file BaseThread.h.
knowledge::CompiledExpression madara::transport::SpliceReadThread::on_data_received_ |
data received rules, defined in Transport settings
Definition at line 127 of file SpliceTransportReadThread.h.
PacketScheduler& madara::transport::SpliceReadThread::packet_scheduler_ |
scheduler for mimicking target network conditions
Definition at line 139 of file SpliceTransportReadThread.h.
|
protectedinherited |
thread safe paused flag that may be set by the Threader
Definition at line 107 of file BaseThread.h.
BandwidthMonitor& madara::transport::SpliceReadThread::receive_monitor_ |
monitor for receiving bandwidth usage
Definition at line 136 of file SpliceTransportReadThread.h.
BandwidthMonitor& madara::transport::SpliceReadThread::send_monitor_ |
monitor for sending bandwidth usage
Definition at line 133 of file SpliceTransportReadThread.h.
const QoSTransportSettings madara::transport::SpliceReadThread::settings_ |
Transport settings.
Definition at line 109 of file SpliceTransportReadThread.h.
|
protectedinherited |
thread safe terminated flag that may be set by the Threader base
Definition at line 102 of file BaseThread.h.
::Knowledge::UpdateDataReader_var madara::transport::SpliceReadThread::update_reader_ |
The DDS data reader that we will take from.
Definition at line 119 of file SpliceTransportReadThread.h.
::Knowledge::UpdateDataWriter_var madara::transport::SpliceReadThread::update_writer_ |
The DDS data writer that we can write to.
Definition at line 124 of file SpliceTransportReadThread.h.