Yosokumo::Message Class Reference

A text message with a type indicating if the message is information or an error. More...

#include <Message.h>

List of all members.

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.

Detailed Description

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.


Member Enumeration Documentation

Indicates whether the message is informational or an error message.

Enumerator:
INFORMATION 

the message is informational.

ERROR 

the message indicates an error.

Definition at line 23 of file Message.h.


Constructor & Destructor Documentation

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.

Parameters:
type the type of the message: INFORMATION or ERROR.
text the text of the message.

Definition at line 16 of file Message.cpp.


Member Function Documentation

std::string Message::getText (  )  const

Return the message text.

Returns:
the text of the message.

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.

Returns:
the type of this message.

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.

Parameters:
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.

Parameters:
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

Return a string representation of this Message.

Returns:
the string representation of this Message.

Definition at line 45 of file Message.cpp.

References getText(), and getType().


Member Data Documentation

std::string Yosokumo::Message::text [private]

The message text.

Definition at line 45 of file Message.h.

Referenced by getText().

The type of message.

Definition at line 40 of file Message.h.

Referenced by getType().


The documentation for this class was generated from the following files:
Generated on Mon May 13 09:19:12 2013 for C++ Yosokumo API by  doxygen 1.6.3