Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.atnf.csiro.au/computing/software/casacore/casacore-1.2.0/doc/html/classcasa_1_1LogSinkInterface.html
Дата изменения: Unknown
Дата индексирования: Mon Feb 14 22:48:05 2011
Кодировка:

Поисковые слова: п п п п п п п п п п п п п п п п п р п р п
casacore: casa::LogSinkInterface Class Reference
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Attributes

casa::LogSinkInterface Class Reference
[Logging_module_internal_classes]

Accepts LogMessages and posts them to some destination. More...

#include <LogSinkInterface.h>

Inheritance diagram for casa::LogSinkInterface:
casa::LogSink casa::MemoryLogSink casa::NullLogSink casa::StreamLogSink casa::TableLogSink

List of all members.

Public Member Functions

 LogSinkInterface ()
 Create with a NORMAL filter.
 LogSinkInterface (const LogFilterInterface &filter)
 Create with the supplied filter.
 LogSinkInterface (const LogSinkInterface &other)
 Copy semantics - copy the filter from other to this
LogSinkInterfaceoperator= (const LogSinkInterface &)
virtual ~LogSinkInterface ()
virtual const LogFilterInterfacefilter () const
 Get/set the filter.
virtual LogSinkInterfacefilter (const LogFilterInterface &filter)
virtual uInt nelements () const
 Get number of messages in sink.
virtual Double getTime (uInt i) const
 Get given part of the i-th message from the sink.
virtual String getPriority (uInt i) const
virtual String getMessage (uInt i) const
virtual String getLocation (uInt i) const
virtual String getObjectID (uInt i) const
virtual Bool postLocally (const LogMessage &message)=0
 This function must be over-ridden in derived classes.
virtual void flush (Bool global=True)
 Write any pending output.
virtual void writeLocally (Double time, const String &message, const String &priority, const String &location, const String &objectID)
 Write a message (usually from another logsink) into the local one.
virtual void clearLocally ()
 Clear the local sink (i.e.
virtual String id () const =0
 Returns the id of the LogSink in use..\.
virtual void cerrToo (bool cerr2)
 Write to cerr too.
void setTaskName (const String &theTask)

Static Public Member Functions

static String localId ()
 Returns the id for this class..\.

Protected Attributes

String taskName

Private Attributes

LogFilterInterfacefilter_p

Detailed Description

Accepts LogMessages and posts them to some destination.

Intended use:

Internal

Review Status

Reviewed By:
wbrouw
Date Reviewed:
1996/08/21
Test programs:
tLogging
Demo programs:
dLogging

Prerequisite

Etymology

Log as in "Log Book." Sink from its common usage ("source/sink") as a thing which can accept some substance or energy. Interface because this is an abstract, not concrete, class.

Synopsis

This abstract base class is not intended for applications programmers. Instead they should look at LogSink .

This class defines a minimal "posting" interface for all objects which accept log messages. The fundamental model of a LogSinkInterface is:

  1. That it contains a LogFilterInterface that is used to accept or reject messages; and
  2. That it has a post message that takes a log message; and, if it passes the filter, does something with it (prints it to a stream, saves it to a table, ...).

There is no notion of local vs global sinks - that is imposed by LogSink.

Example

    LogSinkInterface &ref = ...;
    LogMessage message(...);
    ref.postLocally(message);
    if (ref.filter().lowestPriority() != LogMessage::DEBUGGING) {
       ref.filter(LogMessage::DEBUGGING);
    }

For a more complete example see (see (file="Logging.h"))Logging.h .

Motivation

Make it straightforward to extend the number of places a message may be in the future through derivation.

To Do

Definition at line 99 of file LogSinkInterface.h.


Constructor & Destructor Documentation

casa::LogSinkInterface::LogSinkInterface (  ) 

Create with a NORMAL filter.

casa::LogSinkInterface::LogSinkInterface ( const LogFilterInterface filter  ) 

Create with the supplied filter.

casa::LogSinkInterface::LogSinkInterface ( const LogSinkInterface other  ) 

Copy semantics - copy the filter from other to this

virtual casa::LogSinkInterface::~LogSinkInterface (  )  [virtual]

Member Function Documentation

virtual void casa::LogSinkInterface::cerrToo ( bool  cerr2  )  [virtual]

Write to cerr too.

virtual void casa::LogSinkInterface::clearLocally (  )  [virtual]

Clear the local sink (i.e.

remove all messages from it). The default implementation does nothing.

Reimplemented in casa::LogSink, casa::MemoryLogSink, and casa::TableLogSink.

virtual const LogFilterInterface& casa::LogSinkInterface::filter (  )  const [virtual]

Get/set the filter.

Reimplemented in casa::LogSink.

virtual LogSinkInterface& casa::LogSinkInterface::filter ( const LogFilterInterface filter  )  [virtual]

Reimplemented in casa::LogSink.

virtual void casa::LogSinkInterface::flush ( Bool  global = True  )  [virtual]

Write any pending output.

Reimplemented in casa::LogSink, casa::StreamLogSink, and casa::TableLogSink.

virtual String casa::LogSinkInterface::getLocation ( uInt  i  )  const [virtual]
virtual String casa::LogSinkInterface::getMessage ( uInt  i  )  const [virtual]
virtual String casa::LogSinkInterface::getObjectID ( uInt  i  )  const [virtual]
virtual String casa::LogSinkInterface::getPriority ( uInt  i  )  const [virtual]
virtual Double casa::LogSinkInterface::getTime ( uInt  i  )  const [virtual]

Get given part of the i-th message from the sink.

Reimplemented in casa::LogSink, casa::MemoryLogSink, and casa::TableLogSink.

virtual String casa::LogSinkInterface::id (  )  const [pure virtual]

Returns the id of the LogSink in use..\.

Implemented in casa::LogSink, casa::MemoryLogSink, casa::NullLogSink, casa::StreamLogSink, and casa::TableLogSink.

static String casa::LogSinkInterface::localId (  )  [static]

Returns the id for this class..\.

Reimplemented in casa::LogSink, casa::MemoryLogSink, casa::NullLogSink, casa::StreamLogSink, and casa::TableLogSink.

virtual uInt casa::LogSinkInterface::nelements (  )  const [virtual]

Get number of messages in sink.

Reimplemented in casa::LogSink, casa::MemoryLogSink, and casa::TableLogSink.

LogSinkInterface& casa::LogSinkInterface::operator= ( const LogSinkInterface  ) 
virtual Bool casa::LogSinkInterface::postLocally ( const LogMessage message  )  [pure virtual]

This function must be over-ridden in derived classes.

If the filter passes the message, do what is necessary with the message and return True.

Implemented in casa::LogSink, casa::MemoryLogSink, casa::NullLogSink, casa::StreamLogSink, and casa::TableLogSink.

void casa::LogSinkInterface::setTaskName ( const String theTask  )  [inline]

Definition at line 157 of file LogSinkInterface.h.

References taskName.

virtual void casa::LogSinkInterface::writeLocally ( Double  time,
const String message,
const String priority,
const String location,
const String objectID 
) [virtual]

Write a message (usually from another logsink) into the local one.

The default implementation does nothing.

Reimplemented in casa::LogSink, casa::MemoryLogSink, and casa::TableLogSink.


Member Data Documentation

Definition at line 161 of file LogSinkInterface.h.

Referenced by setTaskName().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines