29 #ifndef TABLES_LOGGERHOLDER_H 30 #define TABLES_LOGGERHOLDER_H 33 #include <casacore/casa/aips.h> 34 #include <casacore/casa/Logging/LogIO.h> 35 #include <casacore/casa/Containers/Block.h> 36 #include <casacore/casa/Utilities/CountedPtr.h> 41 class LoggerHolderRep;
42 class LoggerHolderIterator;
202 const_iterator
begin()
const;
203 const_iterator
end()
const;
270 {
if (itsIsClosed) doReopen(); }
287 {
return itsIsClosed; }
308 {
return itsParents; }
324 const_iterator
begin()
const;
325 const_iterator
end()
const;
369 : itsSink(0), itsIndex(0) {}
372 : itsSink(sink), itsIndex(index) {}
375 : itsSink(that.itsSink), itsIndex(that.itsIndex) {}
386 {
return itsSink->getTime(itsIndex); }
388 {
return itsSink->getMessage(itsIndex); }
390 {
return itsSink->getPriority(itsIndex); }
392 {
return itsSink->getLocation(itsIndex); }
394 {
return itsSink->getObjectID(itsIndex); }
444 {
return *itsLogger; }
500 : itsIter(0), itsNotAtEnd(
False) {}
515 void operator++ (
int)
521 {
return itsNotAtEnd; }
526 {
return itsIter->getEntry(); }
528 {
return &(itsIter->getEntry()); }
532 {
return itsIter->logger(); }
537 { itsNotAtEnd = itsIter->next(); }
552 return itsRep->isTempClosed();
const LogHolderIterEntry & operator*() const
Get the entry.
Class representing an entry in a LoggerHolder.
void append(const LoggerHolder &other)
Append the entries of the other logger to this one.
CountedPtr< LoggerHolderRep > itsRep
LoggerHolderIterator const_iterator
Define the STL-style iterators.
Block< LoggerHolder > itsParents
void reopenRW()
Reopen a readonly logtable for read/write (if needed).
bool operator!=(const std11_allocator< T > &, const std11_allocator< T > &)
const LoggerHolder * itsLogger
void clear()
Clear the log.
const LoggerHolder & logger() const
LogHolderIterEntry(const LogSink *sink, uInt index)
const_iterator begin() const
Get the begin and end iterator object.
Double time() const
Get the message parts.
LoggerHolder & operator=(const LoggerHolder &)
Assignment (reference semantics).
const LoggerHolder & logger() const
Bool isTempClosed() const
Is the log table temporarily closed?
void removeParents()
Remove all parents.
ostream-like interface to creating log messages.
const Block< LoggerHolder > & parents() const
Return the block of parents.
void operator++()
Increment to next message.
const LogHolderIterEntry * operator->() const
LogHolderIterEntry(const LogHolderIterEntry &that)
LoggerHolder(Bool nullSink=False)
Create with a NullSink or MemoryLogSink (default).
Class doing the actual iteration through an LoggerHolder.
LogHolderIter * itsParentIter
void next()
Get the next entry (if available).
Save log messages in a Casacore Table.
Referenced counted pointer for constant data.
void resync()
Resync the log table (if needed).
const LogHolderIterEntry & getEntry() const
Get the entry.
void tempClose(Bool closeParents=True) const
Temporarily close all log tables.
Representation of the class holding a hierarchy of loggers.
TableLogSink * itsTablePtr
const Block< LoggerHolder > & parents() const
Return the block of parents.
void addParent(const LoggerHolder &)
Add a logger from a parent.
void reopen()
Reopen the log table if needed (after a tempClose).
bool Bool
Define the standard types used by Casacore.
LogIO & logio()
Get access to the logger.
LogHolderIterEntry itsEntry
Distribute LogMessages to their destination(s)
LogSink & sink()
Get access to the log sink (reopen the log table if needed).
void flush()
Flush the log table.
String: the storage and methods of handling collections of characters.
void unlock()
Unlock the log table.
Bool isTempClosed() const
Is the log table temporarily closed?
Class holding a hierarchy of loggers.
this file contains all the compiler specific defines
Class to iterate through an LoggerHolder.
const_iterator end() const
void reopen()
Reopen the log table if needed (after a tempClose).