MADARA  3.1.8
Transport.inl
Go to the documentation of this file.
1 #ifndef _TRANSPORT_INL_
2 #define _TRANSPORT_INL_
3 
4 #include "Transport.h"
5 
7 {
8  is_valid_ = true;
9  shutting_down_ = false;
10  valid_setup_.broadcast ();
11 
13  "transport::validate_transport: transport is ready\n");
14 
15  return 0;
16 }
17 
18 inline int
20 {
22  "transport::check_transport: checking for valid transport\n");
23 
24  if (!is_valid_)
25  return -2;
26 
27  if (shutting_down_)
28  return -1;
29 
30  return 0;
31 }
32 
33 inline void
35 {
36  is_valid_ = false;
37  shutting_down_ = true;
38  valid_setup_.broadcast ();
39 
41  "transport::invalidate_transport: invalidating transport\n");
42 }
43 
46 {
47  return settings_;
48 }
49 
50 #endif
volatile bool is_valid_
Definition: Transport.h:179
QoSTransportSettings settings_
Definition: Transport.h:188
void invalidate_transport(void)
Invalidates a transport to indicate it is shutting down.
Definition: Transport.inl:34
int validate_transport(void)
Validates a transport to indicate it is not shutting down.
Definition: Transport.inl:6
Holds basic transport settings.
#define madara_logger_log(logger, level,...)
Fast version of the madara::logger::log method.
Definition: Logger.h:20
volatile bool shutting_down_
Definition: Transport.h:180
logger::Logger & get_logger(void) const
Gets the logger used for information printing.
madara::knowledge::ThreadSafeContext & context_
Definition: Transport.h:191
int check_transport(void)
all subclasses should call this method at the beginning of send_data
Definition: Transport.inl:19
TransportSettings & settings(void)
Getter for the transport settings.
Definition: Transport.inl:45