Skip to content
Snippets Groups Projects
Commit f6aa64d8 authored by olivier stasse's avatar olivier stasse
Browse files

Allow to access class name of a signal.

parent 2a99a459
No related branches found
No related tags found
No related merge requests found
......@@ -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&)
{}
......
......@@ -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
......
......@@ -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; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment