1 #ifndef _MADARA_UDP_REGISTRY_CLIENT_READ_THREAD_H_ 2 #define _MADARA_UDP_REGISTRY_CLIENT_READ_THREAD_H_ 16 #include "ace/Mutex.h" 17 #include "ace/Barrier.h" 18 #include "ace/Atomic_Op_T.h" 19 #include "ace/Thread_Mutex.h" 21 #include "ace/Synch.h" 22 #include "ace/INET_Addr.h" 23 #include "ace/SOCK_Dgram.h" 52 std::map <std::string, ACE_INET_Addr> & addresses,
53 ACE_SOCK_Dgram & socket,
83 const char * print_prefix,
103 #ifndef _MADARA_NO_KARL_ 106 #endif // _MADARA_NO_KARL_ 123 #endif // _MADARA_UDP_REGISTRY_CLIENT_READ_THREAD_H_ Thread for reading knowledge and registry updates through a UDP socket.
knowledge::ThreadSafeContext * context_
knowledge context
PacketScheduler & packet_scheduler_
scheduler for mimicking target network conditions
madara::utility::ScopedArray< char > buffer_
buffer for sending
UdpRegistryClientReadThread(const TransportSettings &settings, const std::string &id, std::map< std::string, ACE_INET_Addr > &addresses, ACE_SOCK_Dgram &socket, BandwidthMonitor &send_monitor, BandwidthMonitor &receive_monitor, PacketScheduler &packet_scheduler)
Constructor.
void init(knowledge::KnowledgeBase &knowledge)
Initializes MADARA context-related items.
std::map< std::string, ACE_INET_Addr > addresses_
internet addresses of our peers
void run(void)
The main loop internals for the read thread.
void rebroadcast(const char *print_prefix, MessageHeader *header, const knowledge::KnowledgeMap &records)
Sends a rebroadcast packet to all peers.
This class stores variables and their values for use by any entity needing state information in a thr...
Provides scheduler for dropping packets.
Holds basic transport settings.
Compiled, optimized KaRL logic.
const QoSTransportSettings settings_
Transport settings.
madara::knowledge::CompiledExpression on_data_received_
data received rules, defined in Transport settings
Abstract base class for implementing threads.
void cleanup(void)
Cleanup function called by thread manager.
This class provides a distributed knowledge base to users.
::std::map< std::string, KnowledgeRecord > KnowledgeMap
ACE_SOCK_Dgram & socket_
The socket we are writing to and reading from.
Container for quality-of-service settings.
const std::string id_
host:port identifier of this process
Provides monitoring capability of a transport's bandwidth.
Provides functions and classes for the distributed knowledge base.
Copyright (c) 2015 Carnegie Mellon University.
BandwidthMonitor & send_monitor_
monitor for sending bandwidth usage
BandwidthMonitor & receive_monitor_
monitor for receiving bandwidth usage