/usr/include/salome/utilities.h is in salome-kernel-dev 6.5.0-7ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | // Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SALOME Utils : general SALOME's definitions and tools
// File : utilities.h
// Author : Antoine YESSAYAN, Paul RASCLE, EDF
// Module : SALOME
// $Header: /home/server/cvs/KERNEL/KERNEL_SRC/src/SALOMELocalTrace/utilities.h,v 1.8.2.1.10.2.12.1 2012-04-12 14:05:31 vsr Exp $
//
/* --- Definition macros file to print informations if _DEBUG_ is defined --- */
#ifndef UTILITIES_H
#define UTILITIES_H
#include <iostream>
#include <sstream>
#include <cstdlib>
#include "LocalTraceBufferPool.hxx"
/*!
* 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)
*/
#define MESS_INIT(deb) std::ostringstream os; os<<deb
#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());
// Macroses for messages with separated structure in c++ file in _DUBUG mode
#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());}
// --- Some macros are always defined (without _DEBUG_): for use with release version
#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}
#ifdef WIN32
#define IMMEDIATE_ABORT(code) {std::cout <<std::flush; \
std::cerr << "- ABORT " << __FILE__ << " [" <<__LINE__<< "] : " << std::flush; \
std::cerr << "ABORT return code= "<< code << std::endl; \
/*std::*/exit(code);}
#else
#define IMMEDIATE_ABORT(code) {std::cout <<std::flush; \
std::cerr << "- ABORT " << __FILE__ << " [" <<__LINE__<< "] : " << std::flush; \
std::cerr << "ABORT return code= "<< code << std::endl; \
std::exit(code);}
#endif
/* --- To print date and time of compilation of current source --- */
#if defined ( __GNUC__ )
#define COMPILER "g++"
#elif defined ( __sun )
#define COMPILER "CC"
#elif defined ( __KCC )
#define COMPILER "KCC"
#elif defined ( __PGI )
#define COMPILER "pgCC"
#elif defined ( __alpha )
#define COMPILER "cxx"
#else
#define COMPILER "undefined"
#endif
#ifdef INFOS_COMPILATION
#error INFOS_COMPILATION already defined
#endif
#if defined(_DEBUG_) || defined(_DEBUG)
// --- the following MACROS are useful at debug time
#define INFOS_COMPILATION { MESS_BEGIN("COMPILED with ") << COMPILER \
<< ", " << __DATE__ \
<< " at " << __TIME__ << MESS_END }
#define MESSAGE(msg) {MESS_BEGIN("- Trace ") << msg << MESS_END}
#define SCRUTE(var) {MESS_BEGIN("- Trace ") << #var << "=" << var <<MESS_END}
#define REPERE ("------- ")
#define BEGIN_OF(msg) {MESS_BEGIN(REPERE) << "Begin of: " << msg << MESS_END}
#define END_OF(msg) {MESS_BEGIN(REPERE) << "Normal end of: " << msg << MESS_END}
#ifndef ASSERT
#define ASSERT(condition) \
if (!(condition)){INTERRUPTION("CONDITION "<<#condition<<" NOT VERIFIED")}
#endif /* ASSERT */
#else /* ifdef _DEBUG_*/
#define INFOS_COMPILATION
#define MESSAGE(msg) {}
#define SCRUTE(var) {}
#define REPERE
#define BEGIN_OF(msg) {}
#define END_OF(msg) {}
#ifndef ASSERT
#define ASSERT(condition) {}
#endif /* ASSERT */
#endif /* ifdef _DEBUG_*/
#endif /* ifndef UTILITIES_H */
|