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
uint16_t UINT16
Definition: BasicDatatypes.hpp:27
datatypes::Msg::Msg
Msg(const UINT16 sourceId)
Constructor.
Definition: Msg.cpp:14
datatypes::Msg
Definition: Msg.hpp:18
datatypes::BasicData::m_datatype
UINT16 m_datatype
Definition: BasicDatatypes.hpp:107
datatypes::Msg::m_msgText
std::string m_msgText
Definition: Msg.hpp:42
datatypes::Msg::setMsg
void setMsg(std::string message)
Definition: Msg.cpp:39
datatypes::Msg::toString
std::string toString() const
Conversion to string for debugging.
Definition: Msg.cpp:28
datatypes::operator<<
std::ostream & operator<<(std::ostream &os, const EvalCaseResult &result)
Definition: EvalCaseResult.cpp:72
Msg.hpp
datatypes::Msg::getMsg
std::string getMsg() const
Definition: Msg.cpp:33
datatypes::BasicData::m_sourceId
UINT16 m_sourceId
Definition: BasicDatatypes.hpp:108
Datatype_Msg
@ Datatype_Msg
Definition: BasicDatatypes.hpp:58
datatypes
Definition: BasicDatatypes.hpp:91


libsick_ldmrs
Author(s): SICK AG , Martin Günther , Jochen Sprickerhof
autogenerated on Wed Oct 26 2022 02:11:57