1 #ifndef _MADARA_TRANSPORT_H_ 2 #define _MADARA_TRANSPORT_H_ 20 #include "ace/Thread_Mutex.h" 21 #include "ace/Recursive_Thread_Mutex.h" 22 #include "ace/Condition_T.h" 23 #include "ace/Guard_T.h" 26 #include "madara/MADARA_export.h" 27 #include "ace/High_Res_Timer.h" 36 #include "madara/cid/CIDSettings.h" 37 #include "madara/cid/CIDConvenience.h" 38 #include "madara/cid/CIDHeuristic.h" 39 #include "madara/cid/CIDGenetic.h" 87 int validate_transport (
void);
92 virtual int setup (
void);
97 int check_transport (
void);
111 virtual long start_latency (
void)
113 if (!settings_.latency_enabled)
116 DLINFO "SpliceDDSTransport::start_latency:" \
117 " Latency enabled is not set in your" 118 " madara::transport::TransportSettings instance. Update your" 119 " program's code and set settings.latency_enabled = true.\n"));
123 return check_transport ();
130 virtual long vote (
void)
132 if (!settings_.latency_enabled)
135 DLINFO "SpliceDDSTransport::vote:" \
136 " Latency enabled is not set in your" 137 " madara::transport::TransportSettings instance. Update your" 138 " program's code and set settings.latency_enabled = true.\n"));
142 return check_transport ();
159 const char * print_prefix);
171 void invalidate_transport (
void);
176 virtual void close (
void);
193 #ifndef _MADARA_NO_KARL_ 197 #endif // _MADARA_NO_KARL_ 252 #ifndef _MADARA_NO_KARL_
257 const char * print_prefix,
258 const char * remote_host,
279 int64_t & buffer_remaining,
281 const char * print_prefix,
292 #endif // _MADARA_TRANSPORT_H_
QoSTransportSettings settings_
utility::ThreadSafeVector< Base * > Transports
Encapsulates a MADARA KaRL expression into an evaluatable tree.
This class stores variables and their values for use by any entity needing state information in a thr...
Provides scheduler for dropping packets.
MADARA_Export utility::Refcounter< logger::Logger > global_logger
Holds basic transport settings.
Compiled, optimized KaRL logic.
BandwidthMonitor receive_monitor_
monitor for receiving bandwidth usage
#define madara_logger_ptr_log(logger, level,...)
Fast version of the madara::logger::log method for Logger pointers.
::std::map< std::string, KnowledgeRecord * > KnowledgeRecords
volatile bool shutting_down_
::std::map< std::string, KnowledgeRecord > KnowledgeMap
ACE_Condition< ACE_Thread_Mutex > Condition
const std::string id_
host:port identifier of this process
int MADARA_Export process_received_update(const char *buffer, uint32_t bytes_read, const std::string &id, knowledge::ThreadSafeContext &context, const QoSTransportSettings &settings, BandwidthMonitor &send_monitor, BandwidthMonitor &receive_monitor, knowledge::KnowledgeMap &rebroadcast_records, knowledge::CompiledExpression &on_data_received, const char *print_prefix, const char *remote_host, MessageHeader *&header)
Processes a received update, updates monitors, fills rebroadcast records according to settings filter...
Container for quality-of-service settings.
int MADARA_Export prep_rebroadcast(knowledge::ThreadSafeContext &context, char *buffer, int64_t &buffer_remaining, const QoSTransportSettings &settings, const char *print_prefix, MessageHeader *header, const knowledge::KnowledgeMap &records, PacketScheduler &packet_scheduler)
Preps a buffer for rebroadcasting records to other agents on the network.
Provides monitoring capability of a transport's bandwidth.
PacketScheduler packet_scheduler_
scheduler for dropping packets to simulate network issues
std::vector< std::string > HostsVector
Used to define a vector of hosts to contact.
Copyright (c) 2015 Carnegie Mellon University.
madara::utility::ScopedArray< char > buffer_
buffer for sending
Base class from which all transports must be derived.
BandwidthMonitor send_monitor_
monitor for sending bandwidth usage
madara::knowledge::ThreadSafeContext & context_