Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Static Public Attributes

ts::Errata::Message Struct Reference

Storage for a single message. More...

#include <Errata.h>

Collaboration diagram for ts::Errata::Message:
Collaboration graph
[legend]

Public Types

typedef Message self
 Self reference type.
typedef bool(* SuccessTest )(Message const &m)
 Type for overriding success message test.

Public Member Functions

 Message ()
 Default constructor.
 Message (std::string const &text)
 Construct from text.
 Message (Id id, std::string const &text)
 Construct with id and text.
 Message (Id id, Code code, std::string const &text)
 Construct with id, code, and text.
selfclear ()
 Reset to the message to default state.
selfset (Id id)
 Set the message Id.
selfset (Code code)
 Set the code.
selfset (std::string const &text)
 Set the text.
selfset (char const *text)
 Set the text.
selfset (Errata const &err)
 Set the errata.
std::string const & text () const
 Get the text of the message.
Code getCode () const
 Get the code.
Errata getErrata () const
 Get the nested status.

Static Public Member Functions

static bool isCodeZero (Message const &m)
 Indicate success if the message code is zero.

Data Fields

Id m_id
 Message ID.
Code m_code
 Message code.
std::string m_text
 Final text.
Errata m_errata
 Nested errata.

Static Public Attributes

static Code Default_Code = 0
 The default message code.
static SuccessTest Success_Test
 Success message test.
static SuccessTest const DEFAULT_SUCCESS_TEST

Detailed Description

Storage for a single message.

Definition at line 427 of file Errata.h.


Member Typedef Documentation

Self reference type.

Definition at line 428 of file Errata.h.

typedef bool(* ts::Errata::Message::SuccessTest)(Message const &m)

Type for overriding success message test.

Definition at line 501 of file Errata.h.


Constructor & Destructor Documentation

ts::Errata::Message::Message (  )  [inline]

Default constructor.

The message has Id = 0, default code, and empty text.

Definition at line 790 of file Errata.h.

ts::Errata::Message::Message ( std::string const &  text  )  [inline]

Construct from text.

Id is zero and Code is default.

Parameters:
text Finalized message text.

Definition at line 793 of file Errata.h.

ts::Errata::Message::Message ( Id  id,
std::string const &  text 
) [inline]

Construct with id and text.

Code is default.

Parameters:
id ID of message in table.
text Final text for message.

Definition at line 796 of file Errata.h.

ts::Errata::Message::Message ( Id  id,
Code  code,
std::string const &  text 
) [inline]

Construct with id, code, and text.

Parameters:
id Message Id.
code Message Code.
text Final text for message.

Definition at line 799 of file Errata.h.


Member Function Documentation

Errata::Message & ts::Errata::Message::clear ( void   )  [inline]

Reset to the message to default state.

Definition at line 802 of file Errata.h.

References ts::Errata::clear(), Default_Code, m_code, m_errata, m_id, and m_text.

Errata::Code ts::Errata::Message::getCode (  )  const [inline]

Get the code.

Definition at line 811 of file Errata.h.

References m_code.

Errata ts::Errata::Message::getErrata (  )  const [inline]

Get the nested status.

Returns:
A status object, which is not NULL if there is a nested status stored in this item.

Definition at line 812 of file Errata.h.

References m_errata.

bool ts::Errata::Message::isCodeZero ( Message const &  m  )  [static]

Indicate success if the message code is zero.

Note:
Used as the default success test.

Definition at line 41 of file Errata.cc.

Errata::Message & ts::Errata::Message::set ( std::string const &  text  )  [inline]

Set the text.

Parameters:
text New message text.

Definition at line 822 of file Errata.h.

References m_text.

Errata::Message & ts::Errata::Message::set ( Errata const &  err  )  [inline]

Set the errata.

Parameters:
err Errata to store.

Definition at line 830 of file Errata.h.

References ts::Errata::doNotLog(), and m_errata.

Errata::Message & ts::Errata::Message::set ( Id  id  )  [inline]

Set the message Id.

Parameters:
id New message Id.

Definition at line 814 of file Errata.h.

References m_id.

Errata::Message & ts::Errata::Message::set ( char const *  text  )  [inline]

Set the text.

Parameters:
text New message text.

Definition at line 826 of file Errata.h.

References m_text.

Errata::Message & ts::Errata::Message::set ( Code  code  )  [inline]

Set the code.

Parameters:
code New code for message.

Definition at line 818 of file Errata.h.

References m_code.

std::string const & ts::Errata::Message::text (  )  const [inline]

Get the text of the message.

Definition at line 810 of file Errata.h.

References m_text.


Field Documentation

The default message code.

This value is used as the Code value for constructing and clearing messages. It can be changed to control the value used for empty messages.

Definition at line 498 of file Errata.h.

Referenced by clear().

Initial value:

Definition at line 522 of file Errata.h.

Message code.

Definition at line 525 of file Errata.h.

Referenced by clear(), getCode(), ts::Errata::Data::push(), and set().

Nested errata.

Definition at line 527 of file Errata.h.

Referenced by clear(), getErrata(), and set().

Message ID.

Definition at line 524 of file Errata.h.

Referenced by clear(), and set().

Final text.

Definition at line 526 of file Errata.h.

Referenced by clear(), set(), and text().

Initial value:

Success message test.

When a message is tested for being "successful", this function is called. It may be overridden by a client. The initial value is DEFAULT_SUCCESS_TEST.

Note:
This is only called when there are Messages in the Errata. An empty Errata (NULL or empty stack) is always a success. Only the top Message is checked.
Returns:
true if the message indicates success, false otherwise.

Definition at line 516 of file Errata.h.

Referenced by ts::Errata::isOK().


The documentation for this struct was generated from the following files: