MADARA  3.4.1
madara::transport::SpliceReadThread Class Reference

Thread for reading knowledge updates via waitsets. More...

#include <SpliceTransportReadThread.h>

Inheritance diagram for madara::transport::SpliceReadThread:
madara::threads::BaseThread

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::ThreadSafeContextcontext_
 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...
 
PacketSchedulerpacket_scheduler_
 scheduler for mimicking target network conditions More...
 
BandwidthMonitorreceive_monitor_
 monitor for receiving bandwidth usage More...
 
BandwidthMonitorsend_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 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...
 

Detailed Description

Thread for reading knowledge updates via waitsets.

Definition at line 33 of file SpliceTransportReadThread.h.

Constructor & Destructor Documentation

◆ SpliceReadThread()

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.

Parameters
idunique identifier of this participant (e.g., host:port)
contextwhere to store and access knowledge
update_readerreader created in
See also
SpliceDDSTransport
Parameters
update_writerwriter created in
See also
SpliceDDSTransport
Parameters
settingsTransport settings
send_monitorbandwidth monitor for enforcing send limits
receive_monitorbandwidth monitor for enforcing receive limits
packet_schedulerscheduler for mimicking network conditions

Definition at line 12 of file SpliceTransportReadThread.cpp.

Member Function Documentation

◆ cleanup()

void madara::transport::SpliceReadThread::cleanup ( void  )
virtual

Cleanup function called by thread manager.

Reimplemented from madara::threads::BaseThread.

Definition at line 63 of file SpliceTransportReadThread.cpp.

◆ init()

void madara::transport::SpliceReadThread::init ( knowledge::KnowledgeBase knowledge)
virtual

Initializes MADARA context-related items.

Parameters
knowledgecontext for querying current program state

Reimplemented from madara::threads::BaseThread.

Definition at line 30 of file SpliceTransportReadThread.cpp.

◆ init_control_vars()

virtual void madara::threads::BaseThread::init_control_vars ( knowledge::KnowledgeBase control)
inlineprotectedvirtualinherited

Initializes the thread implementation's control plane variables.

Parameters
controlthe control plane between Threader and threads

Reimplemented in madara::threads::JavaThread.

Definition at line 78 of file BaseThread.h.

◆ rebroadcast()

void madara::transport::SpliceReadThread::rebroadcast ( const char *  print_prefix,
MessageHeader header,
const knowledge::KnowledgeMap records 
)

Sends a rebroadcast packet.

Parameters
print_prefixprefix to include before every log message, e.g., "MyTransport::svc"
headerheader for the rebroadcasted packet
recordsrecords to rebroadcast (already filtered for rebroadcast)

get current lamport clock.

Definition at line 65 of file SpliceTransportReadThread.cpp.

◆ run()

void madara::transport::SpliceReadThread::run ( void  )
virtual

The main loop internals for the read thread.

Implements madara::threads::BaseThread.

Definition at line 115 of file SpliceTransportReadThread.cpp.

Member Data Documentation

◆ assignment_symbols_

::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 87 of file SpliceTransportReadThread.h.

◆ buffer_

madara::utility::ScopedArray<char> madara::transport::SpliceReadThread::buffer_

buffer for receiving

Definition at line 118 of file SpliceTransportReadThread.h.

◆ context_

knowledge::ThreadSafeContext* madara::transport::SpliceReadThread::context_

The knowledge context that we will be updating.

Definition at line 102 of file SpliceTransportReadThread.h.

◆ id_

const std::string madara::transport::SpliceReadThread::id_

Unique identifier for this entity (e.g., host:port)

Definition at line 92 of file SpliceTransportReadThread.h.

◆ name

std::string madara::threads::BaseThread::name
protectedinherited

The unique name of your thread.

Definition at line 90 of file BaseThread.h.

◆ on_data_received_

knowledge::CompiledExpression madara::transport::SpliceReadThread::on_data_received_

data received rules, defined in Transport settings

Definition at line 115 of file SpliceTransportReadThread.h.

◆ packet_scheduler_

PacketScheduler& madara::transport::SpliceReadThread::packet_scheduler_

scheduler for mimicking target network conditions

Definition at line 127 of file SpliceTransportReadThread.h.

◆ paused

madara::knowledge::containers::Integer madara::threads::BaseThread::paused
protectedinherited

thread safe paused flag that may be set by the Threader

Definition at line 101 of file BaseThread.h.

◆ receive_monitor_

BandwidthMonitor& madara::transport::SpliceReadThread::receive_monitor_

monitor for receiving bandwidth usage

Definition at line 124 of file SpliceTransportReadThread.h.

◆ send_monitor_

BandwidthMonitor& madara::transport::SpliceReadThread::send_monitor_

monitor for sending bandwidth usage

Definition at line 121 of file SpliceTransportReadThread.h.

◆ settings_

const QoSTransportSettings madara::transport::SpliceReadThread::settings_

Transport settings.

Definition at line 97 of file SpliceTransportReadThread.h.

◆ terminated

madara::knowledge::containers::Integer madara::threads::BaseThread::terminated
protectedinherited

thread safe terminated flag that may be set by the Threader base

Definition at line 96 of file BaseThread.h.

◆ update_reader_

::Knowledge::UpdateDataReader_var madara::transport::SpliceReadThread::update_reader_

The DDS data reader that we will take from.

Definition at line 107 of file SpliceTransportReadThread.h.

◆ update_writer_

::Knowledge::UpdateDataWriter_var madara::transport::SpliceReadThread::update_writer_

The DDS data writer that we can write to.

Definition at line 112 of file SpliceTransportReadThread.h.


The documentation for this class was generated from the following files: