General KERNEL Documentation     End User KERNEL Services  


LocalTraceCollector Class Reference

See also other derived Classes in SALOMELocalTrace for usage without CORBA, see also derived Classes in SALOMETraceCollector for usage with CORBA.

#include <LocalTraceCollector.hxx>

Inheritance diagram for LocalTraceCollector:

Inheritance graph
Collaboration diagram for LocalTraceCollector:

Collaboration graph

Public Member Functions

 ~LocalTraceCollector ()

Static Public Member Functions

static BaseTraceCollectorinstance ()
static void * run (void *bid)

Protected Member Functions

 LocalTraceCollector ()

Static Protected Attributes

static int _threadToClose = 0
static BaseTraceCollector_singleton = 0
static pthread_mutex_t _singletonMutex = PTHREAD_MUTEX_INITIALIZER
static pthread_t * _threadId = 0
static sem_t _sem

Constructor & Destructor Documentation

LocalTraceCollector::~LocalTraceCollector  ) 
 

Destructor: wait until printing thread ends (LocalTraceCollector::run)

LocalTraceCollector::LocalTraceCollector  )  [protected]
 

Constructor: no need of LocalTraceBufferPool object initialization here, thread safe singleton used in LocalTraceBufferPool::instance()


Member Function Documentation

BaseTraceCollector * LocalTraceCollector::instance  )  [static]
 

This class is for use without CORBA, inside or outside SALOME. SALOME uses SALOMETraceCollector, to allow trace collection via CORBA. Type of trace (and corresponding class) is choosen in LocalTraceBufferPool.

Guarantees a unique object instance of the class (singleton thread safe) a separate thread for loop to print traces is launched.

void * LocalTraceCollector::run void *  bid  )  [static]
 

In a separate thread, loop to print traces. Mutex garantees intialisation on instance method is done and only one run allowed (double check ...) Loop until there is no more buffer to print, and no ask for end from destructor. Get a buffer. If type = ABORT then exit application with message.


Field Documentation

int BaseTraceCollector::_threadToClose = 0 [static, protected, inherited]
 

BaseTraceCollector * BaseTraceCollector::_singleton = 0 [static, protected, inherited]
 

pthread_mutex_t BaseTraceCollector::_singletonMutex = PTHREAD_MUTEX_INITIALIZER [static, protected, inherited]
 

pthread_t * BaseTraceCollector::_threadId = 0 [static, protected, inherited]
 

sem_t BaseTraceCollector::_sem [static, protected, inherited]