Back to index

salome-kernel  6.5.0
Defines
utilities.h File Reference
#include <iostream>
#include <sstream>
#include <cstdlib>
#include "LocalTraceBufferPool.hxx"

Go to the source code of this file.

Defines

#define MESS_INIT(deb)   std::ostringstream os; os<<deb
 For each message to put in the trace, a specific ostingstream object is created and destroyed automatically at the end of the message macro.
#define MESS_BEGIN(deb)   MESS_INIT(deb)<<__FILE__ <<" ["<<__LINE__<<"] : "
#define MESS_END   std::endl; LocalTraceBufferPool::instance()->insert(NORMAL_MESS, os.str().c_str());
#define MESS_ABORT   std::endl; LocalTraceBufferPool::instance()->insert(ABORT_MESS, os.str().c_str());
#define MESSAGE_BEGIN(msg)   {std::ostringstream ss; ss <<__FILE__ <<" ["<<__LINE__<<"] : "<< msg; LocalTraceBufferPool::instance()->insert(NORMAL_MESS, ss.str().c_str());}
#define MESSAGE_ADD(msg)   {std::ostringstream ss; ss << msg; LocalTraceBufferPool::instance()->insert(NORMAL_MESS, ss.str().c_str());}
#define MESSAGE_END(msg)   {std::ostringstream ss; ss << msg << std::endl; LocalTraceBufferPool::instance()->insert(NORMAL_MESS, ss.str().c_str());}
#define INFOS(msg)   {MESS_BEGIN("- Trace ") << msg << MESS_END}
#define PYSCRIPT(msg)   {MESS_INIT("---PYSCRIPT--- ") << msg << MESS_END}
#define INTERRUPTION(msg)   {MESS_BEGIN("- INTERRUPTION: ")<< msg << MESS_ABORT}
#define IMMEDIATE_ABORT(code)
#define COMPILER   "undefined"
#define INFOS_COMPILATION
#define MESSAGE(msg)   {}
#define SCRUTE(var)   {}
#define REPERE
#define BEGIN_OF(msg)   {}
#define END_OF(msg)   {}
#define ASSERT(condition)   {}

Define Documentation

#define ASSERT (   condition)    {}

Definition at line 132 of file utilities.h.

#define BEGIN_OF (   msg)    {}

Definition at line 128 of file utilities.h.

#define COMPILER   "undefined"

Definition at line 94 of file utilities.h.

#define END_OF (   msg)    {}

Definition at line 129 of file utilities.h.

#define IMMEDIATE_ABORT (   code)
Value:
{std::cout <<std::flush; \
                               std::cerr << "- ABORT " << __FILE__ << " [" <<__LINE__<< "] : " << std::flush; \
                               std::cerr << "ABORT return code= "<< code << std::endl; \
                               std::exit(code);}

Definition at line 75 of file utilities.h.

#define INFOS (   msg)    {MESS_BEGIN("- Trace ") << msg << MESS_END}

Definition at line 65 of file utilities.h.

Definition at line 124 of file utilities.h.

#define INTERRUPTION (   msg)    {MESS_BEGIN("- INTERRUPTION: ")<< msg << MESS_ABORT}

Definition at line 67 of file utilities.h.

#define MESS_ABORT   std::endl; LocalTraceBufferPool::instance()->insert(ABORT_MESS, os.str().c_str());

Definition at line 56 of file utilities.h.

#define MESS_BEGIN (   deb)    MESS_INIT(deb)<<__FILE__ <<" ["<<__LINE__<<"] : "

Definition at line 54 of file utilities.h.

#define MESS_END   std::endl; LocalTraceBufferPool::instance()->insert(NORMAL_MESS, os.str().c_str());

Definition at line 55 of file utilities.h.

#define MESS_INIT (   deb)    std::ostringstream os; os<<deb

For each message to put in the trace, a specific ostingstream object is created and destroyed automatically at the end of the message macro.

The insert function of LocalTraceBufferPool class gets a buffer in a buffer pool (unique with the help of mutexes and semaphores) and copy the message in the buffer. This buffer is read later by a specific thread in charge of trace print. Order of trace entries is globally respected. Nevertheless, if there are several threads waiting for a free buffer to trace, the order of thread waken up is not garanteed (no fifo or priority rules in Linux Kernel)

Definition at line 53 of file utilities.h.

#define MESSAGE (   msg)    {}

Definition at line 125 of file utilities.h.

#define MESSAGE_ADD (   msg)    {std::ostringstream ss; ss << msg; LocalTraceBufferPool::instance()->insert(NORMAL_MESS, ss.str().c_str());}

Definition at line 60 of file utilities.h.

#define MESSAGE_BEGIN (   msg)    {std::ostringstream ss; ss <<__FILE__ <<" ["<<__LINE__<<"] : "<< msg; LocalTraceBufferPool::instance()->insert(NORMAL_MESS, ss.str().c_str());}

Definition at line 59 of file utilities.h.

#define MESSAGE_END (   msg)    {std::ostringstream ss; ss << msg << std::endl; LocalTraceBufferPool::instance()->insert(NORMAL_MESS, ss.str().c_str());}

Definition at line 61 of file utilities.h.

#define PYSCRIPT (   msg)    {MESS_INIT("---PYSCRIPT--- ") << msg << MESS_END}

Definition at line 66 of file utilities.h.

#define REPERE

Definition at line 127 of file utilities.h.

#define SCRUTE (   var)    {}

Definition at line 126 of file utilities.h.