Msg.cpp
Go to the documentation of this file.
1 //
2 //
3 // Msg.cpp
4 //
5 
6 #include "Msg.hpp"
7 #include <sstream>
8 
9 
10 // ////////////////////////////////////////////////////////////
11 namespace datatypes
12 {
13 
14 Msg::Msg(const UINT16 sourceId)
15 {
16  m_sourceId = sourceId;
18 }
19 
20 Msg::Msg(const UINT16 sourceId, const std::string message)
21 {
22  m_sourceId = sourceId;
24  m_msgText = message;
25 }
26 
28 std::string Msg::toString() const
29 {
30  return m_msgText;
31 }
32 
33 std::string Msg::getMsg() const
34 {
35  return toString();
36 }
37 
38 // Set the text
39 void Msg::setMsg(std::string message)
40 {
41  m_msgText = message;
42 }
43 
45 std::ostream& operator<<(std::ostream& os, const Msg& msg)
46 {
47  os << msg.getMsg();
48  return os;
49 }
50 
51 
52 } // namespace datatypes
uint16_t UINT16
std::string getMsg() const
Definition: Msg.cpp:33
std::string m_msgText
Definition: Msg.hpp:42
std::string toString() const
Conversion to string for debugging.
Definition: Msg.cpp:28
void setMsg(std::string message)
Definition: Msg.cpp:39
Msg(const UINT16 sourceId)
Constructor.
Definition: Msg.cpp:14
std::ostream & operator<<(std::ostream &os, const EvalCaseResult &result)


libsick_ldmrs
Author(s): SICK AG , Martin Günther , Jochen Sprickerhof
autogenerated on Mon Oct 26 2020 03:27:30