MemoryLogSink.h

Classes

MemoryLogSink -- Save log messages in memory. (full description)

class MemoryLogSink : public LogSinkInterface

Interface

Public Members
MemoryLogSink()
explicit MemoryLogSink (LogMessage::Priority filter)
explicit MemoryLogSink (const LogFilterInterface& filter)
MemoryLogSink (const MemoryLogSink& other)
MemoryLogSink& operator= (const MemoryLogSink& other)
virtual ~MemoryLogSink()
virtual uInt nelements() const
virtual Double getTime (uInt i) const
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)
virtual void writeLocally (Double time, const String& message, const String& priority, const String& location, const String& objectID)
virtual void clearLocally()
static String localId( )
String id( ) const
Private Members
void copy_other (const MemoryLogSink& other)
void resize (uInt nrnew)

Description

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25
Programs:
Demos:
Tests:

Prerequisite

Synopsis

This class posts messages which pass the filter to memory.

Example

See Logging.h.

Motivation

For temporary images log messages must be held in memory temporarily.

Member Description

MemoryLogSink()

Create an empty sink without a filter.

explicit MemoryLogSink (LogMessage::Priority filter)
explicit MemoryLogSink (const LogFilterInterface& filter)

Create an empty sink with the given filter.

MemoryLogSink (const MemoryLogSink& other)

Copy constructor (copy semantics).

MemoryLogSink& operator= (const MemoryLogSink& other)

Assignment (copy semantics).

virtual ~MemoryLogSink()

virtual uInt nelements() const

Get number of messages in sink.

virtual Double getTime (uInt i) const
virtual String getPriority (uInt i) const
virtual String getMessage (uInt i) const
virtual String getLocation (uInt i) const
virtual String getObjectID (uInt i) const

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

virtual Bool postLocally (const LogMessage& message)

If the message passes the filter, write it to memory

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. remove all messages from it).

static String localId( )

Returns the id for this class...

String id( ) const

Returns the id of the LogSink in use...

void copy_other (const MemoryLogSink& other)

Avoid duplicating code in copy ctor and assignment operator

void resize (uInt nrnew)

Rezize the blocks to the given size, but at least 64 elements more than the current size.