SALOME - SMESH
utilities.h File Reference
#include <iostream>
#include <sstream>
#include <cstdlib>
Include dependency graph for utilities.h:

Go to the source code of this file.

Macros

#define DEF_MSG_BUFFER   std::cout
 
#define MESS_INIT(deb)   std::ostringstream os; os<<deb
 
#define MESS_BEGIN(deb)   MESS_INIT(deb)<<__FILE__<<" ["<<__LINE__<<"] : "
 
#define MESS_END
 
#define MESS_ABORT
 
#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)   {MESS_BEGIN("MSG:") << msg << MESS_END}
 
#define SCRUTE(var)   {MESS_BEGIN("SCRUTE:") << #var << " = " << var << MESS_END}
 
#define REPERE   ("-------")
 
#define BEGIN_OF(msg)   {MESS_BEGIN("MSG BEGIN:") << msg << MESS_END}
 
#define END_OF(msg)   {MESS_BEGIN("MSG END:") << msg << MESS_END}
 
#define ASSERT(condition)   {}
 

Macro Definition Documentation

◆ DEF_MSG_BUFFER

#define DEF_MSG_BUFFER   std::cout

Definition at line 39 of file utilities.h.

◆ MESS_INIT

#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. This message is automatically passed to std::cout

Definition at line 47 of file utilities.h.

◆ MESS_BEGIN

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

Definition at line 48 of file utilities.h.

◆ MESS_END

#define MESS_END
Value:
std::endl; \
DEF_MSG_BUFFER << os.str() << std::endl;

Definition at line 50 of file utilities.h.

◆ MESS_ABORT

#define MESS_ABORT
Value:
std::endl; \
DEF_MSG_BUFFER << os.str() << std::endl;

Definition at line 53 of file utilities.h.

◆ INFOS

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

Definition at line 58 of file utilities.h.

◆ PYSCRIPT

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

Definition at line 59 of file utilities.h.

◆ INTERRUPTION

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

Definition at line 60 of file utilities.h.

◆ IMMEDIATE_ABORT

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

Definition at line 67 of file utilities.h.

◆ COMPILER

#define COMPILER   "undefined"

Definition at line 88 of file utilities.h.

◆ INFOS_COMPILATION

#define INFOS_COMPILATION

Definition at line 118 of file utilities.h.

◆ MESSAGE

#define MESSAGE (   msg)    {MESS_BEGIN("MSG:") << msg << MESS_END}

Definition at line 119 of file utilities.h.

◆ SCRUTE

#define SCRUTE (   var)    {MESS_BEGIN("SCRUTE:") << #var << " = " << var << MESS_END}

Definition at line 120 of file utilities.h.

◆ REPERE

#define REPERE   ("-------")

Definition at line 121 of file utilities.h.

◆ BEGIN_OF

#define BEGIN_OF (   msg)    {MESS_BEGIN("MSG BEGIN:") << msg << MESS_END}

Definition at line 122 of file utilities.h.

◆ END_OF

#define END_OF (   msg)    {MESS_BEGIN("MSG END:") << msg << MESS_END}

Definition at line 123 of file utilities.h.

◆ ASSERT

#define ASSERT (   condition)    {}

Definition at line 126 of file utilities.h.