src
datatypes
Msg.hpp
Go to the documentation of this file.
1
// This is -*-c++-*-
2
//
3
// Msg.hpp
4
//
5
6
#ifndef MSG_HPP
7
#define MSG_HPP
8
9
#include "../BasicDatatypes.hpp"
10
#include <iosfwd>
// for istream, ostream
11
12
namespace
datatypes
13
{
14
15
//
16
// A text message.
17
//
18
class
Msg
:
public
BasicData
19
{
20
public
:
22
Msg
(
const
UINT16
sourceId);
23
25
Msg
(
const
UINT16
sourceId,
const
std::string message);
26
27
// Estimate the memory usage of this object
28
virtual
const
UINT32
getUsedMemory
()
const
{
return
sizeof
(*this) +
m_msgText
.length(); };
29
30
std::string
getMsg
()
const
;
31
void
setMsg
(std::string message);
32
33
std::string
toString
()
const
;
34
36
bool
operator==
(
const
Msg
& other)
const
37
{
38
return
(
m_msgText
== other.
m_msgText
);
39
}
40
41
private
:
42
std::string
m_msgText
;
43
};
44
45
std::ostream&
operator<<
(std::ostream& os,
const
Msg
& msg);
46
47
}
// namespace datatypes
48
49
#endif
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::Msg::getUsedMemory
virtual const UINT32 getUsedMemory() const
Definition:
Msg.hpp:28
datatypes::BasicData
Definition:
BasicDatatypes.hpp:95
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::operator==
bool operator==(const Msg &other) const
Equality predicate.
Definition:
Msg.hpp:36
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
datatypes::Msg::getMsg
std::string getMsg() const
Definition:
Msg.cpp:33
UINT32
uint32_t UINT32
Definition:
BasicDatatypes.hpp:26
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