casa
$Rev:20696$
|
Representation of the class holding a hierarchy of loggers. More...
#include <LoggerHolder.h>
Public Member Functions | |
LoggerHolderRep (Bool nullSink) | |
Create with a NullSink or MemoryLogSink (default). | |
LoggerHolderRep (const String &logTableName, Bool isWritable) | |
Create with a TableLogSink. | |
LoggerHolderRep (const LoggerHolderRep &) | |
Copy constructor. | |
~LoggerHolderRep () | |
LoggerHolderRep & | operator= (const LoggerHolderRep &) |
Assignment. | |
void | addParent (const LoggerHolder &) |
Add a logger from a parent. | |
void | append (const LoggerHolder &other) |
Append the entries of the other logger to this one. | |
void | reopenRW () |
Reopen a readonly logtable for read/write (if needed). | |
void | reopen () |
Reopen the log table if needed (after a tempClose). | |
void | tempClose (Bool closeParents=True) |
Temporarily close all log tables. | |
void | unlock () |
Unlock the log table. | |
void | flush () |
Flush the log table. | |
void | resync () |
Resync the log table (if needed). | |
Bool | isTempClosed () const |
Is the log table temporarily closed? | |
LogIO & | logio () |
Get access to the logger. | |
LogSink & | sink () |
Get access to the log sink (reopen the log table if needed). | |
void | clear () |
Clear the log. | |
void | removeParents () |
Remove all parents. | |
const Block< LoggerHolder > & | parents () const |
Return the block of parents. | |
Private Member Functions | |
void | doReopen () |
Do the actual reopen. | |
Private Attributes | |
Block< LoggerHolder > | itsParents |
LogSink | itsSink |
LogIO | itsLogger |
String | itsTableName |
TableLogSink * | itsTablePtr |
Bool | itsIsWritable |
Bool | itsIsClosed |
typedef LoggerHolderIterator | const_iterator |
Define the STL-style iterators. | |
const_iterator | begin () const |
Get the begin and end iterator object. | |
const_iterator | end () const |
Representation of the class holding a hierarchy of loggers.
Internal
The LoggerHolderRep class is the reference counted implementation of LoggerHolder . See that class for more information.
Reference counting was needed to be able to keep a LoggerHolder object after the (ImageInterface) object containing it is gone.
Definition at line 240 of file LoggerHolder.h.
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; }
Definition at line 322 of file LoggerHolder.h.
casa::LoggerHolderRep::LoggerHolderRep | ( | Bool | nullSink | ) |
Create with a NullSink or MemoryLogSink (default).
casa::LoggerHolderRep::LoggerHolderRep | ( | const String & | logTableName, |
Bool | isWritable | ||
) |
Create with a TableLogSink.
Copy constructor.
void casa::LoggerHolderRep::addParent | ( | const LoggerHolder & | ) |
Add a logger from a parent.
void casa::LoggerHolderRep::append | ( | const LoggerHolder & | other | ) |
Append the entries of the other logger to this one.
const_iterator casa::LoggerHolderRep::begin | ( | ) | const |
Get the begin and end iterator object.
void casa::LoggerHolderRep::clear | ( | ) |
Clear the log.
It removes the parents and removes all messages from the sink.
void casa::LoggerHolderRep::doReopen | ( | ) | [private] |
Do the actual reopen.
Referenced by reopen().
const_iterator casa::LoggerHolderRep::end | ( | ) | const |
void casa::LoggerHolderRep::flush | ( | ) |
Flush the log table.
Bool casa::LoggerHolderRep::isTempClosed | ( | ) | const [inline] |
Is the log table temporarily closed?
Definition at line 285 of file LoggerHolder.h.
References itsIsClosed.
Referenced by casa::LoggerHolder::isTempClosed().
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).
Referenced by casa::LoggerHolder::logio().
LoggerHolderRep& casa::LoggerHolderRep::operator= | ( | const LoggerHolderRep & | ) |
Assignment.
It removes the current parents.
const Block<LoggerHolder>& casa::LoggerHolderRep::parents | ( | ) | const [inline] |
Return the block of parents.
Definition at line 306 of file LoggerHolder.h.
References itsParents.
Referenced by casa::LoggerHolder::parents().
void casa::LoggerHolderRep::removeParents | ( | ) |
Remove all parents.
void casa::LoggerHolderRep::reopen | ( | ) | [inline] |
Reopen the log table if needed (after a tempClose).
Definition at line 268 of file LoggerHolder.h.
References doReopen(), and itsIsClosed.
Referenced by casa::LoggerHolder::reopen().
void casa::LoggerHolderRep::reopenRW | ( | ) |
Reopen a readonly logtable for read/write (if needed).
void casa::LoggerHolderRep::resync | ( | ) |
Resync the log table (if needed).
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.
Referenced by casa::LoggerHolder::sink().
void casa::LoggerHolderRep::tempClose | ( | Bool | closeParents = True | ) |
Temporarily close all log tables.
By default the possible parent log tables are also closed.
void casa::LoggerHolderRep::unlock | ( | ) |
Unlock the log table.
Bool casa::LoggerHolderRep::itsIsClosed [private] |
Definition at line 339 of file LoggerHolder.h.
Referenced by isTempClosed(), and reopen().
Bool casa::LoggerHolderRep::itsIsWritable [private] |
Definition at line 338 of file LoggerHolder.h.
LogIO casa::LoggerHolderRep::itsLogger [private] |
Definition at line 335 of file LoggerHolder.h.
Block<LoggerHolder> casa::LoggerHolderRep::itsParents [private] |
Definition at line 333 of file LoggerHolder.h.
Referenced by parents().
LogSink casa::LoggerHolderRep::itsSink [private] |
Definition at line 334 of file LoggerHolder.h.
String casa::LoggerHolderRep::itsTableName [private] |
Definition at line 336 of file LoggerHolder.h.
TableLogSink* casa::LoggerHolderRep::itsTablePtr [private] |
Definition at line 337 of file LoggerHolder.h.