MADARA  3.1.8
madara::transport::TcpTransportReadThread Class Reference

Thread for reading knowledge updates through a TCP socket (unused but planned) More...

#include <TcpTransportReadThread.h>

Inheritance diagram for madara::transport::TcpTransportReadThread:
Collaboration diagram for madara::transport::TcpTransportReadThread:

Public Member Functions

 TcpTransportReadThread (const TransportSettings &settings, const std::string &id, std::map< std::string, ACE_INET_Addr > &addresses, 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 to all peers. More...
 
void run (void)
 The main loop internals for the read thread. 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...
 

Private Attributes

std::map< std::string, ACE_INET_Addr > & addresses_
 internet addresses of our peers More...
 
madara::utility::ScopedArray< char > buffer_
 buffer for sending More...
 
knowledge::ThreadSafeContextcontext_
 knowledge context More...
 
const std::string id_
 host:port identifier of this process More...
 
madara::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...
 

Detailed Description

Thread for reading knowledge updates through a TCP socket (unused but planned)

Definition at line 32 of file TcpTransportReadThread.h.

Constructor & Destructor Documentation

madara::transport::TcpTransportReadThread::TcpTransportReadThread ( const TransportSettings settings,
const std::string &  id,
std::map< std::string, ACE_INET_Addr > &  addresses,
BandwidthMonitor send_monitor,
BandwidthMonitor receive_monitor,
PacketScheduler packet_scheduler 
)

Constructor.

Parameters
settingsTransport settings
idhost:port identifier of this process, to allow for rejection of duplicates
addressesthe ACE socket addresses to communicate with
send_monitorbandwidth monitor for enforcing send limits
receive_monitorbandwidth monitor for enforcing receive limits
packet_schedulerscheduler for mimicking network conditions

Definition at line 6 of file TcpTransportReadThread.cpp.

Member Function Documentation

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

Cleanup function called by thread manager.

Reimplemented from madara::threads::BaseThread.

Definition at line 165 of file TcpTransportReadThread.cpp.

void madara::transport::TcpTransportReadThread::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 22 of file TcpTransportReadThread.cpp.

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

Initializes the Java thread implementation's control plane variables.

Parameters
controlthe control plane between Threader and threads

Reimplemented in madara::threads::JavaThread.

Definition at line 86 of file BaseThread.h.

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

Sends a rebroadcast packet to all peers.

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)

Definition at line 57 of file TcpTransportReadThread.cpp.

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

The main loop internals for the read thread.

Implements madara::threads::BaseThread.

Definition at line 171 of file TcpTransportReadThread.cpp.

Member Data Documentation

std::map<std::string, ACE_INET_Addr>& madara::transport::TcpTransportReadThread::addresses_
private

internet addresses of our peers

Definition at line 94 of file TcpTransportReadThread.h.

madara::utility::ScopedArray<char> madara::transport::TcpTransportReadThread::buffer_
private

buffer for sending

Definition at line 97 of file TcpTransportReadThread.h.

knowledge::ThreadSafeContext* madara::transport::TcpTransportReadThread::context_
private

knowledge context

Definition at line 91 of file TcpTransportReadThread.h.

const std::string madara::transport::TcpTransportReadThread::id_
private

host:port identifier of this process

Definition at line 88 of file TcpTransportReadThread.h.

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

The unique name of your thread.

Definition at line 96 of file BaseThread.h.

madara::knowledge::CompiledExpression madara::transport::TcpTransportReadThread::on_data_received_
private

data received rules, defined in Transport settings

Definition at line 101 of file TcpTransportReadThread.h.

PacketScheduler& madara::transport::TcpTransportReadThread::packet_scheduler_
private

scheduler for mimicking target network conditions

Definition at line 111 of file TcpTransportReadThread.h.

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

thread safe paused flag that may be set by the Threader

Definition at line 107 of file BaseThread.h.

BandwidthMonitor& madara::transport::TcpTransportReadThread::receive_monitor_
private

monitor for receiving bandwidth usage

Definition at line 108 of file TcpTransportReadThread.h.

BandwidthMonitor& madara::transport::TcpTransportReadThread::send_monitor_
private

monitor for sending bandwidth usage

Definition at line 105 of file TcpTransportReadThread.h.

const QoSTransportSettings madara::transport::TcpTransportReadThread::settings_
private

Transport settings.

Definition at line 85 of file TcpTransportReadThread.h.

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

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

Definition at line 102 of file BaseThread.h.


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