casacore
Public Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::LoggerHolderIterator Class Reference

Class to iterate through an LoggerHolder. More...

#include <LoggerHolder.h>

Public Member Functions

 LoggerHolderIterator ()
 
 LoggerHolderIterator (const LoggerHolder *)
 
 LoggerHolderIterator (const LoggerHolderIterator &)
 
 ~LoggerHolderIterator ()
 
LoggerHolderIteratoroperator= (const LoggerHolderIterator &)
 
void operator++ ()
 Increment to next message. More...
 
void operator++ (int)
 
Bool operator!= (const LoggerHolderIterator &)
 Is the iterator not at the end yet? More...
 
const LogHolderIterEntryoperator* () const
 Get the entry. More...
 
const LogHolderIterEntryoperator-> () const
 
const LoggerHolderlogger () const
 

Private Member Functions

void next ()
 Get the next entry (if available). More...
 

Private Attributes

LogHolderIteritsIter
 
Bool itsNotAtEnd
 

Detailed Description

Class to iterate through an LoggerHolder.

Intended use:

Public interface

Review Status

Test programs:
tLoggerHolder

Prerequisite

Synopsis

This class makes it possible to iterate in the STL-style through all entries of an LoggerHolder object. If the logger has parent LoggerHolder objects, it first iterates through all parents (recursively) and finally through all entries in the LoggerHolder object itself.

Example

LoggerHolder logger ("tLoggerHolder_tmp.log", True);
logger.logio() << "test1" << LogIO::POST;
logger.logio() << "test2" << LogIO::POST;
iter != logger.end();
iter++) {
cout << iter->time() << ' ' << iter->message() << endl;
}
@ POST
Post the accumulated message.
Definition: LogIO.h:173
const LoggerHolder & logger() const
Definition: LoggerHolder.h:531
LogIO & logio()
Get access to the logger.
Definition: LoggerHolder.h:554
LoggerHolderIterator const_iterator
Define the STL-style iterators.
Definition: LoggerHolder.h:201
const_iterator begin() const
Get the begin and end iterator object.
Definition: LoggerHolder.h:570
const_iterator end() const
Definition: LoggerHolder.h:574
const Bool True
Definition: aipstype.h:43

Definition at line 496 of file LoggerHolder.h.

Constructor & Destructor Documentation

◆ LoggerHolderIterator() [1/3]

casacore::LoggerHolderIterator::LoggerHolderIterator ( )
inline

Definition at line 499 of file LoggerHolder.h.

◆ LoggerHolderIterator() [2/3]

casacore::LoggerHolderIterator::LoggerHolderIterator ( const LoggerHolder )

◆ LoggerHolderIterator() [3/3]

casacore::LoggerHolderIterator::LoggerHolderIterator ( const LoggerHolderIterator )

◆ ~LoggerHolderIterator()

casacore::LoggerHolderIterator::~LoggerHolderIterator ( )
inline

Definition at line 506 of file LoggerHolder.h.

References itsIter.

Member Function Documentation

◆ logger()

const LoggerHolder& casacore::LoggerHolderIterator::logger ( ) const
inline

Definition at line 531 of file LoggerHolder.h.

References itsIter, and casacore::LogHolderIter::logger().

◆ next()

void casacore::LoggerHolderIterator::next ( )
inlineprivate

Get the next entry (if available).

Definition at line 536 of file LoggerHolder.h.

References itsIter, itsNotAtEnd, and casacore::LogHolderIter::next().

Referenced by operator++().

◆ operator!=()

Bool casacore::LoggerHolderIterator::operator!= ( const LoggerHolderIterator )
inline

Is the iterator not at the end yet?

Definition at line 520 of file LoggerHolder.h.

References itsNotAtEnd.

◆ operator*()

const LogHolderIterEntry& casacore::LoggerHolderIterator::operator* ( ) const
inline

Get the entry.

Definition at line 525 of file LoggerHolder.h.

References casacore::LogHolderIter::getEntry(), and itsIter.

◆ operator++() [1/2]

void casacore::LoggerHolderIterator::operator++ ( )
inline

Increment to next message.

Definition at line 513 of file LoggerHolder.h.

References next().

◆ operator++() [2/2]

void casacore::LoggerHolderIterator::operator++ ( int  )
inline

Definition at line 515 of file LoggerHolder.h.

References next().

◆ operator->()

const LogHolderIterEntry* casacore::LoggerHolderIterator::operator-> ( ) const
inline

Definition at line 527 of file LoggerHolder.h.

References casacore::LogHolderIter::getEntry(), and itsIter.

◆ operator=()

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

Member Data Documentation

◆ itsIter

LogHolderIter* casacore::LoggerHolderIterator::itsIter
private

Definition at line 540 of file LoggerHolder.h.

Referenced by logger(), next(), operator*(), operator->(), and ~LoggerHolderIterator().

◆ itsNotAtEnd

Bool casacore::LoggerHolderIterator::itsNotAtEnd
private

Definition at line 541 of file LoggerHolder.h.

Referenced by next(), and operator!=().


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