A text message with a type indicating if the message is information or an error. More...
#include <Message.h>
Public Types | |
enum | Type { INFORMATION, ERROR } |
Indicates whether the message is informational or an error message. More... | |
Public Member Functions | |
Message () | |
Initializes a newly created Message object with default attributes: type == INFORMATION and text == "". | |
Message (Type type, const std::string &text) | |
Initializes a newly created Message object with attributes specified by the input parameters. | |
std::string | getText () const |
Return the message text. | |
Type | getType () const |
Return the message type. | |
void | setText (const std::string &text) |
Set the message text. | |
void | setType (Type type) |
Set the message type. | |
std::string | toString () const |
Return a string representation of this Message . | |
Private Attributes | |
Type | type |
The type of message. | |
std::string | text |
The message text. |
A text message with a type indicating if the message is information or an error.
Some responses from the Yokosumo service return messages, especially in case of error.
Definition at line 16 of file Message.h.
Message::Message | ( | ) |
Initializes a newly created Message
object with default attributes: type == INFORMATION and text == "".
Definition at line 11 of file Message.cpp.
Message::Message | ( | Type | type, | |
const std::string & | text | |||
) |
Initializes a newly created Message
object with attributes specified by the input parameters.
type | the type of the message: INFORMATION or ERROR. | |
text | the text of the message. |
Definition at line 16 of file Message.cpp.
std::string Message::getText | ( | ) | const |
Return the message text.
Definition at line 23 of file Message.cpp.
References text.
Referenced by Yosokumo::YosokumoProtobuf::makeProtobufMessageFromMessage(), and toString().
Message::Type Message::getType | ( | ) | const |
Return the message type.
Definition at line 28 of file Message.cpp.
References type.
Referenced by Yosokumo::YosokumoProtobuf::makeProtobufMessageFromMessage(), and toString().
void Message::setText | ( | const std::string & | text | ) |
Set the message text.
text | the text of the message is set to this. |
Definition at line 33 of file Message.cpp.
Referenced by Yosokumo::YosokumoProtobuf::makeMessageFromProtobufMessage().
void Message::setType | ( | Type | type | ) |
Set the message type.
type | the type of the message is set to this. |
Definition at line 38 of file Message.cpp.
Referenced by Yosokumo::YosokumoProtobuf::makeMessageFromProtobufMessage().
std::string Message::toString | ( | ) | const |
std::string Yosokumo::Message::text [private] |
Type Yosokumo::Message::type [private] |