TuttleOFX  1
ofxsUtilities.h
Go to the documentation of this file.
00001 #ifndef _ofxsUtilities_h_
00002 #define _ofxsUtilities_h_
00003 
00004 #include <iostream>
00005 
00006 #ifndef OFXS_NO_COUT
00007 /**
00008  * @param[in] ... : all parameters with an operator << defined
00009  * @brief terminal display
00010  **/
00011  #define OFXS_COUT(... )  ::std::cout << __VA_ARGS__ << ::std::endl
00012  #define OFXS_CERR(... )  ::std::cerr << __VA_ARGS__ << ::std::endl
00013 
00014  #define OFXS_COUT_X( N, ... ) \
00015     for( unsigned int i = 0; i < N; ++i ) { ::std::cout << __VA_ARGS__; } \
00016     ::std::cout << ::std::endl
00017 
00018 #else
00019  #define OFXS_COUT(...)
00020  #define OFXS_CERR(...)
00021  #define OFXS_COUT_X( N, ... )
00022 #endif
00023 
00024 /**
00025  * @def   TUTTLE_INFOS
00026  * @brief informations : filename, line number, function name
00027  **/
00028 #ifndef BOOST_EXCEPTION_DISABLE
00029  #define OFXS_INFOS  "file: " << __FILE__ << ",  line: " << __LINE__ << ::std::endl << "function: " << BOOST_CURRENT_FUNCTION
00030 #else
00031  #define OFXS_INFOS  "file: " << __FILE__ << ",  line: " << __LINE__ << ::std::endl
00032 #endif
00033 
00034 
00035 #define OFXS_COUT_WARNING(... )  \
00036   OFXS_CERR( "Warning:" << \
00037   ::std::endl << OFXS_INFOS << \
00038   ::std::endl << "\t" << __VA_ARGS__  )
00039 
00040 #define OFXS_COUT_ERROR(... )  \
00041   OFXS_CERR( "Error:" << \
00042   ::std::endl << OFXS_INFOS << \
00043   ::std::endl << "\t" << __VA_ARGS__  )
00044 /*
00045 #include <tuttle/common/utils/global.hpp>
00046 
00047 #ifndef OFXS_NO_COUT
00048 #ifdef OFXS_COUT
00049 #undef OFXS_COUT
00050 #endif
00051 #define OFXS_COUT(... ) ::std::cout << "[PLUGIN] " << __VA_ARGS__ << std::endl
00052 #ifdef OFXS_CERR
00053 #undef OFXS_CERR
00054 #endif
00055 #define OFXS_CERR(... ) ::std::cerr << "[PLUGIN] " << __VA_ARGS__ << std::endl
00056 #endif
00057 */
00058 #endif
00059