OMK::TracerIdTmp Class Reference
[Trace module]

A class to activate temporarily an id. More...

#include <OMKTracer.h>

Collaboration diagram for OMK::TracerIdTmp:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TracerIdTmp (const char *id)
 ~TracerIdTmp ()

Private Attributes

bool _unregisterId
std::string _id

Detailed Description

A class to activate temporarily an id.

To activate the trace for an id temporarily, create an object of this type. When it will be destroyed the id will return like it was before the object was created.

        OMTRACEID( "myId", "will be displayed if the flag \"myId\" is registered" ) ;
        {
        OMK::TracerIdTmp tmp( "myId" ) ;
        OMTRACEID( "myId", "will be always displayed" ) ;
        } // Implicit call to the destructor of 'tmp'
        OMTRACEID( "myId", "will be displayed if the flag \"myId\" is registered" ) ;

Definition at line 141 of file OMKTracer.h.


Constructor & Destructor Documentation

TracerIdTmp::TracerIdTmp ( const char *  id  ) 

Definition at line 33 of file OMKTracer.cpp.

References _id, and _unregisterId.

00034 :
00035 _unregisterId( Singleton< Tracer >::getInstance().registerId( id ) )
00036 {
00037         if ( _unregisterId ) 
00038         {
00039                 _id = id ;
00040         }
00041 }

TracerIdTmp::~TracerIdTmp (  ) 

Definition at line 43 of file OMKTracer.cpp.

References _id, and _unregisterId.

00044 {
00045   if ( _unregisterId ) 
00046   {
00047           Singleton< Tracer >::getInstance().unregisterId( _id.c_str() ) ; 
00048   }
00049 }


Member Data Documentation

bool OMK::TracerIdTmp::_unregisterId [private]

Definition at line 147 of file OMKTracer.h.

Referenced by TracerIdTmp(), and ~TracerIdTmp().

std::string OMK::TracerIdTmp::_id [private]

Definition at line 148 of file OMKTracer.h.

Referenced by TracerIdTmp(), and ~TracerIdTmp().


logo OpenMask

Documentation generated on Mon Jun 9 11:46:03 2008

Generated with doxygen by Dimitri van Heesch ,   1997-2007