casacore
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members

Representation of the class holding a hierarchy of loggers. More...

#include <LoggerHolder.h>

Public Types

typedef LoggerHolderIterator const_iterator
 Define the STL-style iterators. More...
 

Public Member Functions

 LoggerHolderRep (Bool nullSink)
 Create with a NullSink or MemoryLogSink (default). More...
 
 LoggerHolderRep (const String &logTableName, Bool isWritable)
 Create with a TableLogSink. More...
 
 LoggerHolderRep (const LoggerHolderRep &)
 Copy constructor. More...
 
 ~LoggerHolderRep ()
 
LoggerHolderRepoperator= (const LoggerHolderRep &)
 Assignment. More...
 
void addParent (const LoggerHolder &)
 Add a logger from a parent. More...
 
void append (const LoggerHolder &other)
 Append the entries of the other logger to this one. More...
 
void reopenRW ()
 Reopen a readonly logtable for read/write (if needed). More...
 
void reopen ()
 Reopen the log table if needed (after a tempClose). More...
 
void tempClose (Bool closeParents=True)
 Temporarily close all log tables. More...
 
void unlock ()
 Unlock the log table. More...
 
void flush ()
 Flush the log table. More...
 
void resync ()
 Resync the log table (if needed). More...
 
Bool isTempClosed () const
 Is the log table temporarily closed? More...
 
LogIOlogio ()
 Get access to the logger. More...
 
LogSinksink ()
 Get access to the log sink (reopen the log table if needed). More...
 
void clear ()
 Clear the log. More...
 
void removeParents ()
 Remove all parents. More...
 
const Block< LoggerHolder > & parents () const
 Return the block of parents. More...
 
const_iterator begin () const
 Get the begin and end iterator object. More...
 
const_iterator end () const
 

Private Member Functions

void doReopen ()
 Do the actual reopen. More...
 

Private Attributes

Block< LoggerHolderitsParents
 
LogSink itsSink
 
LogIO itsLogger
 
String itsTableName
 
TableLogSinkitsTablePtr
 
Bool itsIsWritable
 
Bool itsIsClosed
 

Detailed Description

Representation of the class holding a hierarchy of loggers.

Intended use:

Internal

Review Status

Test programs:
tLoggerHolder

Prerequisite

Synopsis

The LoggerHolderRep class is the reference counted implementation of LoggerHolder. See that class for more information.

Motivation

Reference counting was needed to be able to keep a LoggerHolder object after the (ImageInterface) object containing it is gone.

Definition at line 241 of file LoggerHolder.h.

Member Typedef Documentation

◆ const_iterator

Define the STL-style iterators.

Only a const forward iterator is available. It makes it possible to iterate through all messages in the logger.

LoggerHolder logger("log.name", False)
for (LoggerHolder::const_iterator iter=arr.begin();
iter!=arr.end(); iter++) {
cout << iter.message() << endl;
}
LoggerHolderIterator const_iterator
Define the STL-style iterators.
Definition: LoggerHolder.h:201
const Bool False
Definition: aipstype.h:44


STL-style typedefs.

Definition at line 323 of file LoggerHolder.h.

Constructor & Destructor Documentation

◆ LoggerHolderRep() [1/3]

casacore::LoggerHolderRep::LoggerHolderRep ( Bool  nullSink)

Create with a NullSink or MemoryLogSink (default).

◆ LoggerHolderRep() [2/3]

casacore::LoggerHolderRep::LoggerHolderRep ( const String logTableName,
Bool  isWritable 
)

Create with a TableLogSink.

◆ LoggerHolderRep() [3/3]

casacore::LoggerHolderRep::LoggerHolderRep ( const LoggerHolderRep )

Copy constructor.

◆ ~LoggerHolderRep()

casacore::LoggerHolderRep::~LoggerHolderRep ( )

Member Function Documentation

◆ addParent()

void casacore::LoggerHolderRep::addParent ( const LoggerHolder )

Add a logger from a parent.

◆ append()

void casacore::LoggerHolderRep::append ( const LoggerHolder other)

Append the entries of the other logger to this one.

◆ begin()

const_iterator casacore::LoggerHolderRep::begin ( ) const

Get the begin and end iterator object.

◆ clear()

void casacore::LoggerHolderRep::clear ( )

Clear the log.

It removes the parents and removes all messages from the sink.

◆ doReopen()

void casacore::LoggerHolderRep::doReopen ( )
private

Do the actual reopen.

Referenced by reopen().

◆ end()

const_iterator casacore::LoggerHolderRep::end ( ) const

◆ flush()

void casacore::LoggerHolderRep::flush ( )

Flush the log table.

◆ isTempClosed()

Bool casacore::LoggerHolderRep::isTempClosed ( ) const
inline

Is the log table temporarily closed?

Definition at line 286 of file LoggerHolder.h.

References itsIsClosed.

◆ logio()

LogIO& casacore::LoggerHolderRep::logio ( )

Get access to the logger.

It assumes that it will be used to post a message, so it reopens the log table for read/write if needed).

◆ operator=()

LoggerHolderRep& casacore::LoggerHolderRep::operator= ( const LoggerHolderRep )

Assignment.

It removes the current parents.

◆ parents()

const Block<LoggerHolder>& casacore::LoggerHolderRep::parents ( ) const
inline

Return the block of parents.

Definition at line 307 of file LoggerHolder.h.

References itsParents.

◆ removeParents()

void casacore::LoggerHolderRep::removeParents ( )

Remove all parents.

◆ reopen()

void casacore::LoggerHolderRep::reopen ( )
inline

Reopen the log table if needed (after a tempClose).

Definition at line 269 of file LoggerHolder.h.

References doReopen(), and itsIsClosed.

◆ reopenRW()

void casacore::LoggerHolderRep::reopenRW ( )

Reopen a readonly logtable for read/write (if needed).

◆ resync()

void casacore::LoggerHolderRep::resync ( )

Resync the log table (if needed).

◆ sink()

LogSink& casacore::LoggerHolderRep::sink ( )

Get access to the log sink (reopen the log table if needed).

It is not assumed you want to write. If you want to do that, you should first call reopenRW() to ensure you can write.

◆ tempClose()

void casacore::LoggerHolderRep::tempClose ( Bool  closeParents = True)

Temporarily close all log tables.

By default the possible parent log tables are also closed.

◆ unlock()

void casacore::LoggerHolderRep::unlock ( )

Unlock the log table.

Member Data Documentation

◆ itsIsClosed

Bool casacore::LoggerHolderRep::itsIsClosed
private

Definition at line 340 of file LoggerHolder.h.

Referenced by isTempClosed(), and reopen().

◆ itsIsWritable

Bool casacore::LoggerHolderRep::itsIsWritable
private

Definition at line 339 of file LoggerHolder.h.

◆ itsLogger

LogIO casacore::LoggerHolderRep::itsLogger
private

Definition at line 336 of file LoggerHolder.h.

◆ itsParents

Block<LoggerHolder> casacore::LoggerHolderRep::itsParents
private

Definition at line 334 of file LoggerHolder.h.

Referenced by parents().

◆ itsSink

LogSink casacore::LoggerHolderRep::itsSink
private

Definition at line 335 of file LoggerHolder.h.

◆ itsTableName

String casacore::LoggerHolderRep::itsTableName
private

Definition at line 337 of file LoggerHolder.h.

◆ itsTablePtr

TableLogSink* casacore::LoggerHolderRep::itsTablePtr
private

Definition at line 338 of file LoggerHolder.h.


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