From 9e06f2096ca946c4a820d647e15bd3896cc9abcd Mon Sep 17 00:00:00 2001 From: Francois Bleibel <fbleibel@gmail.com> Date: Thu, 17 Jun 2010 17:05:43 +0900 Subject: [PATCH] Renamed exceptions, signals and debug to conform to new naming convention. --- include/CMakeLists.txt | 22 +- include/sot-core/sotAdditionalFunctions.h | 2 +- include/sot-core/sotConstraint.h | 4 +- include/sot-core/sotContiifstream.h | 88 -------- include/sot-core/sotDebug.h | 166 --------------- include/sot-core/sotExceptionAbstract.h | 147 ------------- include/sot-core/sotExceptionDynamic.h | 78 ------- include/sot-core/sotExceptionFactory.h | 79 ------- include/sot-core/sotExceptionFeature.h | 73 ------- include/sot-core/sotExceptionSignal.h | 79 ------- include/sot-core/sotExceptionTask.h | 75 ------- include/sot-core/sotExceptionTools.h | 75 ------- include/sot-core/sotExceptionTraces.h | 74 ------- include/sot-core/sotFactory.h | 2 +- include/sot-core/sotFeature1D.h | 2 +- include/sot-core/sotFeatureGeneric.h | 2 +- include/sot-core/sotFeatureJointLimits.h | 2 +- include/sot-core/sotFeatureLineDistance.h | 2 +- include/sot-core/sotFeaturePoint6d.h | 2 +- include/sot-core/sotFeaturePoint6dRelative.h | 2 +- include/sot-core/sotFeatureTask.h | 2 +- include/sot-core/sotFeatureVector3.h | 2 +- include/sot-core/sotFeatureVisualPoint.h | 2 +- include/sot-core/sotMultiBound.h | 2 +- include/sot-core/sotPool.h | 2 +- include/sot-core/sotSignalCast.h | 201 ------------------ include/sot-core/sotTask.h | 2 +- include/sot-core/sotTaskConti.h | 2 +- include/sot-core/sotTaskUnilateral.h | 2 +- src/CMakeLists.txt | 22 +- src/debug/sotContiifstream.cpp | 77 ------- src/debug/sotDebug.cpp | 86 -------- src/exception/sotExceptionAbstract.cpp | 128 ------------ src/exception/sotExceptionDynamic.cpp | 60 ------ src/exception/sotExceptionFactory.cpp | 69 ------- src/exception/sotExceptionFeature.cpp | 60 ------ src/exception/sotExceptionSignal.cpp | 60 ------ src/exception/sotExceptionTask.cpp | 60 ------ src/exception/sotExceptionTools.cpp | 60 ------ src/exception/sotExceptionTraces.cpp | 60 ------ src/factory/command/import.cpp | 4 +- src/factory/sotAdditionalFunctions.cpp | 2 +- src/factory/sotAdditionalFunctions.h | 2 +- src/factory/sotFactory.h | 2 +- src/factory/sotPool.h | 2 +- src/feature/sotFeature1D.cpp | 2 +- src/feature/sotFeatureGeneric.cpp | 2 +- src/feature/sotFeatureJointLimits.cpp | 2 +- src/feature/sotFeatureLineDistance.cpp | 2 +- src/feature/sotFeaturePoint6d.cpp | 2 +- src/feature/sotFeaturePoint6dRelative.cpp | 2 +- src/feature/sotFeatureTask.cpp | 2 +- src/feature/sotFeatureVector3.cpp | 2 +- src/feature/sotFeatureVisualPoint.cpp | 2 +- src/signal/sotSignalCast.cpp | 204 ------------------- src/task/sotGainAdaptative.cpp | 4 +- src/task/sotGainHyperbolic.cpp | 4 +- 57 files changed, 59 insertions(+), 2118 deletions(-) delete mode 100644 include/sot-core/sotContiifstream.h delete mode 100644 include/sot-core/sotDebug.h delete mode 100644 include/sot-core/sotExceptionAbstract.h delete mode 100644 include/sot-core/sotExceptionDynamic.h delete mode 100644 include/sot-core/sotExceptionFactory.h delete mode 100644 include/sot-core/sotExceptionFeature.h delete mode 100644 include/sot-core/sotExceptionSignal.h delete mode 100644 include/sot-core/sotExceptionTask.h delete mode 100644 include/sot-core/sotExceptionTools.h delete mode 100644 include/sot-core/sotExceptionTraces.h delete mode 100644 include/sot-core/sotSignalCast.h delete mode 100644 src/debug/sotContiifstream.cpp delete mode 100644 src/debug/sotDebug.cpp delete mode 100644 src/exception/sotExceptionAbstract.cpp delete mode 100644 src/exception/sotExceptionDynamic.cpp delete mode 100644 src/exception/sotExceptionFactory.cpp delete mode 100644 src/exception/sotExceptionFeature.cpp delete mode 100644 src/exception/sotExceptionSignal.cpp delete mode 100644 src/exception/sotExceptionTask.cpp delete mode 100644 src/exception/sotExceptionTools.cpp delete mode 100644 src/exception/sotExceptionTraces.cpp delete mode 100644 src/signal/sotSignalCast.cpp diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index c4f1ee94..895bc591 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -6,21 +6,21 @@ SET(${PROJECT_NAME}_HEADERS sot-core-api.h #debug -sotContiifstream.h -sotDebug.h +contiifstream.h +debug.h #exception -sotExceptionAbstract.h -sotExceptionDynamic.h -sotExceptionFactory.h -sotExceptionFeature.h -sotExceptionSignal.h -sotExceptionTask.h -sotExceptionTools.h -sotExceptionTraces.h +exception-abstract.h +exception-dynamic.h +exception-factory.h +exception-feature.h +exception-signal.h +exception-task.h +exception-tools.h +exception-traces.h #signal -sotSignalCast.h +signal-cast.h #matrix sotBinaryOp.h diff --git a/include/sot-core/sotAdditionalFunctions.h b/include/sot-core/sotAdditionalFunctions.h index d7b2f81b..67906fdb 100644 --- a/include/sot-core/sotAdditionalFunctions.h +++ b/include/sot-core/sotAdditionalFunctions.h @@ -19,7 +19,7 @@ /* SOT */ #include <dynamic-graph/signal-base.h> -#include <sot-core/sotExceptionFactory.h> +#include <sot-core/exception-factory.h> #include <dynamic-graph/pool.h> #include <sot-core/sot-core-api.h> diff --git a/include/sot-core/sotConstraint.h b/include/sot-core/sotConstraint.h index 0c76c42c..5df4447f 100644 --- a/include/sot-core/sotConstraint.h +++ b/include/sot-core/sotConstraint.h @@ -38,8 +38,8 @@ namespace ml = maal::boost; #include <sot-core/sotFlags.h> #include <sot-core/sotTaskAbstract.h> #include <dynamic-graph/all-signals.h> -#include <sot-core/sotExceptionTask.h> -#include <sot-core/sotExceptionSignal.h> +#include <sot-core/exception-task.h> +#include <sot-core/exception-signal.h> /* --------------------------------------------------------------------- */ /* --- API ------------------------------------------------------------- */ diff --git a/include/sot-core/sotContiifstream.h b/include/sot-core/sotContiifstream.h deleted file mode 100644 index f4f8fd65..00000000 --- a/include/sot-core/sotContiifstream.h +++ /dev/null @@ -1,88 +0,0 @@ -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Copyright Projet JRL-Japan, 2007 - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * - * File: sotContiifstream.h - * Project: SOT - * Author: Nicolas Mansard - * - * Version control - * =============== - * - * $Id$ - * - * Description - * ============ - * - * - * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - - -#ifndef __SOT_CONTIIFSTREAM_HH__ -#define __SOT_CONTIIFSTREAM_HH__ - -/* --------------------------------------------------------------------- */ -/* --- INCLUDE --------------------------------------------------------- */ -/* --------------------------------------------------------------------- */ - - -#include <iostream> -#include <fstream> -#include <sstream> -#ifndef WIN32 -#include <unistd.h> -#endif -#include <list> - -#include <dynamic-graph/interpreter.h> -#ifndef WIN32 -#include <pthread.h> -#endif -/* --------------------------------------------------------------------- */ -/* --- API ------------------------------------------------------------- */ -/* --------------------------------------------------------------------- */ - -#if defined (WIN32) -# if defined (sotContiifstream_EXPORTS) -# define SOTCONTIIFSTREAM_EXPORT __declspec(dllexport) -# else -# define SOTCONTIIFSTREAM_EXPORT __declspec(dllimport) -# endif -#else -# define SOTCONTIIFSTREAM_EXPORT -#endif -/* --------------------------------------------------------------------- */ -/* --- CLASS ----------------------------------------------------------- */ -/* --------------------------------------------------------------------- */ -class SOTCONTIIFSTREAM_EXPORT sotContiifstream -{ -protected: - std::string filename; - unsigned int cursor; - static const unsigned int BUFFER_SIZE = 256; - char buffer[BUFFER_SIZE]; - std::list< std::string > reader; - bool first; - -public: /* --- Constructor --- */ - sotContiifstream( const std::string& n="" ); - ~sotContiifstream( void ); - void open( const std::string& n ) { filename=n; cursor=0; } - -public: /* --- READ FILE --- */ - bool loop( void ); - -public: /* --- READ LIST --- */ - inline bool ready( void ) { return 0<reader.size();} - std::string next( void ) ; - - -}; - - -#endif /* #ifndef __SOT_CONTIIFSTREAM_HH__ */ - - - - diff --git a/include/sot-core/sotDebug.h b/include/sot-core/sotDebug.h deleted file mode 100644 index 40815fad..00000000 --- a/include/sot-core/sotDebug.h +++ /dev/null @@ -1,166 +0,0 @@ -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Copyright Projet Lagadic, 2005 - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * - * File: sotDebug.h - * Project: STack of Tasks - * Author: Nicolas Mansard - * - * Version control - * =============== - * - * $Id$ - * - * Description - * ============ - * - * Macro de trace et de debugage - * - * - TRACAGE: TRACE et ERROR_TRACE fonctionnent comme des printf - * avec retour chariot en fin de fonction. - * CERROR et CTRACE fonctionnent comme les flux de sortie - * C++ cout et cerr. - * - DEBUGAGE: DEBUG_TRACE(niv, et DERROR_TRACE(niv, fonctionnent - * comme des printf, n'imprimant que si le niveau de trace 'niv' est - * superieur au mode de debugage VP_DEBUG_MODE. - * CDEBUG(niv) fonctionne comme le flux de sortie C++ cout. - * DEBUG_ENABLE(niv) vaut 1 ssi le niveau de tracage 'niv' - * est superieur au mode de debugage DEBUG_MODE. Il vaut 0 sinon. - * - PROG DEFENSIVE: DEFENSIF(a) vaut a ssi le mode defensif est active, - * et vaut 0 sinon. - * - * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - - - -#ifndef __VS_DEBUG_HH -#define __VS_DEBUG_HH - -#include <stdio.h> -#include <iostream> -#include <fstream> -#include <sstream> -#include <stdarg.h> -#include <sot-core/sot-core-api.h> - - -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ - -/* -------------------------------------------------------------------------- */ - -#ifndef VP_DEBUG_MODE -#define VP_DEBUG_MODE 0 -#endif -#ifndef VP_TEMPLATE_DEBUG_MODE -#define VP_TEMPLATE_DEBUG_MODE 0 -#endif - -#define SOT_COMMON_TRACES do { \ - va_list arg; \ - va_start(arg,format); \ - vsnprintf( charbuffer,SIZE,format,arg ); \ - va_end(arg); \ - outputbuffer << tmpbuffer.str() << charbuffer <<std::endl; \ - } while(0) - -class SOT_CORE_EXPORT sotDebugTrace -{ - public: - static const int SIZE = 512; - - std::stringstream tmpbuffer; - std::ostream& outputbuffer; - char charbuffer[SIZE+1]; - int traceLevel; - int traceLevelTemplate; - - sotDebugTrace( std::ostream& os ): outputbuffer(os) {} - - inline void trace( const int level,const char* format,...) - { if( level<=traceLevel ) SOT_COMMON_TRACES; tmpbuffer.str(""); } - inline void trace( const char* format,...){ SOT_COMMON_TRACES; tmpbuffer.str(""); } - inline void trace( const int level=-1 ) - { if( level<=traceLevel ) outputbuffer << tmpbuffer.str(); tmpbuffer.str(""); } - - inline void traceTemplate( const int level,const char* format,...) - { if( level<=traceLevelTemplate ) SOT_COMMON_TRACES; tmpbuffer.str(""); } - inline void traceTemplate( const char* format,...) - { SOT_COMMON_TRACES; tmpbuffer.str(""); } - - inline sotDebugTrace& pre( const std::ostream& dummy ) { return *this; } - inline sotDebugTrace& pre( const std::ostream& dummy,int level ) - { traceLevel = level; return *this; } -/* inline sotDebugTrace& preTemplate( const std::ostream& dummy,int level ) */ -/* { traceLevelTemplate = level; return *this; } */ - - - static const char * DEBUG_FILENAME_DEFAULT; - static void openFile( const char * filename = DEBUG_FILENAME_DEFAULT ); - static void closeFile( const char * filename = DEBUG_FILENAME_DEFAULT ); - -}; - - -SOT_CORE_EXPORT extern sotDebugTrace sotDEBUGFLOW; -SOT_CORE_EXPORT extern sotDebugTrace sotERRORFLOW; - -#ifdef VP_DEBUG -#define sotPREDEBUG __FILE__ << ": " <<__FUNCTION__ \ - << "(#" << __LINE__ << ") :" -#define sotPREERROR "\t!! "<<__FILE__ << ": " <<__FUNCTION__ \ - << "(#" << __LINE__ << ") :" - -# define sotDEBUG(level) if( (level>VP_DEBUG_MODE)||(!sotDEBUGFLOW.outputbuffer.good()) ) ;\ - else sotDEBUGFLOW.outputbuffer << sotPREDEBUG -# define sotDEBUGMUTE(level) if( (level>VP_DEBUG_MODE)||(!sotDEBUGFLOW.outputbuffer.good()) ) ;\ - else sotDEBUGFLOW.outputbuffer -# define sotERROR if(!sotDEBUGFLOW.outputbuffer.good()); else sotERRORFLOW.outputbuffer << sotPREERROR -# define sotDEBUGF if(!sotDEBUGFLOW.outputbuffer.good()); else sotDEBUGFLOW.pre(sotDEBUGFLOW.tmpbuffer<<sotPREDEBUG,VP_DEBUG_MODE).trace -# define sotERRORF if(!sotDEBUGFLOW.outputbuffer.good()); else sotERRORFLOW.pre(sotERRORFLOW.tmpbuffer<<sotPREERROR).trace -// TEMPLATE -# define sotTDEBUG(level) if( (level>VP_TEMPLATE_DEBUG_MODE)||(!sotDEBUGFLOW.outputbuffer.good()) ) ;\ - else sotDEBUGFLOW.outputbuffer << sotPREDEBUG -# define sotTDEBUGF if(!sotDEBUGFLOW.outputbuffer.good()); else sotDEBUGFLOW.pre(sotDEBUGFLOW.tmpbuffer<<sotPREDEBUG,VP_TEMPLATE_DEBUG_MODE).trace -inline bool sotDEBUG_ENABLE( const int & level ) { return level<=VP_DEBUG_MODE; } -inline bool sotTDEBUG_ENABLE( const int & level ) { return level<=VP_TEMPLATE_DEBUG_MODE; } - -/* -------------------------------------------------------------------------- */ -#else // #ifdef VP_DEBUG -#define sotPREERROR "\t!! "<<__FILE__ << ": " <<__FUNCTION__ \ - << "(#" << __LINE__ << ") :" -# define sotDEBUG(level) if( 1 ) ; else std::cout -# define sotDEBUGMUTE(level) if( 1 ) ; else std::cout -# define sotERROR sotERRORFLOW.outputbuffer << sotPREERROR -inline void sotDEBUGF( const int level,const char* format,...) { return; } -inline void sotDEBUGF( const char* format,...) { return; } -inline void sotERRORF( const int level,const char* format,...) { return; } -inline void sotERRORF( const char* format,...) { return; } -// TEMPLATE -# define sotTDEBUG(level) if( 1 ) ; else std::cout -inline void sotTDEBUGF( const int level,const char* format,...) { return; } -inline void sotTDEBUGF( const char* format,...) { return; } -#define sotDEBUG_ENABLE(level) false -#define sotTDEBUG_ENABLE(level) false - -#endif // #ifdef VP_DEBUG -/* -------------------------------------------------------------------------- */ - -#define sotDEBUGIN(level) sotDEBUG(level) << "# In {" << std::endl -#define sotDEBUGOUT(level) sotDEBUG(level) << "# Out }" << std::endl -#define sotDEBUGINOUT(level) sotDEBUG(level) << "# In/Out { }" << std::endl - -#define sotTDEBUGIN(level) sotTDEBUG(level) << "# In {" << std::endl -#define sotTDEBUGOUT(level) sotTDEBUG(level) << "# Out }" << std::endl -#define sotTDEBUGINOUT(level) sotTDEBUG(level) << "# In/Out { }" << std::endl - - -#endif /* #ifdef __VS_DEBUG_HH */ - -/* - * Local variables: - * c-basic-offset: 4 - * End: - */ diff --git a/include/sot-core/sotExceptionAbstract.h b/include/sot-core/sotExceptionAbstract.h deleted file mode 100644 index 48d8b5d9..00000000 --- a/include/sot-core/sotExceptionAbstract.h +++ /dev/null @@ -1,147 +0,0 @@ -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Copyright Projet JRL-Japan, 2007 - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * - * File: sotExceptionAbstract.h - * Project: SOT - * Author: Nicolas Mansard - * - * Version control - * =============== - * - * $Id$ - * - * Description - * ============ - * - * - * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -#ifndef __SOT_ABSTRACT_EXCEPTION_H -#define __SOT_ABSTRACT_EXCEPTION_H - -/* --------------------------------------------------------------------- */ -/* --- INCLUDE --------------------------------------------------------- */ -/* --------------------------------------------------------------------- */ - - -/* Classes standards. */ -#include <iostream> /* Classe ostream. */ -#include <string> /* Classe string. */ -#include <sot-core/sot-core-api.h> - -// Uncomment this macros to have lines parameter on the throw display -// #define SOT_EXCEPTION_PASSING_PARAM - -/* --------------------------------------------------------------------- */ -/* --- CLASS ----------------------------------------------------------- */ -/* --------------------------------------------------------------------- */ - - -/* \class sotExceptionAbstract - */ -class SOT_CORE_EXPORT sotExceptionAbstract -{ - - public: - - enum ExceptionEnum - { - ABSTRACT = 0 - ,SIGNAL = 100 - ,TASK = 200 - ,FEATURE = 300 - ,FACTORY = 400 - ,DYNAMIC = 500 - ,TRACES = 600 - ,TOOLS = 700 - ,PATTERN_GENERATOR= 800 - }; - - static const std::string EXCEPTION_NAME; - virtual const std::string& getExceptionName( void ) const { return EXCEPTION_NAME; } - - protected: - /** Error code. - * \sa ErrorCodeEnum */ - int code; - - /** Error message (can be empty). */ - std::string message; - -private: - - /** forbid the empty constructor (private). */ - sotExceptionAbstract( void ); -public: - - sotExceptionAbstract( const int& code, const std::string & msg = "" ); - virtual ~sotExceptionAbstract( void ){} - - /** Access to the error code. */ - int getCode (void); - - /** Reference access to the error message (can be empty). */ - const std::string &getStringMessage (void); - - /** Access to the pointer on the array of \e char related to the error string. - * Cannot be \e NULL. - */ - const char *getMessage (void); - - - /** Print the error structure. */ - SOT_CORE_EXPORT friend std::ostream & operator << (std::ostream & os, - const sotExceptionAbstract & err); - -#ifdef SOT_EXCEPTION_PASSING_PARAM - public: - class Param - { - public: - static const int BUFFER_SIZE = 80; - - const char * functionPTR; - char function[ BUFFER_SIZE ]; - int line; - const char * filePTR; - char file[ BUFFER_SIZE ]; - bool pointersSet,set; - public: - Param( const int& _line, const char * _function, const char * _file ); - Param( void ) : pointersSet(false),set(false) {} - Param& initCopy( const Param& p ); - - }; - - protected: - mutable Param p; - - template<class Exc> - friend const Exc& operator+ ( const sotExceptionAbstract::Param& p, const Exc& e ) - { e.p.initCopy(p); return e; } - template<class Exc> - friend Exc& operator+ ( const sotExceptionAbstract::Param& p, Exc& e ) - { e.p.initCopy(p); return e; } -#endif //#ifdef SOT_EXCEPTION_PASSING_PARAM -}; - -#define SOT_RETHROW ( const sotExceptionAbstract& err ) { throw err; } - - - -#ifdef SOT_EXCEPTION_PASSING_PARAM -# define SOT_THROW throw sotExceptionAbstract::Param(__LINE__,__FUNCTION__,__FILE__) + -#else //#ifdef SOT_EXCEPTION_PASSING_PARAM -# define SOT_THROW throw -#endif //#ifdef SOT_EXCEPTION_PASSING_PARAM - - -#endif /* #ifndef __SOT_ABSTRACT_EXCEPTION_H */ - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/include/sot-core/sotExceptionDynamic.h b/include/sot-core/sotExceptionDynamic.h deleted file mode 100644 index f746b6c4..00000000 --- a/include/sot-core/sotExceptionDynamic.h +++ /dev/null @@ -1,78 +0,0 @@ -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Copyright Projet JRL-Japan, 2007 - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * - * File: sotExceptionDynamic.h - * Project: SOT - * Author: Nicolas Mansard - * - * Version control - * =============== - * - * $Id$ - * - * Description - * ============ - * - * - * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -#ifndef __SOT_DYNAMIC_EXCEPTION_H -#define __SOT_DYNAMIC_EXCEPTION_H - -/* --------------------------------------------------------------------- */ -/* --- INCLUDE --------------------------------------------------------- */ -/* --------------------------------------------------------------------- */ - - -#include <sot-core/sotExceptionAbstract.h> -#include <sot-core/sot-core-api.h> -/* --------------------------------------------------------------------- */ -/* --- CLASS ----------------------------------------------------------- */ -/* --------------------------------------------------------------------- */ - - -/* \class sotExceptionDynamic - */ -class SOT_CORE_EXPORT sotExceptionDynamic -:public sotExceptionAbstract - -{ - public: - enum ErrorCodeEnum - { - GENERIC = sotExceptionAbstract::DYNAMIC - - ,CANT_DESTROY_SIGNAL - ,JOINT_RANK - ,DYNAMIC_JRL - ,JOINT_SIZE - ,INTEGRATION - }; - - static const std::string EXCEPTION_NAME; - virtual const std::string& getExceptionName( void ) const { return EXCEPTION_NAME; } - -public: - - sotExceptionDynamic ( const sotExceptionDynamic::ErrorCodeEnum& errcode, - const std::string & msg = "" ); - sotExceptionDynamic( const sotExceptionDynamic::ErrorCodeEnum& errcode, - const std::string & msg,const char* format, ... ); - virtual ~sotExceptionDynamic( void ){} - - -}; - - - - - -#endif /* #ifndef __SOT_DYNAMIC_EXCEPTION_H */ - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/include/sot-core/sotExceptionFactory.h b/include/sot-core/sotExceptionFactory.h deleted file mode 100644 index 20abeacf..00000000 --- a/include/sot-core/sotExceptionFactory.h +++ /dev/null @@ -1,79 +0,0 @@ -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Copyright Projet JRL-Japan, 2007 - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * - * File: sotExceptionFactory.h - * Project: SOT - * Author: Nicolas Mansard - * - * Version control - * =============== - * - * $Id$ - * - * Description - * ============ - * - * - * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -#ifndef __SOT_EXCEPTION_FACTORY_H -#define __SOT_EXCEPTION_FACTORY_H - -/* --------------------------------------------------------------------- */ -/* --- INCLUDE --------------------------------------------------------- */ -/* --------------------------------------------------------------------- */ - - -#include <sot-core/sotExceptionAbstract.h> -#include <sot-core/sot-core-api.h> -/* --------------------------------------------------------------------- */ -/* --- CLASS ----------------------------------------------------------- */ -/* --------------------------------------------------------------------- */ - - -/* \class sotExceptionFactory - */ -class SOT_CORE_EXPORT sotExceptionFactory -:public sotExceptionAbstract - -{ -public: - - enum ErrorCodeEnum - { - GENERIC = sotExceptionAbstract::FACTORY - ,UNREFERED_OBJECT - ,UNREFERED_SIGNAL - ,UNREFERED_FUNCTION - ,DYNAMIC_LOADING - ,SIGNAL_CONFLICT - ,FUNCTION_CONFLICT - ,OBJECT_CONFLICT - ,SYNTAX_ERROR // j' aime bien FATAL_ERROR aussi faut que je la case qq part... - ,READ_FILE - }; - - static const std::string EXCEPTION_NAME; - virtual const std::string& getExceptionName( void )const{ return sotExceptionFactory::EXCEPTION_NAME; } - - sotExceptionFactory ( const sotExceptionFactory::ErrorCodeEnum& errcode, - const std::string & msg = "" ); - sotExceptionFactory ( const sotExceptionFactory::ErrorCodeEnum& errcode, - const std::string & msg,const char* format, ... ); - virtual ~sotExceptionFactory( void ){} - -}; - - - - - -#endif /* #ifndef __SOT_EXCEPTION_FACTORY_H */ - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/include/sot-core/sotExceptionFeature.h b/include/sot-core/sotExceptionFeature.h deleted file mode 100644 index 5d814619..00000000 --- a/include/sot-core/sotExceptionFeature.h +++ /dev/null @@ -1,73 +0,0 @@ -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Copyright Projet JRL-Japan, 2007 - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * - * File: sotExceptionFeature.h - * Project: SOT - * Author: Nicolas Mansard - * - * Version control - * =============== - * - * $Id$ - * - * Description - * ============ - * - * - * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -#ifndef __SOT_EXCEPTION_FEATURE_H -#define __SOT_EXCEPTION_FEATURE_H - -/* --------------------------------------------------------------------- */ -/* --- INCLUDE --------------------------------------------------------- */ -/* --------------------------------------------------------------------- */ - - -#include <sot-core/sotExceptionAbstract.h> -#include <sot-core/sot-core-api.h> -/* --------------------------------------------------------------------- */ -/* --- CLASS ----------------------------------------------------------- */ -/* --------------------------------------------------------------------- */ - - -/* \class sotExceptionFeature - */ -class SOT_CORE_EXPORT sotExceptionFeature -:public sotExceptionAbstract - -{ -public: - - enum ErrorCodeEnum - { - GENERIC = sotExceptionAbstract::FEATURE - ,BAD_INIT - ,UNCOMPATIBLE_SIZE - }; - - static const std::string EXCEPTION_NAME; - virtual const std::string& getExceptionName( void ) const { return sotExceptionFeature::EXCEPTION_NAME; } - - sotExceptionFeature ( const sotExceptionFeature::ErrorCodeEnum& errcode, - const std::string & msg = "" ); - - sotExceptionFeature ( const sotExceptionFeature::ErrorCodeEnum& errcode, - const std::string & msg,const char* format, ... ); - - virtual ~sotExceptionFeature( void ){} -}; - - - - - -#endif /* #ifndef __SOT_EXCEPTION_FEATURE_H */ - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/include/sot-core/sotExceptionSignal.h b/include/sot-core/sotExceptionSignal.h deleted file mode 100644 index c22eaacf..00000000 --- a/include/sot-core/sotExceptionSignal.h +++ /dev/null @@ -1,79 +0,0 @@ -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Copyright Projet JRL-Japan, 2007 - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * - * File: sotExceptionSignal.h - * Project: SOT - * Author: Nicolas Mansard - * - * Version control - * =============== - * - * $Id$ - * - * Description - * ============ - * - * - * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -#ifndef __SOT_SIGNAL_EXCEPTION_H -#define __SOT_SIGNAL_EXCEPTION_H - -/* --------------------------------------------------------------------- */ -/* --- INCLUDE --------------------------------------------------------- */ -/* --------------------------------------------------------------------- */ - - -#include <sot-core/sotExceptionAbstract.h> -#include <sot-core/sot-core-api.h> -/* --------------------------------------------------------------------- */ -/* --- CLASS ----------------------------------------------------------- */ -/* --------------------------------------------------------------------- */ - - -/* \class sotExceptionSignal - */ -class SOT_CORE_EXPORT sotExceptionSignal -:public sotExceptionAbstract - -{ - public: - enum ErrorCodeEnum - { - GENERIC = sotExceptionAbstract::SIGNAL - - ,READWRITE_LOCK - ,COPY_NOT_INITIALIZED - ,NOT_INITIALIZED - ,PLUG_IMPOSSIBLE - ,SET_IMPOSSIBLE - ,BAD_CAST - }; - - static const std::string EXCEPTION_NAME; - virtual const std::string& getExceptionName( void ) const { return EXCEPTION_NAME; } - -public: - - sotExceptionSignal ( const sotExceptionSignal::ErrorCodeEnum& errcode, - const std::string & msg = "" ); - sotExceptionSignal( const sotExceptionSignal::ErrorCodeEnum& errcode, - const std::string & msg,const char* format, ... ); - virtual ~sotExceptionSignal( void ){} - - -}; - - - - - -#endif /* #ifndef __SOT_SIGNAL_EXCEPTION_H */ - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/include/sot-core/sotExceptionTask.h b/include/sot-core/sotExceptionTask.h deleted file mode 100644 index 82a2565b..00000000 --- a/include/sot-core/sotExceptionTask.h +++ /dev/null @@ -1,75 +0,0 @@ -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Copyright Projet JRL-Japan, 2007 - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * - * File: sotExceptionTask.h - * Project: SOT - * Author: Nicolas Mansard - * - * Version control - * =============== - * - * $Id$ - * - * Description - * ============ - * - * - * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -#ifndef __SOT_EXCEPTION_TASK_H -#define __SOT_EXCEPTION_TASK_H - -/* --------------------------------------------------------------------- */ -/* --- INCLUDE --------------------------------------------------------- */ -/* --------------------------------------------------------------------- */ - - -#include <sot-core/sotExceptionAbstract.h> -#include <sot-core/sot-core-api.h> -/* --------------------------------------------------------------------- */ -/* --- CLASS ----------------------------------------------------------- */ -/* --------------------------------------------------------------------- */ - - -/* \class sotExceptionTask - */ -class SOT_CORE_EXPORT sotExceptionTask -:public sotExceptionAbstract - -{ -public: - - enum ErrorCodeEnum - { - GENERIC = sotExceptionAbstract::TASK - ,EMPTY_LIST - ,NON_ADEQUATE_FEATURES - ,MATRIX_SIZE - ,BOUND_TYPE - ,PARSER_MULTI_BOUND - }; - - static const std::string EXCEPTION_NAME; - virtual const std::string& getExceptionName( void ) const { return EXCEPTION_NAME; } - - sotExceptionTask ( const sotExceptionTask::ErrorCodeEnum& errcode, - const std::string & msg = "" ); - sotExceptionTask( const sotExceptionTask::ErrorCodeEnum& errcode, - const std::string & msg,const char* format, ... ); - virtual ~sotExceptionTask( void ){} - -}; - - - - - -#endif /* #ifndef __SOT_EXCEPTION_TASK_H */ - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/include/sot-core/sotExceptionTools.h b/include/sot-core/sotExceptionTools.h deleted file mode 100644 index 3432761f..00000000 --- a/include/sot-core/sotExceptionTools.h +++ /dev/null @@ -1,75 +0,0 @@ -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Copyright Projet JRL-Japan, 2007 - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * - * File: sotExceptionTools.h - * Project: SOT - * Author: Nicolas Mansard - * - * Version control - * =============== - * - * $Id$ - * - * Description - * ============ - * - * - * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -#ifndef __SOT_TOOLS_EXCEPTION_H -#define __SOT_TOOLS_EXCEPTION_H - -/* --------------------------------------------------------------------- */ -/* --- INCLUDE --------------------------------------------------------- */ -/* --------------------------------------------------------------------- */ - - -#include <sot-core/sotExceptionAbstract.h> -#include <sot-core/sot-core-api.h> -/* --------------------------------------------------------------------- */ -/* --- CLASS ----------------------------------------------------------- */ -/* --------------------------------------------------------------------- */ - - -/* \class sotExceptionTools - */ -class SOT_CORE_EXPORT sotExceptionTools -:public sotExceptionAbstract - -{ - public: - enum ErrorCodeEnum - { - GENERIC = sotExceptionAbstract::TOOLS - - ,CORBA - ,KALMAN_SIZE - }; - - static const std::string EXCEPTION_NAME; - virtual const std::string& getExceptionName( void ) const { return EXCEPTION_NAME; } - -public: - - sotExceptionTools ( const sotExceptionTools::ErrorCodeEnum& errcode, - const std::string & msg = "" ); - sotExceptionTools( const sotExceptionTools::ErrorCodeEnum& errcode, - const std::string & msg,const char* format, ... ); - virtual ~sotExceptionTools( void ){} - - -}; - - - - - -#endif /* #ifndef __SOT_TOOLS_EXCEPTION_H */ - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/include/sot-core/sotExceptionTraces.h b/include/sot-core/sotExceptionTraces.h deleted file mode 100644 index 15c809a5..00000000 --- a/include/sot-core/sotExceptionTraces.h +++ /dev/null @@ -1,74 +0,0 @@ -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Copyright Projet JRL-Japan, 2007 - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * - * File: sotExceptionTraces.h - * Project: SOT - * Author: Nicolas Mansard - * - * Version control - * =============== - * - * $Id$ - * - * Description - * ============ - * - * - * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -#ifndef __SOT_TRACES_EXCEPTION_H -#define __SOT_TRACES_EXCEPTION_H - -/* --------------------------------------------------------------------- */ -/* --- INCLUDE --------------------------------------------------------- */ -/* --------------------------------------------------------------------- */ - - -#include <sot-core/sotExceptionAbstract.h> -#include <sot-core/sot-core-api.h> -/* --------------------------------------------------------------------- */ -/* --- CLASS ----------------------------------------------------------- */ -/* --------------------------------------------------------------------- */ - - -/* \class sotExceptionTraces - */ -class SOT_CORE_EXPORT sotExceptionTraces -:public sotExceptionAbstract - -{ - public: - enum ErrorCodeEnum - { - GENERIC = sotExceptionAbstract::TRACES - - ,NOT_OPEN - }; - - static const std::string EXCEPTION_NAME; - virtual const std::string& getExceptionName( void ) const { return EXCEPTION_NAME; } - -public: - - sotExceptionTraces ( const sotExceptionTraces::ErrorCodeEnum& errcode, - const std::string & msg = "" ); - sotExceptionTraces( const sotExceptionTraces::ErrorCodeEnum& errcode, - const std::string & msg,const char* format, ... ); - virtual ~sotExceptionTraces( void ){} - - -}; - - - - - -#endif /* #ifndef __SOT_TRACES_EXCEPTION_H */ - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/include/sot-core/sotFactory.h b/include/sot-core/sotFactory.h index d26fa7dc..3ebf1aa2 100644 --- a/include/sot-core/sotFactory.h +++ b/include/sot-core/sotFactory.h @@ -33,7 +33,7 @@ /* --- SOT --- */ class sotFeatureAbstract; class sotTaskAbstract; -#include <sot-core/sotExceptionFactory.h> +#include <sot-core/exception-factory.h> #include <sot-core/sot-core-api.h> #include <dynamic-graph/factory.h> diff --git a/include/sot-core/sotFeature1D.h b/include/sot-core/sotFeature1D.h index da57bddf..b5240e45 100644 --- a/include/sot-core/sotFeature1D.h +++ b/include/sot-core/sotFeature1D.h @@ -27,7 +27,7 @@ /* SOT */ #include <sot-core/sotFeatureAbstract.h> -#include <sot-core/sotExceptionTask.h> +#include <sot-core/exception-task.h> /* --------------------------------------------------------------------- */ /* --- API ------------------------------------------------------------- */ diff --git a/include/sot-core/sotFeatureGeneric.h b/include/sot-core/sotFeatureGeneric.h index 4dff37aa..686cf2f5 100644 --- a/include/sot-core/sotFeatureGeneric.h +++ b/include/sot-core/sotFeatureGeneric.h @@ -27,7 +27,7 @@ /* SOT */ #include <sot-core/sotFeatureAbstract.h> -#include <sot-core/sotExceptionTask.h> +#include <sot-core/exception-task.h> /* --------------------------------------------------------------------- */ /* --- API ------------------------------------------------------------- */ diff --git a/include/sot-core/sotFeatureJointLimits.h b/include/sot-core/sotFeatureJointLimits.h index 491cdc4e..24926826 100644 --- a/include/sot-core/sotFeatureJointLimits.h +++ b/include/sot-core/sotFeatureJointLimits.h @@ -27,7 +27,7 @@ /* SOT */ #include <sot-core/sotFeatureAbstract.h> -#include <sot-core/sotExceptionTask.h> +#include <sot-core/exception-task.h> /* --------------------------------------------------------------------- */ /* --- API ------------------------------------------------------------- */ diff --git a/include/sot-core/sotFeatureLineDistance.h b/include/sot-core/sotFeatureLineDistance.h index 628a745c..3651fd24 100644 --- a/include/sot-core/sotFeatureLineDistance.h +++ b/include/sot-core/sotFeatureLineDistance.h @@ -27,7 +27,7 @@ /* SOT */ #include <sot-core/sotFeatureAbstract.h> -#include <sot-core/sotExceptionTask.h> +#include <sot-core/exception-task.h> #include <sot-core/sotMatrixHomogeneous.h> /* --------------------------------------------------------------------- */ diff --git a/include/sot-core/sotFeaturePoint6d.h b/include/sot-core/sotFeaturePoint6d.h index e4a12ed5..8c017f16 100644 --- a/include/sot-core/sotFeaturePoint6d.h +++ b/include/sot-core/sotFeaturePoint6d.h @@ -27,7 +27,7 @@ /* SOT */ #include <sot-core/sotFeatureAbstract.h> -#include <sot-core/sotExceptionTask.h> +#include <sot-core/exception-task.h> #include <sot-core/sotMatrixHomogeneous.h> /* --------------------------------------------------------------------- */ diff --git a/include/sot-core/sotFeaturePoint6dRelative.h b/include/sot-core/sotFeaturePoint6dRelative.h index 87455cc7..1ed3deac 100644 --- a/include/sot-core/sotFeaturePoint6dRelative.h +++ b/include/sot-core/sotFeaturePoint6dRelative.h @@ -28,7 +28,7 @@ /* SOT */ #include <sot-core/sotFeatureAbstract.h> #include <sot-core/sotFeaturePoint6d.h> -#include <sot-core/sotExceptionTask.h> +#include <sot-core/exception-task.h> #include <sot-core/sotVectorUTheta.h> /* --------------------------------------------------------------------- */ diff --git a/include/sot-core/sotFeatureTask.h b/include/sot-core/sotFeatureTask.h index 9eb33210..38978a8e 100644 --- a/include/sot-core/sotFeatureTask.h +++ b/include/sot-core/sotFeatureTask.h @@ -28,7 +28,7 @@ /* SOT */ #include <sot-core/sotFeatureGeneric.h> #include <sot-core/sotTaskAbstract.h> -#include <sot-core/sotExceptionTask.h> +#include <sot-core/exception-task.h> /* --------------------------------------------------------------------- */ /* --- API ------------------------------------------------------------- */ diff --git a/include/sot-core/sotFeatureVector3.h b/include/sot-core/sotFeatureVector3.h index 2e5aa480..de61b19b 100644 --- a/include/sot-core/sotFeatureVector3.h +++ b/include/sot-core/sotFeatureVector3.h @@ -27,7 +27,7 @@ /* SOT */ #include <sot-core/sotFeatureAbstract.h> -#include <sot-core/sotExceptionTask.h> +#include <sot-core/exception-task.h> #include <sot-core/sotMatrixHomogeneous.h> /* --------------------------------------------------------------------- */ diff --git a/include/sot-core/sotFeatureVisualPoint.h b/include/sot-core/sotFeatureVisualPoint.h index 21fad67d..b7d4f058 100644 --- a/include/sot-core/sotFeatureVisualPoint.h +++ b/include/sot-core/sotFeatureVisualPoint.h @@ -27,7 +27,7 @@ /* SOT */ #include <sot-core/sotFeatureAbstract.h> -#include <sot-core/sotExceptionTask.h> +#include <sot-core/exception-task.h> /* --------------------------------------------------------------------- */ /* --- API ------------------------------------------------------------- */ diff --git a/include/sot-core/sotMultiBound.h b/include/sot-core/sotMultiBound.h index 4e7f2c9d..e0601acd 100644 --- a/include/sot-core/sotMultiBound.h +++ b/include/sot-core/sotMultiBound.h @@ -33,7 +33,7 @@ /* SOT */ #include <sot-core/sot-core-api.h> -#include <sot-core/sotExceptionTask.h> +#include <sot-core/exception-task.h> /* --------------------------------------------------------------------- */ /* --- CLASS ----------------------------------------------------------- */ diff --git a/include/sot-core/sotPool.h b/include/sot-core/sotPool.h index 133adc65..69eb96c7 100644 --- a/include/sot-core/sotPool.h +++ b/include/sot-core/sotPool.h @@ -33,7 +33,7 @@ #include <sstream> /* --- SOT --- */ -#include <sot-core/sotExceptionFactory.h> +#include <sot-core/exception-factory.h> #include <dynamic-graph/signal-base.h> #include <sot-core/sot-core-api.h> #include <dynamic-graph/pool.h> diff --git a/include/sot-core/sotSignalCast.h b/include/sot-core/sotSignalCast.h deleted file mode 100644 index 54a0c880..00000000 --- a/include/sot-core/sotSignalCast.h +++ /dev/null @@ -1,201 +0,0 @@ -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Copyright Projet JRL-Japan, 2007 - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * - * File: SignalCast.h - * Project: SOT - * Author: Nicolas Mansard - * - * Version control - * =============== - * - * $Id$ - * - * Description - * ============ - * - * - * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - - -#ifndef __SOT_SIGNAL_CAST_HH__ -#define __SOT_SIGNAL_CAST_HH__ - - -#include <sot-core/sotFlags.h> -#include <MatrixAbstractLayer/boost.h> -#include <sot-core/sotMatrixHomogeneous.h> -#include <sot-core/sotMatrixTwist.h> -#include <sot-core/sotVectorUTheta.h> -#include <sot-core/sotVectorQuaternion.h> -#include <sot-core/sotVectorRollPitchYaw.h> -#include <sot-core/sotMatrixForce.h> -#include <sot-core/sotMultiBound.h> -#include <sot-core/sot-core-api.h> -#ifdef WIN32 -#include <sot-core/sotUtilsWindows.h> -#endif -#include <dynamic-graph/signal-caster.h> - -/* -------------------------------------------------------------------------- */ -/* --- CLASS ---------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ -class sotFeatureAbstract; - - -/*! - * This class is only used to group together static functions who differ by - * a template parameter. It is never actually instanced (the private constructor - * makes sure of that). - */ -template< class T > -class SignalCast -{ -public: - SOT_CORE_EXPORT static T cast( std::istringstream& stringValue ) { throw 1;} - SOT_CORE_EXPORT static void disp( const T& t,std::ostream& os ) { throw 1; } - SOT_CORE_EXPORT static void trace( const T& t,std::ostream& os ) { disp(t,os); } -public: - // adapter functions for SignalCast - static boost::any cast_( std::istringstream& stringValue ) { - return boost::any_cast<T>(cast(stringValue)); - } - static void disp_( const boost::any& t,std::ostream& os ) { - disp(boost::any_cast<T>(t), os); - } - static void trace_( const boost::any& t,std::ostream& os ) { - trace(boost::any_cast<T>(t),os); - } -private: - SignalCast() {} -}; - - -/* -------------------------------------------------------------------------- */ -/* --- MACROS --------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ - -/* Declaration macro: one instance of each class needs to be present in - * order for casts to be registered. - */ - -#define SOT_SIGNAL_CAST_DECLARATION(TYPE) \ - SignalCastRegisterer sotCastRegisterer_##TYPE \ - (typeid(TYPE), \ - SignalCast<TYPE>::disp_, \ - SignalCast<TYPE>::cast_, \ - SignalCast<TYPE>::trace_); - -#define SOT_SIGNAL_CAST_DECLARATION_NAMED(TYPE,NAME) \ - SignalCastRegisterer sotCastRegisterer_##NAME \ - (typeid(TYPE), \ - SignalCast<TYPE>::disp_, \ - SignalCast<TYPE>::cast_, \ - SignalCast<TYPE>::trace_); - -/* Standard definition macros: the three functions can be specified - * in the macros. To define then in the cpp, just put ';' in the args. - */ -#define SOT_SIGNAL_CAST_FULL_DEFINITION(TYPE,CAST,DISP,TRACE) \ -template<> \ -class SignalCast<TYPE> \ -{ \ -public: \ - SOT_CORE_EXPORT static TYPE cast( std::istringstream& iss ) CAST \ - SOT_CORE_EXPORT static void disp( const TYPE& t,std::ostream& os ) DISP \ - SOT_CORE_EXPORT static void trace( const TYPE& t,std::ostream& os ) TRACE \ -public: \ - static boost::any cast_( std::istringstream& stringValue ) { \ - return boost::any_cast<TYPE>(cast(stringValue)); \ - } \ - static void disp_( const boost::any& t,std::ostream& os ) { \ - disp(boost::any_cast<TYPE>(t), os); \ - } \ - static void trace_( const boost::any& t,std::ostream& os ) { \ - trace(boost::any_cast<TYPE>(t),os); \ - } \ -} - -/* Standard definition macros: the functions <cast> and <disp> have - * to be implemented in the cpp files. The function <trace> is - * implemented as a proxy on <disp>. - */ -#define SOT_SIGNAL_CAST_DEFINITION_HPP(TYPE) \ - SOT_SIGNAL_CAST_FULL_DEFINITION(TYPE,;,;,{ disp(t,os); }) - -/* Lazy definition: <cast> and <disp> are to proxys on the standard - * std input (>>) and output (<<). The function <trace> has to be - * implemented in the cpp. - */ -#define SOT_SIGNAL_CAST_DEFINITION_TRACE_HPP(TYPE,TRACE) \ - SOT_SIGNAL_CAST_FULL_DEFINITION(TYPE, \ - {TYPE res; iss >> res; return res; }, \ - { os << t <<std::endl; }, \ - TRACE ) - -/* Lazy lazy definition: the three functions are implemented as - * proxys on std::io operation. - */ -#define SOT_SIGNAL_CAST_DEFINITION(TYPE) \ - SOT_SIGNAL_CAST_FULL_DEFINITION(TYPE, \ - {TYPE res; iss >> res; return res; }, \ - { os << t <<std::endl; }, \ - { disp(t,os); }) - -/* Lazy definition of <cast> and <disp> with implementation of - * <trace> in the cpp. - */ -#define SOT_SIGNAL_CAST_DEFINITION_TRACE(TYPE) \ - SOT_SIGNAL_CAST_FULL_DEFINITION(TYPE, \ - {TYPE res; iss >> res; return res; }, \ - { os << t <<std::endl; }, \ - ;) - -/* -------------------------------------------------------------------------- */ -/* --- MACROS --------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ - -/* --- OTHER --- */ -SOT_SIGNAL_CAST_DEFINITION(sotFlags); -SOT_SIGNAL_CAST_DEFINITION_TRACE(sotVectorMultiBound); - -typedef sotFeatureAbstract* SignalCast_sotFeatureAbstractPtr ; - -SOT_SIGNAL_CAST_DEFINITION_HPP( SignalCast_sotFeatureAbstractPtr ); -SOT_SIGNAL_CAST_DEFINITION_HPP( struct timeval ); - -/* --- Matrices and Vectors --- */ -#define SOT_SIGNAL_CAST_DEFINITION_MATRIX(TYPE) \ -SOT_SIGNAL_CAST_FULL_DEFINITION(TYPE,{TYPE res; iss >> res; return res; }, \ - { SignalCast<ml::Matrix>::disp(t,os); }, \ - { SignalCast<ml::Matrix>::trace(t,os); }) -//SOT_SIGNAL_CAST_DEFINITION_TRACE_HPP(TYPE,{ SignalCast<ml::Matrix>::trace(t,os); }) - -#define SOT_SIGNAL_CAST_DEFINITION_VECTOR(TYPE) \ -SOT_SIGNAL_CAST_FULL_DEFINITION(TYPE,{TYPE res; iss >> res; return res; }, \ - { SignalCast<ml::Vector>::disp(t,os); }, \ - { SignalCast<ml::Vector>::trace(t,os); }) -//SOT_SIGNAL_CAST_DEFINITION_TRACE_HPP(TYPE,{ SignalCast<ml::Vector>::trace(t,os); }) - -SOT_SIGNAL_CAST_FULL_DEFINITION(maal::boost::Vector,; SOT_CORE_EXPORT static maal::boost::DisplayType displayType;,;,;); -SOT_SIGNAL_CAST_FULL_DEFINITION(maal::boost::Matrix,;,;,;); - -/* All the followings are defined with proxys on the equivalent - * functions ml:: based. - */ -SOT_SIGNAL_CAST_DEFINITION_VECTOR(sotVectorUTheta); -SOT_SIGNAL_CAST_DEFINITION_VECTOR(sotVectorQuaternion); -SOT_SIGNAL_CAST_DEFINITION_VECTOR(sotVectorRollPitchYaw); -SOT_SIGNAL_CAST_DEFINITION_MATRIX(sotMatrixRotation); -SOT_SIGNAL_CAST_DEFINITION_MATRIX(sotMatrixHomogeneous); -SOT_SIGNAL_CAST_DEFINITION_MATRIX(sotMatrixTwist); -SOT_SIGNAL_CAST_DEFINITION_MATRIX(sotMatrixForce); - - - - -#endif // #ifndef __SOT_SIGNAL_CAST_HH__ - - - diff --git a/include/sot-core/sotTask.h b/include/sot-core/sotTask.h index 8d11755e..e02e6751 100644 --- a/include/sot-core/sotTask.h +++ b/include/sot-core/sotTask.h @@ -40,7 +40,7 @@ namespace ml = maal::boost; #include <sot-core/sotFlags.h> #include <sot-core/sotTaskAbstract.h> -#include <sot-core/sotExceptionTask.h> +#include <sot-core/exception-task.h> /* --------------------------------------------------------------------- */ /* --- API ------------------------------------------------------------- */ diff --git a/include/sot-core/sotTaskConti.h b/include/sot-core/sotTaskConti.h index d9e1e16f..61195428 100644 --- a/include/sot-core/sotTaskConti.h +++ b/include/sot-core/sotTaskConti.h @@ -38,7 +38,7 @@ namespace ml = maal::boost; #include <sot-core/sotFlags.h> #include <sot-core/sotTask.h> -#include <sot-core/sotExceptionTask.h> +#include <sot-core/exception-task.h> /* --------------------------------------------------------------------- */ /* --- API ------------------------------------------------------------- */ diff --git a/include/sot-core/sotTaskUnilateral.h b/include/sot-core/sotTaskUnilateral.h index a5204897..46678650 100644 --- a/include/sot-core/sotTaskUnilateral.h +++ b/include/sot-core/sotTaskUnilateral.h @@ -40,7 +40,7 @@ namespace ml = maal::boost; #include <sot-core/sotFlags.h> #include <sot-core/sotTask.h> -#include <sot-core/sotExceptionTask.h> +#include <sot-core/exception-task.h> /* --------------------------------------------------------------------- */ /* --- API ------------------------------------------------------------- */ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a812eb5c..46186fbe 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,19 +5,19 @@ SET(LIBRARY_NAME ${PROJECT_NAME}) SET(${LIBRARY_NAME}_SOURCES - debug/sotDebug.cpp - debug/sotContiifstream.cpp + debug/debug.cpp + debug/contiifstream.cpp - exception/sotExceptionAbstract.cpp - exception/sotExceptionDynamic.cpp - exception/sotExceptionFactory.cpp - exception/sotExceptionFeature.cpp - exception/sotExceptionSignal.cpp - exception/sotExceptionTask.cpp - exception/sotExceptionTools.cpp - exception/sotExceptionTraces.cpp + exception/exception-abstract.cpp + exception/exception-dynamic.cpp + exception/exception-factory.cpp + exception/exception-feature.cpp + exception/exception-signal.cpp + exception/exception-task.cpp + exception/exception-tools.cpp + exception/exception-traces.cpp - signal/sotSignalCast.cpp + signal/signal-cast.cpp matrix/sotBinaryOp.cpp matrix/sotDerivator.cpp diff --git a/src/debug/sotContiifstream.cpp b/src/debug/sotContiifstream.cpp deleted file mode 100644 index 43c78d49..00000000 --- a/src/debug/sotContiifstream.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Copyright Projet JRL-Japan, 2007 - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * - * File: sotContiifstream.cpp - * Project: SOT - * Author: Nicolas Mansard - * - * Version control - * =============== - * - * $Id$ - * - * Description - * ============ - * - * - * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - -#include <sot-core/sotContiifstream.h> -#include <sot-core/sotDebug.h> - -sotContiifstream:: -sotContiifstream( const std::string& n ) - :filename(n),cursor(0),first(true) {} - - -sotContiifstream:: -~sotContiifstream( void ) -{ - sotDEBUGINOUT(5); -} - - -bool sotContiifstream:: -loop( void ) -{ - sotDEBUGIN(25); - bool res=false; - - std::fstream file( filename.c_str() ); - - file.seekg(cursor); - file.sync(); - - while(1) - { - file.get(buffer,BUFFER_SIZE); - if( file.gcount() ) - { - res=true; - std::string line(buffer); - if(! first) reader.push_back(line); - cursor=file.tellg(); cursor++; - file.get(*buffer); // get the last char ( = '\n') - sotDEBUG(15) << "line: "<< line<<std::endl; - } - else { break; } - } - - first=false; - sotDEBUGOUT(25); - return res; -} - -std::string -sotContiifstream::next( void ) -{ - std::string res = *reader.begin(); - reader.pop_front(); - return res; -} - - - - - diff --git a/src/debug/sotDebug.cpp b/src/debug/sotDebug.cpp deleted file mode 100644 index b6a75179..00000000 --- a/src/debug/sotDebug.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Copyright Projet Lagadic, 2005 - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * - * File: sotDebug.h - * Project: STack of Tasks - * Author: Nicolas Mansard - * - * Version control - * =============== - * - * $Id$ - * - * Description - * ============ - * - * Macro de trace et de debugage - * - * - TRACAGE: TRACE et ERROR_TRACE fonctionnent comme des printf - * avec retour chariot en fin de fonction. - * CERROR et CTRACE fonctionnent comme les flux de sortie - * C++ cout et cerr. - * - DEBUGAGE: DEBUG_TRACE(niv, et DERROR_TRACE(niv, fonctionnent - * comme des printf, n'imprimant que si le niveau de trace 'niv' est - * superieur au mode de debugage VP_DEBUG_MODE. - * CDEBUG(niv) fonctionne comme le flux de sortie C++ cout. - * DEBUG_ENABLE(niv) vaut 1 ssi le niveau de tracage 'niv' - * est superieur au mode de debugage DEBUG_MODE. Il vaut 0 sinon. - * - PROG DEFENSIVE: DEFENSIF(a) vaut a ssi le mode defensif est active, - * et vaut 0 sinon. - * - * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -#include <sot-core/sotDebug.h> -#include <fstream> -#include <ios> - -#ifdef WIN32 -const char * sotDebugTrace::DEBUG_FILENAME_DEFAULT = "c:/tmp/traces.txt"; -#else /*WIN32*/ -const char * sotDebugTrace::DEBUG_FILENAME_DEFAULT = "/tmp/traces.txt"; -#endif /*WIN32*/ - - - -#ifdef VP_DEBUG - #ifdef WIN32 - std::ofstream debugfile( "C:/tmp/traces.txt", std::ios::trunc&std::ios::out ); - #else /*WIN32*/ - std::ofstream debugfile( "/tmp/traces.txt", std::ios::trunc&std::ios::out ); -#endif /*WIN32*/ -#else -std::ofstream debugfile; //( "/dev/null", std::ios::trunc&std::ios::out ); - class __sotDebug_init - { - public: - __sotDebug_init( void ) - { debugfile.setstate( std::ios::failbit ) ; /* debugfile.close(); */ } - }; - __sotDebug_init __sotDebug_initialisator; - -#endif - -sotDebugTrace sotDEBUGFLOW(debugfile); -sotDebugTrace sotERRORFLOW(debugfile); - - -void sotDebugTrace::openFile( const char * filename ) -{ - if( debugfile.good()&&debugfile.is_open() ) debugfile.close(); - debugfile.clear(); - debugfile.open( filename, std::ios::trunc&std::ios::out ); - //std::cout << filename << debugfile.good() << debugfile.is_open() << std::endl; -} - -void sotDebugTrace::closeFile( const char * filename ) -{ - if( debugfile.good()&&debugfile.is_open() ) { debugfile.close(); } - debugfile.setstate( std::ios::failbit ) ; -} - - -//sotDebugTrace sotDEBUGFLOW(std::cout); -//sotDebugTrace sotERRORFLOW(std::cerr); - diff --git a/src/exception/sotExceptionAbstract.cpp b/src/exception/sotExceptionAbstract.cpp deleted file mode 100644 index a81631da..00000000 --- a/src/exception/sotExceptionAbstract.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Copyright Projet JRL-Japan, 2007 - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * - * File: sotExceptionAbstract.cpp - * Project: SOT - * Author: Nicolas Mansard - * - * Version control - * =============== - * - * $Id$ - * - * Description - * ============ - * - * - * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - - -#include <sot-core/sotExceptionAbstract.h> -#include <sot-core/sotDebug.h> - -using namespace std; - -/* ------------------------------------------------------------------------- */ -/* --- CONSTRUCTORS -------------------------------------------------------- */ -/* ------------------------------------------------------------------------- */ - -const std::string sotExceptionAbstract::EXCEPTION_NAME = "Abstract"; - - -sotExceptionAbstract:: -sotExceptionAbstract (const int& _code, - const string & _msg) - : - code (_code), - message (_msg) - -{ - return ; - -} - -/* ------------------------------------------------------------------------ */ -/* --- ACCESSORS ---------------------------------------------------------- */ -/* ------------------------------------------------------------------------ */ - -const char *sotExceptionAbstract:: -getMessage (void) -{ - return (this->message) .c_str(); -} - -const string &sotExceptionAbstract:: -getStringMessage (void) -{ - return this->message; -} - -int sotExceptionAbstract:: -getCode (void) -{ - return this->code; -} - - -/* ------------------------------------------------------------------------- */ -/* --- MODIFIORS ----------------------------------------------------------- */ -/* ------------------------------------------------------------------------- */ -#ifdef SOT_EXCEPTION_PASSING_PARAM - - -sotExceptionAbstract::Param& sotExceptionAbstract::Param:: -initCopy( const Param& p ) -{ - sotDEBUGIN(25); - if( p.pointersSet ) - { - strncpy( function,p.functionPTR,BUFFER_SIZE); - strncpy( file,p.filePTR,BUFFER_SIZE); - line = p.line; - pointersSet=false; - set=true; - } else set=false; - sotDEBUGOUT(25); - return *this; -} -sotExceptionAbstract::Param:: -Param( const int& _line, const char * _function, const char * _file ) - : functionPTR(_function),line(_line),filePTR(_file),pointersSet(true) -{ - sotDEBUGINOUT(25); -} -#endif //#ifdef SOT_EXCEPTION_PASSING_PARAM - -/* ------------------------------------------------------------------------- */ -/* --- OP << --------------------------------------------------------------- */ -/* ------------------------------------------------------------------------- */ - -ostream & -operator << (ostream & os, - const sotExceptionAbstract & error) -{ - os << error.getExceptionName()<<"Error [#" << error.code << "]: " << error.message << endl; - -#ifdef SOT_EXCEPTION_PASSING_PARAM - if( error.p.set ) - os << "Thrown from "<<error.p.file << ": "<<error.p.function - <<" (#"<<error.p.line << ")"<<endl; -#endif //#ifdef SOT_EXCEPTION_PASSING_PARAM - - return os; -} - - - - - -/** \file $Source$ - */ - -/* - * Local variables: - * c-basic-offset: 4 - * End: - */ diff --git a/src/exception/sotExceptionDynamic.cpp b/src/exception/sotExceptionDynamic.cpp deleted file mode 100644 index 2826eb74..00000000 --- a/src/exception/sotExceptionDynamic.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Copyright Projet JRL-Japan, 2007 - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * - * File: sotExceptionDynamic.cpp - * Project: SOT - * Author: Nicolas Mansard - * - * Version control - * =============== - * - * $Id$ - * - * Description - * ============ - * - * - * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - -#include <sot-core/sotExceptionDynamic.h> -#include <stdarg.h> -#include <cstdio> - -/* --------------------------------------------------------------------- */ -/* --- CLASS ----------------------------------------------------------- */ -/* --------------------------------------------------------------------- */ - -const std::string sotExceptionDynamic::EXCEPTION_NAME = "Dynamic"; - -sotExceptionDynamic:: -sotExceptionDynamic ( const sotExceptionDynamic::ErrorCodeEnum& errcode, - const std::string & msg ) - :sotExceptionAbstract(errcode,msg) -{ -} - -sotExceptionDynamic:: -sotExceptionDynamic ( const sotExceptionDynamic::ErrorCodeEnum& errcode, - const std::string & msg,const char* format, ... ) - :sotExceptionAbstract(errcode,msg) -{ - va_list args; - va_start(args,format); - - const unsigned int SIZE = 256; - char buffer[SIZE]; - vsnprintf(buffer,SIZE,format,args); - - message += buffer; - - va_end(args); -} - - - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/src/exception/sotExceptionFactory.cpp b/src/exception/sotExceptionFactory.cpp deleted file mode 100644 index a737cdb2..00000000 --- a/src/exception/sotExceptionFactory.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Copyright Projet JRL-Japan, 2007 - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * - * File: sotExceptionFactory.cpp - * Project: SOT - * Author: Nicolas Mansard - * - * Version control - * =============== - * - * $Id$ - * - * Description - * ============ - * - * - * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - -#include <sot-core/sotExceptionFactory.h> -#include <sot-core/sotDebug.h> -#include <stdarg.h> -#include <cstdio> - -/* --------------------------------------------------------------------- */ -/* --- CLASS ----------------------------------------------------------- */ -/* --------------------------------------------------------------------- */ - -const std::string sotExceptionFactory::EXCEPTION_NAME = "Factory"; - -sotExceptionFactory:: -sotExceptionFactory ( const sotExceptionFactory::ErrorCodeEnum& errcode, - const std::string & msg ) - :sotExceptionAbstract(errcode,msg) -{ - sotDEBUGF( 15,"Created with message <%s>.",msg.c_str()); - sotDEBUG( 1) <<"Created with message <%s>."<<msg<<std::endl; -} - -sotExceptionFactory:: -sotExceptionFactory ( const sotExceptionFactory::ErrorCodeEnum& errcode, - const std::string & msg,const char* format, ... ) - :sotExceptionAbstract(errcode,msg) -{ - va_list args; - va_start(args,format); - - const unsigned int SIZE = 256; - char buffer[SIZE]; - vsnprintf(buffer,SIZE,format,args); - - sotDEBUG(15) <<"Created "<<" with message <" - <<msg<<"> and buffer <"<<buffer<<">. "<<std::endl; - - message += buffer; - - va_end(args); - - sotDEBUG(1) << "Throw exception " << EXCEPTION_NAME << "[#" << errcode<<"]: " - <<"<"<< message << ">."<<std::endl; - -} - - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/src/exception/sotExceptionFeature.cpp b/src/exception/sotExceptionFeature.cpp deleted file mode 100644 index 02107a7f..00000000 --- a/src/exception/sotExceptionFeature.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Copyright Projet JRL-Japan, 2007 - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * - * File: sotExceptionFeature.cpp - * Project: SOT - * Author: Nicolas Mansard - * - * Version control - * =============== - * - * $Id$ - * - * Description - * ============ - * - * - * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - -#include <sot-core/sotExceptionFeature.h> -#include <stdarg.h> -#include <cstdio> - - -/* --------------------------------------------------------------------- */ -/* --- CLASS ----------------------------------------------------------- */ -/* --------------------------------------------------------------------- */ - -const std::string sotExceptionFeature::EXCEPTION_NAME = "Feature"; - -sotExceptionFeature:: -sotExceptionFeature ( const sotExceptionFeature::ErrorCodeEnum& errcode, - const std::string & msg ) - :sotExceptionAbstract(errcode,msg) -{ -} - -sotExceptionFeature:: -sotExceptionFeature ( const sotExceptionFeature::ErrorCodeEnum& errcode, - const std::string & msg,const char* format, ... ) - :sotExceptionAbstract(errcode,msg) -{ - va_list args; - va_start(args,format); - - const unsigned int SIZE = 256; - char buffer[SIZE]; - vsnprintf(buffer,SIZE,format,args); - - message = buffer; - - va_end(args); -} - - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/src/exception/sotExceptionSignal.cpp b/src/exception/sotExceptionSignal.cpp deleted file mode 100644 index e91146a7..00000000 --- a/src/exception/sotExceptionSignal.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Copyright Projet JRL-Japan, 2007 - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * - * File: sotExceptionSignal.cpp - * Project: SOT - * Author: Nicolas Mansard - * - * Version control - * =============== - * - * $Id$ - * - * Description - * ============ - * - * - * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - -#include <sot-core/sotExceptionSignal.h> -#include <stdarg.h> -#include <cstdio> - -/* --------------------------------------------------------------------- */ -/* --- CLASS ----------------------------------------------------------- */ -/* --------------------------------------------------------------------- */ - -const std::string sotExceptionSignal::EXCEPTION_NAME = "Signal"; - -sotExceptionSignal:: -sotExceptionSignal ( const sotExceptionSignal::ErrorCodeEnum& errcode, - const std::string & msg ) - :sotExceptionAbstract(errcode,msg) -{ -} - -sotExceptionSignal:: -sotExceptionSignal ( const sotExceptionSignal::ErrorCodeEnum& errcode, - const std::string & msg,const char* format, ... ) - :sotExceptionAbstract(errcode,msg) -{ - va_list args; - va_start(args,format); - - const unsigned int SIZE = 256; - char buffer[SIZE]; - vsnprintf(buffer,SIZE,format,args); - - message += buffer; - - va_end(args); -} - - - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/src/exception/sotExceptionTask.cpp b/src/exception/sotExceptionTask.cpp deleted file mode 100644 index 82670e95..00000000 --- a/src/exception/sotExceptionTask.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Copyright Projet JRL-Japan, 2007 - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * - * File: sotExceptionTask.cpp - * Project: SOT - * Author: Nicolas Mansard - * - * Version control - * =============== - * - * $Id$ - * - * Description - * ============ - * - * - * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - -#include <sot-core/sotExceptionTask.h> -#include <stdarg.h> -#include <cstdio> - - -/* --------------------------------------------------------------------- */ -/* --- CLASS ----------------------------------------------------------- */ -/* --------------------------------------------------------------------- */ - -const std::string sotExceptionTask::EXCEPTION_NAME = "Task"; - -sotExceptionTask:: -sotExceptionTask ( const sotExceptionTask::ErrorCodeEnum& errcode, - const std::string & msg ) - :sotExceptionAbstract(errcode,msg) -{ -} - -sotExceptionTask:: -sotExceptionTask ( const sotExceptionTask::ErrorCodeEnum& errcode, - const std::string & msg,const char* format, ... ) - :sotExceptionAbstract(errcode,msg) -{ - va_list args; - va_start(args,format); - - const unsigned int SIZE = 256; - char buffer[SIZE]; - vsnprintf(buffer,SIZE,format,args); - - message = buffer; - - va_end(args); -} - - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/src/exception/sotExceptionTools.cpp b/src/exception/sotExceptionTools.cpp deleted file mode 100644 index 729d044f..00000000 --- a/src/exception/sotExceptionTools.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Copyright Projet JRL-Japan, 2007 - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * - * File: sotExceptionTools.cpp - * Project: SOT - * Author: Nicolas Mansard - * - * Version control - * =============== - * - * $Id$ - * - * Description - * ============ - * - * - * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - -#include <sot-core/sotExceptionTools.h> -#include <stdarg.h> -#include <cstdio> - -/* --------------------------------------------------------------------- */ -/* --- CLASS ----------------------------------------------------------- */ -/* --------------------------------------------------------------------- */ - -const std::string sotExceptionTools::EXCEPTION_NAME = "Tools"; - -sotExceptionTools:: -sotExceptionTools ( const sotExceptionTools::ErrorCodeEnum& errcode, - const std::string & msg ) - :sotExceptionAbstract(errcode,msg) -{ -} - -sotExceptionTools:: -sotExceptionTools ( const sotExceptionTools::ErrorCodeEnum& errcode, - const std::string & msg,const char* format, ... ) - :sotExceptionAbstract(errcode,msg) -{ - va_list args; - va_start(args,format); - - const unsigned int SIZE = 256; - char buffer[SIZE]; - vsnprintf(buffer,SIZE,format,args); - - message += buffer; - - va_end(args); -} - - - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/src/exception/sotExceptionTraces.cpp b/src/exception/sotExceptionTraces.cpp deleted file mode 100644 index 131a75c3..00000000 --- a/src/exception/sotExceptionTraces.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Copyright Projet JRL-Japan, 2007 - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * - * File: sotExceptionTraces.cpp - * Project: SOT - * Author: Nicolas Mansard - * - * Version control - * =============== - * - * $Id$ - * - * Description - * ============ - * - * - * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - -#include <sot-core/sotExceptionTraces.h> -#include <stdarg.h> -#include <cstdio> - -/* --------------------------------------------------------------------- */ -/* --- CLASS ----------------------------------------------------------- */ -/* --------------------------------------------------------------------- */ - -const std::string sotExceptionTraces::EXCEPTION_NAME = "Traces"; - -sotExceptionTraces:: -sotExceptionTraces ( const sotExceptionTraces::ErrorCodeEnum& errcode, - const std::string & msg ) - :sotExceptionAbstract(errcode,msg) -{ -} - -sotExceptionTraces:: -sotExceptionTraces ( const sotExceptionTraces::ErrorCodeEnum& errcode, - const std::string & msg,const char* format, ... ) - :sotExceptionAbstract(errcode,msg) -{ - va_list args; - va_start(args,format); - - const unsigned int SIZE = 256; - char buffer[SIZE]; - vsnprintf(buffer,SIZE,format,args); - - message += buffer; - - va_end(args); -} - - - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/src/factory/command/import.cpp b/src/factory/command/import.cpp index d91e3c8f..74acff14 100644 --- a/src/factory/command/import.cpp +++ b/src/factory/command/import.cpp @@ -13,8 +13,8 @@ #include <sot-core/import-default-paths.h> #include <sot-core/import.h> #include <sot-core/sotDebug.h> -#include <sot-core/sotExceptionAbstract.h> -#include <sot-core/sotExceptionFactory.h> +#include <sot-core/exception-abstract.h> +#include <sot-core/exception-factory.h> #include <dynamic-graph/interpreter.h> static const char* ENV_SOT_PATH = "SOT_PATH"; diff --git a/src/factory/sotAdditionalFunctions.cpp b/src/factory/sotAdditionalFunctions.cpp index c9843eea..961165c5 100644 --- a/src/factory/sotAdditionalFunctions.cpp +++ b/src/factory/sotAdditionalFunctions.cpp @@ -23,7 +23,7 @@ #include <sot-core/sotDebug.h> #include <sot-core/sotFactory.h> #include <sot-core/sotAdditionalFunctions.h> -#include <sot-core/sotSignalCast.h> +#include <sot-core/signal-cast.h> #include <dynamic-graph/all-signals.h> #include <sot-core/sotFlags.h> using namespace std; diff --git a/src/factory/sotAdditionalFunctions.h b/src/factory/sotAdditionalFunctions.h index e2d2ca59..87ceae93 100644 --- a/src/factory/sotAdditionalFunctions.h +++ b/src/factory/sotAdditionalFunctions.h @@ -19,7 +19,7 @@ /* SOT */ #include <dynamic-graph/signal-base.h> -#include <sot-core/sotExceptionFactory.h> +#include <sot-core/exception-factory.h> #include <dynamic-graph/pool.h> #include <sot-core/sotPool.h> #include <sot-core/sot-core-api.h> diff --git a/src/factory/sotFactory.h b/src/factory/sotFactory.h index d26fa7dc..3ebf1aa2 100644 --- a/src/factory/sotFactory.h +++ b/src/factory/sotFactory.h @@ -33,7 +33,7 @@ /* --- SOT --- */ class sotFeatureAbstract; class sotTaskAbstract; -#include <sot-core/sotExceptionFactory.h> +#include <sot-core/exception-factory.h> #include <sot-core/sot-core-api.h> #include <dynamic-graph/factory.h> diff --git a/src/factory/sotPool.h b/src/factory/sotPool.h index 133adc65..69eb96c7 100644 --- a/src/factory/sotPool.h +++ b/src/factory/sotPool.h @@ -33,7 +33,7 @@ #include <sstream> /* --- SOT --- */ -#include <sot-core/sotExceptionFactory.h> +#include <sot-core/exception-factory.h> #include <dynamic-graph/signal-base.h> #include <sot-core/sot-core-api.h> #include <dynamic-graph/pool.h> diff --git a/src/feature/sotFeature1D.cpp b/src/feature/sotFeature1D.cpp index f27b8ab1..d27ea722 100644 --- a/src/feature/sotFeature1D.cpp +++ b/src/feature/sotFeature1D.cpp @@ -25,7 +25,7 @@ /* --- SOT --- */ #include <sot-core/sotDebug.h> #include <sot-core/sotFeature1D.h> -#include <sot-core/sotExceptionFeature.h> +#include <sot-core/exception-feature.h> using namespace std; #include <sot-core/sotFactory.h> diff --git a/src/feature/sotFeatureGeneric.cpp b/src/feature/sotFeatureGeneric.cpp index a01b2e30..9ed33cf2 100644 --- a/src/feature/sotFeatureGeneric.cpp +++ b/src/feature/sotFeatureGeneric.cpp @@ -25,7 +25,7 @@ /* --- SOT --- */ #include <sot-core/sotDebug.h> #include <sot-core/sotFeatureGeneric.h> -#include <sot-core/sotExceptionFeature.h> +#include <sot-core/exception-feature.h> using namespace std; #include <sot-core/sotFactory.h> diff --git a/src/feature/sotFeatureJointLimits.cpp b/src/feature/sotFeatureJointLimits.cpp index 1c17aa1e..e31866c9 100644 --- a/src/feature/sotFeatureJointLimits.cpp +++ b/src/feature/sotFeatureJointLimits.cpp @@ -24,7 +24,7 @@ /* --- SOT --- */ #include <sot-core/sotFeatureJointLimits.h> -#include <sot-core/sotExceptionFeature.h> +#include <sot-core/exception-feature.h> #include <sot-core/sotDebug.h> using namespace std; diff --git a/src/feature/sotFeatureLineDistance.cpp b/src/feature/sotFeatureLineDistance.cpp index 79354f35..46b61926 100644 --- a/src/feature/sotFeatureLineDistance.cpp +++ b/src/feature/sotFeatureLineDistance.cpp @@ -25,7 +25,7 @@ /* --- SOT --- */ #include <sot-core/sotDebug.h> #include <sot-core/sotFeatureLineDistance.h> -#include <sot-core/sotExceptionFeature.h> +#include <sot-core/exception-feature.h> #include <sot-core/sotMatrixHomogeneous.h> #include <sot-core/sotMatrixRotation.h> diff --git a/src/feature/sotFeaturePoint6d.cpp b/src/feature/sotFeaturePoint6d.cpp index 6ab4a3e7..61c5760b 100644 --- a/src/feature/sotFeaturePoint6d.cpp +++ b/src/feature/sotFeaturePoint6d.cpp @@ -27,7 +27,7 @@ #define VP_DEBUG_MODE 45 #include <sot-core/sotDebug.h> #include <sot-core/sotFeaturePoint6d.h> -#include <sot-core/sotExceptionFeature.h> +#include <sot-core/exception-feature.h> #include <sot-core/sotMatrixHomogeneous.h> #include <sot-core/sotMatrixRotation.h> diff --git a/src/feature/sotFeaturePoint6dRelative.cpp b/src/feature/sotFeaturePoint6dRelative.cpp index fce490d5..519e4387 100644 --- a/src/feature/sotFeaturePoint6dRelative.cpp +++ b/src/feature/sotFeaturePoint6dRelative.cpp @@ -25,7 +25,7 @@ /* --- SOT --- */ #include <sot-core/sotDebug.h> #include <sot-core/sotFeaturePoint6dRelative.h> -#include <sot-core/sotExceptionFeature.h> +#include <sot-core/exception-feature.h> #include <sot-core/sotMatrixHomogeneous.h> #include <sot-core/sotMatrixRotation.h> diff --git a/src/feature/sotFeatureTask.cpp b/src/feature/sotFeatureTask.cpp index 960abc9b..7d290820 100644 --- a/src/feature/sotFeatureTask.cpp +++ b/src/feature/sotFeatureTask.cpp @@ -25,7 +25,7 @@ /* --- SOT --- */ #include <sot-core/sotDebug.h> #include <sot-core/sotFeatureTask.h> -#include <sot-core/sotExceptionFeature.h> +#include <sot-core/exception-feature.h> #include <dynamic-graph/pool.h> using namespace std; diff --git a/src/feature/sotFeatureVector3.cpp b/src/feature/sotFeatureVector3.cpp index b264cd1a..e09009c8 100644 --- a/src/feature/sotFeatureVector3.cpp +++ b/src/feature/sotFeatureVector3.cpp @@ -27,7 +27,7 @@ #define VP_DEBUG_MODE 45 #include <sot-core/sotDebug.h> #include <sot-core/sotFeatureVector3.h> -#include <sot-core/sotExceptionFeature.h> +#include <sot-core/exception-feature.h> #include <sot-core/sotMatrixHomogeneous.h> #include <sot-core/sotMatrixRotation.h> diff --git a/src/feature/sotFeatureVisualPoint.cpp b/src/feature/sotFeatureVisualPoint.cpp index 4b999468..0c5e1acd 100644 --- a/src/feature/sotFeatureVisualPoint.cpp +++ b/src/feature/sotFeatureVisualPoint.cpp @@ -24,7 +24,7 @@ /* --- SOT --- */ #include <sot-core/sotFeatureVisualPoint.h> -#include <sot-core/sotExceptionFeature.h> +#include <sot-core/exception-feature.h> #include <sot-core/sotDebug.h> using namespace std; diff --git a/src/signal/sotSignalCast.cpp b/src/signal/sotSignalCast.cpp deleted file mode 100644 index d607c08f..00000000 --- a/src/signal/sotSignalCast.cpp +++ /dev/null @@ -1,204 +0,0 @@ -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Copyright Projet JRL-Japan, 2007 - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * - * File: SignalCast.cpp - * Project: SOT - * Author: Nicolas Mansard - * - * Version control - * =============== - * - * $Id$ - * - * Description - * ============ - * - * - * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - -#include <sot-core/sotPool.h> -#include <sot-core/sotSignalCast.h> -#include <iomanip> -#include <sot-core/sotFeatureAbstract.h> - -using namespace std; - -#ifdef WIN32 -#include < Windows.h > -#endif - -SignalCast_sotFeatureAbstractPtr SignalCast<SignalCast_sotFeatureAbstractPtr>:: -cast( std::istringstream& iss ) -{ - SignalCast_sotFeatureAbstractPtr ref; - std::string name; iss >> name; - if( name.length()) - { - ref = &sotPool.getFeature(name); - } - else { ref = NULL; } - return ref; -} - -void SignalCast<SignalCast_sotFeatureAbstractPtr>:: -disp( const SignalCast_sotFeatureAbstractPtr & t,std::ostream& os ) -{ - if( t ) { t->display(os); os<<std::endl; } - else { os << "NULL" << std::endl; } -} - - - -struct timeval SignalCast<struct timeval>:: -cast( std::istringstream& iss ) -{ - int u,s; iss >> s >> u; - struct timeval t; t.tv_sec = s; t.tv_usec = u; - return t; -} -void SignalCast<struct timeval>:: -disp( const struct timeval& t,std::ostream& os ) -{ - os << t.tv_sec << "s "<< t.tv_usec << "ms"; -} - -void SignalCast<sotVectorMultiBound>:: -trace( const sotVectorMultiBound& t,std::ostream& os ) -{ - for( sotVectorMultiBound::const_iterator iter=t.begin();t.end()!=iter;++iter ) - { - switch( iter->mode ) - { - case sotMultiBound::MODE_SINGLE: - os << iter->getSingleBound() << "\t"; - break; - case sotMultiBound::MODE_DOUBLE: - if( iter->getDoubleBoundSetup(sotMultiBound::BOUND_INF) ) - os << iter->getDoubleBound(sotMultiBound::BOUND_INF)<<"\t"; - else os <<"-inf\t"; - if( iter->getDoubleBoundSetup(sotMultiBound::BOUND_SUP) ) - os << iter->getDoubleBound(sotMultiBound::BOUND_SUP)<<"\t"; - else os <<"+inf\t"; - break; - } - } -} - -/* --- VECTOR ---------------------------------------------------------- */ -/* --- VECTOR ---------------------------------------------------------- */ -/* --- VECTOR ---------------------------------------------------------- */ - -maal::boost::DisplayType SignalCast<ml::Vector>::displayType = maal::boost::MATLAB; - -ml::Vector SignalCast<ml::Vector>:: -cast( std::istringstream& iss ) -{ - ml::Vector res; - iss >> res; - return res; -} -void SignalCast<ml::Vector>:: -disp( const ml::Vector& v1,std::ostream& os ) -{ - switch( displayType ) - { - case maal::boost::COMPLET: - for( unsigned int i=0;i<v1.size();++i ) - { if(fabs(v1(i))>1e-6) os << v1(i) << "\t"; else os<<0.00<<"\t"; } - break; - case maal::boost::MATLAB: - os << "[ "; - for( unsigned int i=0;i<v1.size();++i ) - { - os << v1(i); - if( v1.size()!=i+1 ) { os << ", "; } - } - os << "]" << std::endl; - break; - case maal::boost::SIMPLE: - default: - os<<v1.accessToMotherLib() << std::endl; - break; - } -} - -void SignalCast<ml::Vector>:: -trace( const ml::Vector& t,std::ostream& os ) - -{ - for( unsigned int i=0;i<t.size();++i ) - { os << std::setprecision(9)<<t(i) << "\t"; } -} - - - - -/* --- MATRIX --------------------------------------------------- */ -/* --- MATRIX --------------------------------------------------- */ -/* --- MATRIX --------------------------------------------------- */ - -ml::Matrix SignalCast<ml::Matrix>:: -cast( std::istringstream& iss ) -{ - ml::Matrix res; - iss >> res; - return res; -} - -void SignalCast<ml::Matrix>:: -disp( const ml::Matrix& m1,std::ostream& os ) -{ - switch( SignalCast<ml::Vector>::displayType) - { - case ml::COMPLET: - for( unsigned int i=0;i<m1.nbRows();++i ) - { - for( unsigned int j=0;j<m1.nbCols();++j ) - { if(fabs(m1(i,j))>1e-6) os << m1(i,j) << "\t"; else os<<0.00<<"\t"; } - os<<std::endl; - } - break; - case ml::MATLAB: - os << "[ "; - for( unsigned int i=0;i<m1.nbRows();++i ) - { - for( unsigned int j=0;j<m1.nbCols();++j ) - { - os << m1(i,j) << ", "; - } - if( m1.nbRows()!=i+1 ) { os << ";" << std::endl; } - else { os << "]" << std::endl; } - } - break; - case ml::SIMPLE: - default: - os<<m1.matrix<<std::endl; - break; - } -} - -void SignalCast<ml::Matrix>:: -trace( const ml::Matrix& t,std::ostream& os ) -{ - for( unsigned int i=0;i<t.nbRows();++i ) - for( unsigned int j=0;j<t.nbCols();++j ) - { if(fabs(t(i,j))>1e-6) os << t(i,j) << "\t"; else os<<0.00<<"\t"; } -} - -namespace { - SOT_SIGNAL_CAST_DECLARATION(SignalCast_sotFeatureAbstractPtr); - SOT_SIGNAL_CAST_DECLARATION(sotFlags); - SOT_SIGNAL_CAST_DECLARATION(sotVectorMultiBound); - SOT_SIGNAL_CAST_DECLARATION(timeval ); - SOT_SIGNAL_CAST_DECLARATION_NAMED(maal::boost::Vector, maal_boost_Vector); - SOT_SIGNAL_CAST_DECLARATION_NAMED(maal::boost::Matrix, maal_boost_Matrix); - SOT_SIGNAL_CAST_DECLARATION(sotVectorUTheta); - SOT_SIGNAL_CAST_DECLARATION(sotVectorQuaternion); - SOT_SIGNAL_CAST_DECLARATION(sotVectorRollPitchYaw); - SOT_SIGNAL_CAST_DECLARATION(sotMatrixRotation); - SOT_SIGNAL_CAST_DECLARATION(sotMatrixHomogeneous); - SOT_SIGNAL_CAST_DECLARATION(sotMatrixTwist); - SOT_SIGNAL_CAST_DECLARATION(sotMatrixForce); - -} diff --git a/src/task/sotGainAdaptative.cpp b/src/task/sotGainAdaptative.cpp index 73b48440..088cabcb 100644 --- a/src/task/sotGainAdaptative.cpp +++ b/src/task/sotGainAdaptative.cpp @@ -27,7 +27,7 @@ /* --------------------------------------------------------------------- */ #include <sot-core/sotDebug.h> #include <sot-core/sotFactory.h> -#include <sot-core/sotExceptionSignal.h> +#include <sot-core/exception-signal.h> SOT_FACTORY_ENTITY_PLUGIN(sotGainAdaptative,"GainAdaptative"); const double sotGainAdaptative:: @@ -114,7 +114,7 @@ display( std::ostream& os ) const os <<" ("<<coeff_a<<";"<<coeff_b<<";"<<coeff_c<<") "; } -#include <sot-core/sotExceptionTask.h> +#include <sot-core/exception-task.h> void sotGainAdaptative:: commandLine( const std::string& cmdLine, std::istringstream& cmdArgs, diff --git a/src/task/sotGainHyperbolic.cpp b/src/task/sotGainHyperbolic.cpp index 5948ea8f..a0851db8 100644 --- a/src/task/sotGainHyperbolic.cpp +++ b/src/task/sotGainHyperbolic.cpp @@ -27,7 +27,7 @@ #include <sot-core/sotFactory.h> #include <sot-core/sotDebug.h> -#include <sot-core/sotExceptionSignal.h> +#include <sot-core/exception-signal.h> SOT_FACTORY_ENTITY_PLUGIN(sotGainHyperbolic,"GainHyperbolic"); const double sotGainHyperbolic:: @@ -119,7 +119,7 @@ display( std::ostream& os ) const os <<" ("<<coeff_a<<".exp(-"<<coeff_b<<"(x-" << coeff_d << "))+" <<coeff_c; } -#include <sot-core/sotExceptionTask.h> +#include <sot-core/exception-task.h> void sotGainHyperbolic:: commandLine( const std::string& cmdLine, std::istringstream& cmdArgs, -- GitLab