ifw  0.0.1-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Message.hpp
Go to the documentation of this file.
1 
5 #ifndef IFW_CTD_MPTK_MESSAGE_HPP_
6 #define IFW_CTD_MPTK_MESSAGE_HPP_
7 
8 #include <string>
9 
10 #include "rad/Logger.hpp"
11 
12 namespace ctd {
13 namespace mptk {
14 
15 
17 class Message {
18 public:
19 
20  Message();
21 
22  Message(const Message& source);
23 
25  Message(const std::string& command,
26  const uint8_t priority,
27  const std::string& sender_thread_id,
28  const std::string& receiver_thread_id,
29  const std::string& m_data);
30 
31  ~Message();
32 
34  const std::string& Command() const;
35 
37  uint8_t Priority() const;
38 
40  const std::string& SenderThreadId() const;
41 
43  const std::string& ReceiverThreadId() const;
44 
46  const std::string& Data() const;
47 
49  void SetReceptionTime(const double timestamp);
50 
52  std::string Print(const uint16_t truncate = 128) const;
53 
55 
56 protected:
57  std::string m_command;
58  uint8_t m_priority;
59  std::string m_sender_thread_id;
60  std::string m_receiver_thread_id;
61  std::string m_data;
62  double m_submission_time;
63  double m_reception_time;
64 
65 private:
66  void _Copy(const Message& source);
67 };
68 
69 } // namespace mptk
70 } // namespace ctd
71 
72 #endif // IFW_CTD_MPTK_MESSAGE_HPP_
73 
const std::string & ReceiverThreadId() const
Return receiver Thread ID.
Definition: Message.cpp:83
uint8_t Priority() const
Return priotity of message (message queue priority).
Definition: Message.cpp:71
void SetReceptionTime(const double timestamp)
Set the time of receiving the message from the Message Bus.
Definition: Message.cpp:109
double m_submission_time
Definition: Message.hpp:62
uint8_t m_priority
Definition: Message.hpp:58
double m_reception_time
Definition: Message.hpp:63
const std::string & Data() const
Return data (payload) of message.
Definition: Message.cpp:89
Message & operator=(const Message &source)
Definition: Message.cpp:46
source
Definition: radgen_tool.py:35
const std::string & Command() const
Return name of command in object.
Definition: Message.cpp:65
Message()
Definition: Message.cpp:19
std::string m_command
Definition: Message.hpp:57
std::string m_receiver_thread_id
Definition: Message.hpp:60
std::string Print(const uint16_t truncate=128) const
Generate ASCII output providing a status of the object.
Definition: Message.cpp:95
std::string m_sender_thread_id
Definition: Message.hpp:59
std::string m_data
Definition: Message.hpp:61
~Message()
Definition: Message.cpp:42
const std::string & SenderThreadId() const
Return sender Thread ID.
Definition: Message.cpp:77