MDSTk Libraries  1.1.0
Medical Data Segmentation Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends
mds::base::CGlobalLog Class Reference

Global application log. More...

#include <mdsGlobalLog.h>

Inheritance diagram for mds::base::CGlobalLog:
Inheritance graph
[legend]

List of all members.

Public Types

enum  { CLASS_SINGLETON }
 Templates that require members of the CSingleton class can use this enum to check the existence. More...
enum  { LONGEVITY = L }
 Object longevity. More...
enum  { SIZE = 512 }
 Size of the buffer. More...
enum  { CLASS_OBJECT }
 Templates that require members of the CObject class can use this enum to check the existence. More...
enum  { HEAP_OBJECT = 0x70616568 }
 Signature used to recognize objects on the heap. More...
typedef CLibraryLockableClass
< CLog >::CLock 
tLock
 Lock type.

Public Member Functions

void disable ()
 Disables the logging.
void enable (bool bEnable=true)
 Enables/disables the logging.
int getReferencesCount () const
 Returns the number of references.
std::ostream & getStream ()
 Returns the output stream.
bool isOnHeap () const
 Returns true if the object is allocated on the heap.
 MDS_SHAREDPTR (CGlobalLog)
 Smart pointer type.
 MDS_SHAREDPTR (CLog)
 Smart pointer type.
virtual int overflow (int c=EOF)
 Implementation of virtual functions (std::streambuf).
void registerChannel (CLogChannel *pLogChannel)
 Registers a given output channel.
void removeAllChannels ()
 Removes all registered channels.
virtual int sync ()
virtual int underflow ()
void unregisterChannel (CLogChannel *pLogChannel)
 Unregisters a specified logging channel.
virtual ~CGlobalLog ()
 Virtual destructor.

Static Public Member Functions

static void lock ()
 Locks the object.
static void * operator new (std::size_t Size)
 Allocates a new object on the heap.
static void unlock ()
 Locks the object.

Protected Types

typedef std::set< CLogChannelPtrtChannels
 Set of all registered logging channels.

Protected Member Functions

void addReference () const
 Increase the reference counter.
bool delReference () const
 Decrease the reference counter.

Protected Attributes

bool m_bEnabled
 Flag used to disable/enable logging.
tChannels m_Channels
 Set of all registered logging channels.
int m_iHeapObject
 Flag initialized if the object is on the heap.
int m_iReferences
 The number of references to the object.
char m_pcBuffer [SIZE]
 Log buffer.
char * m_pcBufferEnd
 Pointer to the buffer end.
CScopedPtr< std::ostream > m_pStream
 Output stream.

Friends

class mds::base::CSingletonHolder< CGlobalLog >
 Allow main log instantiation using the singleton holder.

Detailed Description

Global application log.


Member Typedef Documentation

typedef std::set<CLogChannelPtr> mds::base::CLog::tChannels [protected, inherited]

Set of all registered logging channels.

Lock type.


Member Enumeration Documentation

template<int L>
anonymous enum [inherited]

Templates that require members of the CSingleton class can use this enum to check the existence.

Enumerator:
CLASS_SINGLETON 
template<int L>
anonymous enum [inherited]

Object longevity.

Enumerator:
LONGEVITY 
anonymous enum [inherited]

Size of the buffer.

Enumerator:
SIZE 
anonymous enum [inherited]

Templates that require members of the CObject class can use this enum to check the existence.

Enumerator:
CLASS_OBJECT 
anonymous enum [inherited]

Signature used to recognize objects on the heap.

Enumerator:
HEAP_OBJECT 

Constructor & Destructor Documentation

virtual mds::base::CGlobalLog::~CGlobalLog ( ) [virtual]

Virtual destructor.


Member Function Documentation

void mds::base::CObject::addReference ( ) const [protected, inherited]

Increase the reference counter.

bool mds::base::CObject::delReference ( ) const [protected, inherited]

Decrease the reference counter.

  • Returns true if the decremented number of references is lower or equal to zero and object must be deleted.
void mds::base::CLog::disable ( ) [inherited]

Disables the logging.

void mds::base::CLog::enable ( bool  bEnable = true) [inherited]

Enables/disables the logging.

Returns the number of references.

std::ostream& mds::base::CLog::getStream ( ) [inherited]

Returns the output stream.

bool mds::base::CObject::isOnHeap ( ) const [inherited]

Returns true if the object is allocated on the heap.

static void mds::base::CLockableClass< CLog >::lock ( ) [static, inherited]

Locks the object.

Smart pointer type.

  • Declares type tSmartPtr.

Smart pointer type.

  • Declares type tSmartPtr.
static void* mds::base::CObject::operator new ( std::size_t  Size) [static, inherited]

Allocates a new object on the heap.

int mds::base::CLog::overflow ( int  c = EOF) [virtual, inherited]

Implementation of virtual functions (std::streambuf).

void mds::base::CLog::registerChannel ( CLogChannel pLogChannel) [inherited]

Registers a given output channel.

void mds::base::CLog::removeAllChannels ( ) [inherited]

Removes all registered channels.

int mds::base::CLog::sync ( ) [virtual, inherited]
int mds::base::CLog::underflow ( ) [virtual, inherited]
static void mds::base::CLockableClass< CLog >::unlock ( ) [static, inherited]

Locks the object.

void mds::base::CLog::unregisterChannel ( CLogChannel pLogChannel) [inherited]

Unregisters a specified logging channel.


Friends And Related Function Documentation

friend class mds::base::CSingletonHolder< CGlobalLog > [friend]

Allow main log instantiation using the singleton holder.


Member Data Documentation

bool mds::base::CLog::m_bEnabled [protected, inherited]

Flag used to disable/enable logging.

tChannels mds::base::CLog::m_Channels [protected, inherited]

Set of all registered logging channels.

int mds::base::CObject::m_iHeapObject [mutable, protected, inherited]

Flag initialized if the object is on the heap.

int mds::base::CObject::m_iReferences [mutable, protected, inherited]

The number of references to the object.

  • Zero if there is no reference.
char mds::base::CLog::m_pcBuffer[SIZE] [protected, inherited]

Log buffer.

char* mds::base::CLog::m_pcBufferEnd [protected, inherited]

Pointer to the buffer end.

CScopedPtr<std::ostream> mds::base::CLog::m_pStream [protected, inherited]

Output stream.


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