MADARA  3.2.3
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 
12  "transport::validate_transport: transport is ready\n");
13 
14  return 0;
15 }
16 
17 inline int
19 {
21  "transport::check_transport: checking for valid transport\n");
22 
23  if (!is_valid_)
24  return -2;
25 
26  if (shutting_down_)
27  return -1;
28 
29  return 0;
30 }
31 
32 inline void
34 {
35  is_valid_ = false;
36  shutting_down_ = true;
37 
39  "transport::invalidate_transport: invalidating transport\n");
40 }
41 
44 {
45  return settings_;
46 }
47 
48 #endif
volatile bool is_valid_
Definition: Transport.h:126
QoSTransportSettings settings_
Definition: Transport.h:133
void invalidate_transport(void)
Invalidates a transport to indicate it is shutting down.
Definition: Transport.inl:33
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:127
logger::Logger & get_logger(void) const
Gets the logger used for information printing.
madara::knowledge::ThreadSafeContext & context_
Definition: Transport.h:136
int check_transport(void)
all subclasses should call this method at the beginning of send_data
Definition: Transport.inl:18
TransportSettings & settings(void)
Getter for the transport settings.
Definition: Transport.inl:43