MADARA  3.4.1
TransportContext.inl
Go to the documentation of this file.
1 #ifndef _TRANSPORT_CONTEXT_INL_
2 #define _TRANSPORT_CONTEXT_INL_
3 
4 #include "TransportContext.h"
5 
7 {
8  records_.clear();
9 }
10 
12 {
13  return operation_;
14 }
15 
17  void) const
18 {
19  return receive_bandwidth_;
20 }
21 
23  void) const
24 {
25  return send_bandwidth_;
26 }
27 
29  void) const
30 {
31  return current_time_;
32 }
33 
35  void) const
36 {
37  return message_time_;
38 }
39 
41  int64_t operation)
42 {
43  operation_ = operation;
44 }
45 
47  uint64_t bandwidth)
48 {
49  receive_bandwidth_ = bandwidth;
50 }
51 
53  uint64_t bandwidth)
54 {
55  send_bandwidth_ = bandwidth;
56 }
57 
59  uint64_t current_time)
60 {
61  current_time_ = current_time;
62 }
63 
65  uint64_t message_time)
66 {
67  message_time_ = message_time;
68 }
69 
71  const std::string& key, const madara::knowledge::KnowledgeRecord& record)
72 {
73  records_[key] = record;
74 }
75 
78 {
79  return records_;
80 }
81 
83  const std::string& domain)
84 {
85  domain_ = domain;
86 }
87 
89  void) const
90 {
91  return domain_;
92 }
93 
95  const std::string& originator)
96 {
97  originator_ = originator;
98 }
99 
101  void) const
102 {
103  return originator_;
104 }
105 
107  const std::string& endpoint)
108 {
109  endpoint_ = endpoint;
110 }
111 
113  void) const
114 {
115  return endpoint_;
116 }
117 
119  const knowledge::KnowledgeMap& source)
120 {
121  records_ = source;
122 }
123 
124 #endif // _TRANSPORT_CONTEXT_INL_
This class encapsulates an entry in a KnowledgeBase.
uint64_t get_send_bandwidth(void) const
Gets the send/rebroadcast bandwidth in bytes per second.
void set_send_bandwidth(uint64_t bandwidth)
Sets the bandwidth used for sends/rebroadcast in bytes per second.
const std::string & get_domain(void) const
Returns the network domain.
void add_record(const std::string &key, const madara::knowledge::KnowledgeRecord &record)
Adds a record to the list that should be appended to send or rebroadcast.
void set_operation(int64_t operation)
Sets the operation that the context is/should be performing.
void set_records(const knowledge::KnowledgeMap &source)
Sets the current message originator.
int64_t get_operation(void) const
Get operation that the context is performing.
void set_receive_bandwidth(uint64_t bandwidth)
Sets the bandwidth used for receives in bytes per second.
uint64_t get_current_time(void) const
Gets the current timestamp.
void clear_records(void)
Clears records added through filtering operations.
void set_domain(const std::string &domain)
Sets the network domain.
void set_endpoint(const std::string &endpoint)
Sets the current message endpoint.
knowledge::KnowledgeMap records_
Context specific records.
const std::string & get_originator(void) const
Returns the current message originator.
uint64_t get_receive_bandwidth(void) const
Gets the receive bandwidth in bytes per second.
uint64_t get_message_time(void) const
Gets the message timestamp.
void set_message_time(uint64_t message_time)
Sets the message time.
void set_current_time(uint64_t current_time)
Sets the current time.
const knowledge::KnowledgeMap & get_records(void) const
Returns the additional records stored in the context.
const std::string & get_endpoint(void) const
Returns the current message endpoint.
void set_originator(const std::string &originator)
Sets the current message originator.
constexpr string_t string
::std::map< std::string, KnowledgeRecord > KnowledgeMap