diff --git a/include/dynamic-graph/signal-base.h b/include/dynamic-graph/signal-base.h index 0f6eb341f48e02841c116e199712e9348df13035..ab379d74ebe5aa209096681127fd13dc5c9ac010 100644 --- a/include/dynamic-graph/signal-base.h +++ b/include/dynamic-graph/signal-base.h @@ -20,7 +20,7 @@ # include <string> # include <sstream> # include <iostream> - +# include <typeinfo> # include <boost/noncopyable.hpp> # include <dynamic-graph/fwd.hh> @@ -72,6 +72,9 @@ namespace dynamicgraph return name; } + void getClassName(std::string & aClassName) const + { aClassName = typeid(this).name(); } + virtual void setPeriodTime (const Time&) {} diff --git a/include/dynamic-graph/signal-ptr.t.cpp b/include/dynamic-graph/signal-ptr.t.cpp index 82b03bd414f6169687605a5faab0e763983d46bd..5f9da340275ea65d854605e5ed19ae2716b5faa0 100644 --- a/include/dynamic-graph/signal-ptr.t.cpp +++ b/include/dynamic-graph/signal-ptr.t.cpp @@ -121,9 +121,12 @@ namespace dynamicgraph transmitAbstract = false; DG_THROW ExceptionSignal( ExceptionSignal::PLUG_IMPOSSIBLE, "Compl. Uncompatible types for plugin.", - "(while trying to plug <%s> on <%s>).", + "(while trying to plug <%s> on <%s>)" + " with types <%s> on <%s>.", unknown_ref->getName ().c_str (), - this->getName ().c_str ()); + this->getName ().c_str (), + typeid(T).name(), + typeid(unknown_ref).name()); } } else diff --git a/include/dynamic-graph/signal.h b/include/dynamic-graph/signal.h index e06aa88d6b3d49a7cd20a865820a47c7ebcd0b1b..d70f1fc34e123d0372e1d4305145e25dd9e2f122 100644 --- a/include/dynamic-graph/signal.h +++ b/include/dynamic-graph/signal.h @@ -30,7 +30,6 @@ #include <dynamic-graph/exception-signal.h> #include <dynamic-graph/signal-base.h> - #ifdef HAVE_LIBBOOST_THREAD #include <boost/thread.hpp> #endif @@ -126,7 +125,9 @@ protected: virtual inline const T& operator ()( const Time & t ){ return access(t); } virtual Signal<T,Time>& operator= ( const T& t ); inline operator const T& () const { return accessCopy (); } - + virtual void getClassName(std::string & aClassName) const + { aClassName = typeid(this).name(); } + public: virtual void checkCompatibility () { throw Tcopy; }