1 #ifndef _MADARA_TRANSPORT_SETTINGS_H_
2 #define _MADARA_TRANSPORT_SETTINGS_H_
22 #include "madara/LockType.h"
27 #include "madara/MadaraExport.h"
86 #define DEFAULT_DOMAIN "KaRL"
88 typedef std::vector<std::string>
Voters;
92 static const uint32_t DEFAULT_QUEUE_LENGTH = 500000;
95 static const uint32_t DEFAULT_DEADLINE = 0;
101 static const uint32_t DEFAULT_RELIABILITY =
RELIABLE;
111 #define DEFAULT_PROCESSES 1
116 #define MAXIMUM_RESEND_ATTEMPTS 10
152 void clear_hosts(
void);
157 void clear_read_domains(
void);
163 void get_read_domains(std::vector<std::string>& domains)
const;
170 bool is_reading_domain(
const std::string domain)
const;
176 size_t num_read_domains(
void)
const;
185 void debug_to_kb(
const std::string& prefix =
".transport");
200 virtual void load_text(
216 virtual void save_text(
const std::string& filename,
227 uint32_t read_threads = 1;
238 uint32_t queue_length = DEFAULT_QUEUE_LENGTH;
241 uint32_t type = DEFAULT_TRANSPORT;
244 uint32_t max_fragment_size = 62000;
257 uint32_t fragment_queue_length = 100;
261 uint32_t reliability = DEFAULT_RELIABILITY;
273 bool delay_launch =
false;
276 bool never_exit =
false;
279 bool send_reduced_message_header =
false;
285 double slack_time = 0;
291 double read_thread_hertz = 1000.0;
300 double max_send_hertz = 0.0;
313 bool no_sending =
false;
318 bool no_receiving =
false;
325 bool send_history =
false;
343 switch (settings.
type)
349 name =
"PrismTech DDS";
355 name =
"TCP (unsupported)";
358 name =
"UDP Unicast";
361 name =
"UDP Multicast";
364 name =
"UDP Broadcast";
367 name =
"UDP P2P Registry Server";
370 name =
"UDP P2P Registry Client";
373 name =
"ZeroMQ Pub/Sub";
#define DEFAULT_ID
Default id in group.
#define MAXIMUM_RESEND_ATTEMPTS
Default number of processes in group.
#define DEFAULT_PROCESSES
Default number of processes in group.
#define DEFAULT_DOMAIN
Default knowledge domain.
Base class from which all transports must be derived.
Holds basic transport settings.
OriginatorFragmentMap fragment_map
Map of fragments received by originator.
TransportSettings()=default
Constructor for this class.
std::string on_data_received_logic
Logic to be evaluated after every successful update.
std::vector< std::string > hosts
Host information for transports that require it.
uint32_t type
Type of transport. See madara::transport::Types for options.
std::map< std::string, int > read_domains_
Any acceptable read domain is added here.
std::vector< std::string > Voters
std::map< std::string, ClockFragmentMap > OriginatorFragmentMap
Map of originator to a map of clocks to fragments.
MADARA_EXPORT std::string types_to_string(int id)
Converts a transport type enum to a string equivalent.
std::string type_name(const TransportSettings &settings)
Copyright(c) 2020 Galois.