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

CTBmessage Class Reference

Message interface for command line and GUI environments. More...

#include "CTBmessage.hxx"

Collaboration diagram for CTBmessage:

Collaboration graph
[legend]
List of all members.

Static Public Methods

void Status (const char *c_text)
void Info (const char *c_text)
void Warning (const char *c_text)
CTBint Error (const char *c_text)
void Hook (CTBmessageWriter *p_mw=0)

Static Private Attributes

CTBmessageWritermp_mw

Detailed Description

Message interface for command line and GUI environments.

The CTBmessage class provides a set of global functions for handling the output of messages in a unified way for both command line and GUI environments. It provides primitives to render

In command line applications the output will in general be written to cout, while in GUI applications the output will be rendered in various forms of dialogs. The actual implemenation is choosen in the initialization part of the main program with a call of Hook().

This allows to write classes which can be used in both command line and GUI environments but still have a consistent way of reporting status and exceptional incidences.

CTBmessage provides the API of the message interface in the form of a set of global functions. CTBmessageWriter is an abstract base class from which all the concrete imlementations, like CTBmessageWriterStream, are derived.

Definition at line 18 of file CTBmessage.hxx.


Member Function Documentation

void CTBmessage::Status const char * c_text [static]
 

Show a status message.

Status messages will be written to the status field of the main window of a GUI application. In command line applications they are either discarded or written to cout. Note, that GUI's usually have only a one line status field which is overwritten with each status message. No effort is made that the user has a chance to read every message. Therefore, Status() should not be called to frequently. Use Info() for message which should be visible for a longer time and Warning() for message which should catch the attention of the user.

Definition at line 59 of file CTBmessage.cxx.

void CTBmessage::Info const char * c_text [static]
 

Show an informational message.

Informational messages will be written to a scrollable text widget in a separate dialog window in a GUI application and to cout in command line applications.

Definition at line 74 of file CTBmessage.cxx.

void CTBmessage::Warning const char * c_text [static]
 

Show an warning message.

Warning messages will be produce a `warning dialog box' in a GUI application and written to cout in command line applications.

Definition at line 88 of file CTBmessage.cxx.

CTBint CTBmessage::Error const char * c_text [static]
 

Show an error message.

Error messages will be produce an `error dialog box' in a GUI application and written to cout in command line applications.

Definition at line 102 of file CTBmessage.cxx.

void CTBmessage::Hook CTBmessageWriter * p_mw = 0 [static]
 

Setup the message writer.

Hook() installes the CTBmessageWriter object which provides the concrete implementation for rendering the messages. Usually Hook() is called once during the initialization of a main program like

    CTBmessage::Hook(new CTBmessageWriterQt);

In command line applications the call to Hook() can usually be omitted because all message write functions auto-hook to CTBmessageWriterStream if no hook was given before. Therefore, by default all messages will simply be written to stdout.

Definition at line 124 of file CTBmessage.cxx.

Referenced by Error(), Info(), Status(), and Warning().


Member Data Documentation

CTBmessageWriter * CTBmessage::mp_mw [static, private]
 

Definition at line 133 of file CTBmessage.cxx.


The documentation for this class was generated from the following files:
Generated at Fri Oct 24 18:13:56 2003 for CTBbase by doxygen1.2.9-20010812 written by Dimitri van Heesch, © 1997-2001