MADARA  3.4.1
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 
18 {
20  "transport::check_transport: checking for valid transport\n");
21 
22  if (!is_valid_)
23  return -2;
24 
25  if (shutting_down_)
26  return -1;
27 
28  return 0;
29 }
30 
32 {
33  is_valid_ = false;
34  shutting_down_ = true;
35 
37  "transport::invalidate_transport: invalidating transport\n");
38 }
39 
41  void)
42 {
43  return settings_;
44 }
45 
46 #endif
#define madara_logger_log(loggering, level,...)
Fast version of the madara::logger::log method.
Definition: Logger.h:20
const ThreadSafeContext * context_
logger::Logger & get_logger(void) const
Gets the logger used for information printing.
int validate_transport(void)
Validates a transport to indicate it is not shutting down.
Definition: Transport.inl:6
volatile bool is_valid_
Definition: Transport.h:125
madara::knowledge::ThreadSafeContext & context_
Definition: Transport.h:135
int check_transport(void)
all subclasses should call this method at the beginning of send_data
Definition: Transport.inl:17
TransportSettings & settings(void)
Getter for the transport settings.
Definition: Transport.inl:40
volatile bool shutting_down_
Definition: Transport.h:126
void invalidate_transport(void)
Invalidates a transport to indicate it is shutting down.
Definition: Transport.inl:31
Holds basic transport settings.