S3FC project page S3FC home page

Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

s3_msgb_log_rx_thread Class Reference

This thread could (and should) be used in conjunction with ostream derived class s3_msgb_logger. More...

#include <s3_logger.h>

Inheritance diagram for s3_msgb_log_rx_thread:

Inheritance graph
[legend]
Collaboration diagram for s3_msgb_log_rx_thread:

Collaboration graph
[legend]
List of all members.

Public Methods

 s3_msgb_log_rx_thread (const std::string &my_box_name, std::ostream *ostream_arg=0, const std::string &po_ip="", const unsigned int po_port=0)
 The constructor. More...

virtual ~s3_msgb_log_rx_thread ()
 Destructor. More...

void main_loop ()
 The main loop streams received messages to the applicable ostream. More...


Protected Attributes

s3_message_box msg_box
 The S3 message box associated with this thread. More...

std::ostream * ostr
 A pointer to the ostream to where received messages will be logged. More...


Detailed Description

This thread could (and should) be used in conjunction with ostream derived class s3_msgb_logger.

When a message is streamed to s3_msgb_logger, that message is send to a message box. The thread encapsulated by this class will read the message from its inbox and log that message.

The ostream to which this class wil log can be set via the constructor. If no ostream is specified, received messages are streamed to cerr.

See also:
The overall operation of the S3 Logging System.
Author:
Francois Swanepoel <swanepoel@stonethree.com>

Definition at line 753 of file s3_logger.h.


Constructor & Destructor Documentation

s3_msgb_log_rx_thread::s3_msgb_log_rx_thread const std::string &    my_box_name,
std::ostream *    ostream_arg = 0,
const std::string &    po_ip = "",
const unsigned int    po_port = 0
[inline]
 

The constructor.

Connects the message box to the postal system.

When values other than the defaults are provided for both the Post Office switch IP and Port arguments, the message box system is initialised if it is not yet initialised. When these arguments are omitted, the message box system must be initialised prior to the instantiation of this class. If the message box connection fail for whatever reason, an s3_generic_exception will be thrown.

Parameters:
my_box_name  The name of the internal message box.
ostream_arg  A pointer to the ostream to where received messages will be logged. Defaulting will cause received messages to be send to cerr.
po_ip  The IP address of the Post Office switch.
po_port  The Post Office switch port.

Definition at line 785 of file s3_logger.h.

References s3_message_box::connect, s3_message_box::init, s3_message_box::initialised, ostr, s3_thread_base::state_changed, and s3_message_box::subscribe_arrival.

virtual s3_msgb_log_rx_thread::~s3_msgb_log_rx_thread   [inline, virtual]
 

Destructor.

Disconnects the message box from the postal system.

Definition at line 814 of file s3_logger.h.

References s3_message_box::disconnect.


Member Function Documentation

void s3_msgb_log_rx_thread::main_loop   [inline, virtual]
 

The main loop streams received messages to the applicable ostream.

Implements s3_thread_base.

Definition at line 822 of file s3_logger.h.

References s3_message::get_body, s3_message_box::get_msg, s3_message::is_empty, ostr, s3_thread_base::test_cancel, and s3_thread_base::wait_on_state_changed.


Member Data Documentation

s3_message_box s3_msgb_log_rx_thread::msg_box [protected]
 

The S3 message box associated with this thread.

Definition at line 760 of file s3_logger.h.

std::ostream* s3_msgb_log_rx_thread::ostr [protected]
 

A pointer to the ostream to where received messages will be logged.

Definition at line 763 of file s3_logger.h.

Referenced by main_loop, and s3_msgb_log_rx_thread.


The documentation for this class was generated from the following file:
Send comments to: s3fc@stonethree.com SourceForge Logo