MADARA
3.4.1
|
Custom network transport generated by gpc.pl. More...
#include <SharedMemoryPush.h>
Public Types | |
typedef std::vector< std::string > | HostsVector |
Used to define a vector of hosts to contact. More... | |
Public Member Functions | |
SharedMemoryPush (const std::string &id, madara::transport::TransportSettings &new_settings, knowledge::KnowledgeBase &context) | |
Constructor. More... | |
virtual | ~SharedMemoryPush () |
Destructor. More... | |
void | add (std::vector< knowledge::KnowledgeBase > &kbs) |
Adds the list of knowledge bases to the push list. More... | |
int | check_transport (void) |
all subclasses should call this method at the beginning of send_data More... | |
void | clear (void) |
Clears the list of knowledge bases to push to. More... | |
virtual void | close (void) |
Closes this transport. More... | |
void | invalidate_transport (void) |
Invalidates a transport to indicate it is shutting down. More... | |
long | prep_send (const knowledge::KnowledgeMap &orig_updates, const char *print_prefix) |
Preps a message for sending. More... | |
virtual long | send_data (const knowledge::KnowledgeMap &modifieds) override |
Sends a list of updates to the domain. More... | |
void | set (std::vector< knowledge::KnowledgeBase > &kbs) |
Sets the push list to the provided list of knowledge bases. More... | |
TransportSettings & | settings (void) |
Getter for the transport settings. More... | |
virtual int | setup (void) |
all subclasses should call this method at the end of its setup More... | |
int | validate_transport (void) |
Validates a transport to indicate it is not shutting down. More... | |
Protected Attributes | |
madara::utility::ScopedArray< char > | buffer_ |
buffer for sending More... | |
madara::knowledge::ThreadSafeContext & | context_ |
HostsVector | hosts |
const std::string | id_ |
host:port identifier of this process More... | |
volatile bool | is_valid_ |
std::vector< knowledge::KnowledgeBase > | kbs_ |
threads for monitoring knowledge updates More... | |
uint64_t | last_toi_sent_ = 0 |
Latest TOI the previous send operation included. More... | |
madara::expression::ExpressionTree | on_data_received_ |
data received rules, defined in Transport settings More... | |
PacketScheduler | packet_scheduler_ |
scheduler for dropping packets to simulate network issues More... | |
BandwidthMonitor | receive_monitor_ |
monitor for receiving bandwidth usage More... | |
BandwidthMonitor | send_monitor_ |
monitor for sending bandwidth usage More... | |
QoSTransportSettings | settings_ |
volatile bool | shutting_down_ |
Custom network transport generated by gpc.pl.
Definition at line 17 of file SharedMemoryPush.h.
|
inherited |
Used to define a vector of hosts to contact.
Definition at line 51 of file Transport.h.
madara::transport::SharedMemoryPush::SharedMemoryPush | ( | const std::string & | id, |
madara::transport::TransportSettings & | new_settings, | ||
knowledge::KnowledgeBase & | context | ||
) |
Constructor.
id | unique identifier (generally host:port) |
new_settings | settings to apply to the transport |
context | the knowledge record context |
Definition at line 6 of file SharedMemoryPush.cpp.
|
virtual |
Destructor.
Definition at line 16 of file SharedMemoryPush.cpp.
|
inline |
Adds the list of knowledge bases to the push list.
Definition at line 46 of file SharedMemoryPush.h.
|
inlineinherited |
all subclasses should call this method at the beginning of send_data
Definition at line 17 of file Transport.inl.
|
inline |
Clears the list of knowledge bases to push to.
Definition at line 38 of file SharedMemoryPush.h.
|
virtualinherited |
Closes this transport.
Reimplemented in madara::transport::ZMQTransport, madara::transport::SpliceDDSTransport, and madara::transport::BasicASIOTransport.
Definition at line 104 of file Transport.cpp.
|
inlineinherited |
Invalidates a transport to indicate it is shutting down.
Definition at line 31 of file Transport.inl.
|
inherited |
Preps a message for sending.
orig_updates | updates before send filtering is applied |
print_prefix | prefix to include before every log message, e.g., "MyTransport::svc" |
filter the updates according to the filters specified by the user in QoSTransportSettings (if applicable)
size = buffer[0] (unsigned 64 bit) transport id = buffer[8] (8 byte) domain = buffer[16] (32 byte domain name) originator = buffer[48] (64 byte originator host:port) type = buffer[112] (unsigned 32 bit type of message–usually MULTIASSIGN) updates = buffer[116] (unsigned 32 bit number of updates) quality = buffer[120] (unsigned 32 bit quality of message) clock = buffer[124] (unsigned 64 bit clock for this message) ttl = buffer[132] (the new knowledge starts here) knowledge = buffer[133] (the new knowledge starts here)
Definition at line 860 of file Transport.cpp.
|
overridevirtual |
Sends a list of updates to the domain.
This function must be implemented by your transport
modifieds | a list of keys to values of all records that have been updated and could be sent. |
Return number of bytes sent or negative for error
Implements madara::transport::Base.
Definition at line 21 of file SharedMemoryPush.cpp.
|
inline |
Sets the push list to the provided list of knowledge bases.
Definition at line 54 of file SharedMemoryPush.h.
|
inlineinherited |
Getter for the transport settings.
Definition at line 40 of file Transport.inl.
|
virtualinherited |
all subclasses should call this method at the end of its setup
Reimplemented in madara::transport::ZMQTransport, madara::transport::UdpRegistryServer, madara::transport::UdpRegistryClient, madara::transport::SpliceDDSTransport, and madara::transport::BasicASIOTransport.
Definition at line 32 of file Transport.cpp.
|
inlineinherited |
Validates a transport to indicate it is not shutting down.
Definition at line 6 of file Transport.inl.
|
protectedinherited |
buffer for sending
Definition at line 153 of file Transport.h.
|
protectedinherited |
Definition at line 135 of file Transport.h.
|
protectedinherited |
Definition at line 127 of file Transport.h.
|
protectedinherited |
host:port identifier of this process
Definition at line 130 of file Transport.h.
|
protectedinherited |
Definition at line 125 of file Transport.h.
|
protected |
threads for monitoring knowledge updates
Definition at line 72 of file SharedMemoryPush.h.
|
protectedinherited |
Latest TOI the previous send operation included.
Definition at line 156 of file Transport.h.
|
protectedinherited |
data received rules, defined in Transport settings
Definition at line 139 of file Transport.h.
|
protectedinherited |
scheduler for dropping packets to simulate network issues
Definition at line 150 of file Transport.h.
|
protectedinherited |
monitor for receiving bandwidth usage
Definition at line 147 of file Transport.h.
|
protectedinherited |
monitor for sending bandwidth usage
Definition at line 144 of file Transport.h.
|
protectedinherited |
Definition at line 132 of file Transport.h.
|
protectedinherited |
Definition at line 126 of file Transport.h.