Loading...
Searching...
No Matches
casacore::MemoryLogSink Class Reference
casa package (libcasa_casa) » Logging_module

More...

`#include <MemoryLogSink.h>`

## Public Member Functions

| MemoryLogSink ()
| Create an empty sink without a filter.
| MemoryLogSink (LogMessage::Priority filter)
| Create an empty sink with the given filter.
| MemoryLogSink (const LogFilterInterface &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
| 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)
| 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.
String | id () const
| Returns the id of the LogSink in use...
Public Member Functions inherited from casacore::LogSinkInterface
| 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.
LogSinkInterface & | operator= (const LogSinkInterface &)
virtual | ~LogSinkInterface ()
virtual const LogFilterInterface & | filter () const
| Get/set the filter.
virtual LogSinkInterface & | filter (const LogFilterInterface &filter)
virtual void | flush (Bool global=True)
| Write any pending output.
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...
Static Public Member Functions inherited from casacore::LogSinkInterface
static String | localId ()
| Returns the id for this class...

## Private Member Functions

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.

## Private Attributes

uInt | nmsg_p
Block< Double > | time_p
Block< String > | priority_p
Block< String > | message_p
Block< String > | location_p
Block< String > | objectID_p

## Additional Inherited Members

Protected Attributes inherited from casacore::LogSinkInterface
String | taskName

## Detailed Description

Save log messages in memory.

### Intended use:

Public interface

### Review Status

Reviewed By:
  UNKNOWN
Date Reviewed:
  before2004/08/25
Test programs:
  tLogging
Demo programs:
  dLogging

### Prerequisite

- LogSinkInterface

### Synopsis

This class posts messages which pass the filter to memory.

### Example

See (see (file="Logging.h"))Logging.h.

### Motivation

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

Definition at line 68 of file MemoryLogSink.h.

## Constructor & Destructor Documentation

## MemoryLogSink() [1/4]

casacore::MemoryLogSink::MemoryLogSink | ( |  | ) |

Create an empty sink without a filter.

Referenced by copy_other(), MemoryLogSink(), and operator=().

## MemoryLogSink() [2/4]

casacore::MemoryLogSink::MemoryLogSink | ( | LogMessage::Priority | filter | ) |

explicit

Create an empty sink with the given filter.

References casacore::LogSinkInterface::filter().

## MemoryLogSink() [3/4]

casacore::MemoryLogSink::MemoryLogSink | ( | const LogFilterInterface & | filter | ) |

explicit

References casacore::LogSinkInterface::filter().

## MemoryLogSink() [4/4]

casacore::MemoryLogSink::MemoryLogSink | ( | const MemoryLogSink & | other | ) |

Copy constructor (copy semantics).

References MemoryLogSink().

## ~MemoryLogSink()

virtual casacore::MemoryLogSink::~MemoryLogSink | ( |  | ) |

virtual

## Member Function Documentation

## clearLocally()

virtual void casacore::MemoryLogSink::clearLocally | ( |  | ) |

virtual

Clear the local sink (i.e.

remove all messages from it).

Reimplemented from casacore::LogSinkInterface.

## copy_other()

void casacore::MemoryLogSink::copy_other | ( | const MemoryLogSink & | other | ) |

private

Avoid duplicating code in copy ctor and assignment operator.

References MemoryLogSink().

## getLocation()

virtual String casacore::MemoryLogSink::getLocation | ( | uInt | i | ) | const

virtual

Reimplemented from casacore::LogSinkInterface.

## getMessage()

virtual String casacore::MemoryLogSink::getMessage | ( | uInt | i | ) | const

virtual

Reimplemented from casacore::LogSinkInterface.

## getObjectID()

virtual String casacore::MemoryLogSink::getObjectID | ( | uInt | i | ) | const

virtual

Reimplemented from casacore::LogSinkInterface.

## getPriority()

virtual String casacore::MemoryLogSink::getPriority | ( | uInt | i | ) | const

virtual

Reimplemented from casacore::LogSinkInterface.

## getTime()

virtual Double casacore::MemoryLogSink::getTime | ( | uInt | i | ) | const

virtual

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

Reimplemented from casacore::LogSinkInterface.

## id()

String casacore::MemoryLogSink::id | ( |  | ) | const

virtual

Returns the id of the LogSink in use...

Implements casacore::LogSinkInterface.

## localId()

String casacore::MemoryLogSink::localId | ( |  | ) |

static

Returns the id for this class...

## nelements()

virtual uInt casacore::MemoryLogSink::nelements | ( |  | ) | const

virtual

Get number of messages in sink.

Reimplemented from casacore::LogSinkInterface.

## operator=()

MemoryLogSink & casacore::MemoryLogSink::operator= | ( | const MemoryLogSink & | other | ) |

Assignment (copy semantics).

References MemoryLogSink().

## postLocally()

virtual Bool casacore::MemoryLogSink::postLocally | ( | const LogMessage & | message | ) |

virtual

If the message passes the filter, write it to memory.

Implements casacore::LogSinkInterface.

## resize()

void casacore::MemoryLogSink::resize | ( | uInt | nrnew | ) |

private

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

## writeLocally()

virtual void casacore::MemoryLogSink::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.

Reimplemented from casacore::LogSinkInterface.

References casacore::time().

## Member Data Documentation

## location_p

Block<String> casacore::MemoryLogSink::location_p

private

Definition at line 128 of file MemoryLogSink.h.

## message_p

Block<String> casacore::MemoryLogSink::message_p

private

Definition at line 127 of file MemoryLogSink.h.

## nmsg_p

uInt casacore::MemoryLogSink::nmsg_p

private

Definition at line 124 of file MemoryLogSink.h.

## objectID_p

Block<String> casacore::MemoryLogSink::objectID_p

private

Definition at line 129 of file MemoryLogSink.h.

## priority_p

Block<String> casacore::MemoryLogSink::priority_p

private

Definition at line 126 of file MemoryLogSink.h.

## time_p

Block<Double> casacore::MemoryLogSink::time_p

private

Definition at line 125 of file MemoryLogSink.h.

The documentation for this class was generated from the following file:

- casa/Logging/MemoryLogSink.h