Commit 301de89d authored by florent's avatar florent
Browse files

Do not rethrow exception, since boost exceptions derive from std::exception

   * include/dynamic-graph/signal-caster.h,
   * include/dynamic-graph/signal.t.cpp.
parent f2b43796
......@@ -103,12 +103,7 @@ template<typename T> void signal_disp(const T& value, std::ostream& os)
template<typename T> T signal_cast(std::istringstream& iss)
{
try {
return boost::any_cast<T>(g_caster.cast(typeid(T), iss));
} catch (...) {
throw ExceptionSignal(ExceptionSignal::GENERIC,
"Exception boost::any_cast");
}
return boost::any_cast<T>(g_caster.cast(typeid(T), iss));
}
template<typename T> void signal_trace(const T& value, std::ostream& os)
......
......@@ -59,32 +59,14 @@ template< class T,class Time >
void Signal<T,Time>::
set( std::istringstream& stringValue )
{
try
{
(*this) = signal_cast<T>( stringValue );
}
catch DG_RETHROW
catch (...)
{ DG_THROW ExceptionSignal( ExceptionSignal::SET_IMPOSSIBLE,
"Set operation not possible with this signal. ",
"(bad cast while setting %s).",this->getName().c_str());
}
(*this) = signal_cast<T>( stringValue );
}
template< class T,class Time >
void Signal<T,Time>::
get( std::ostream& os ) const
{
try { signal_disp<T>( this->accessCopy(),os ); }
catch DG_RETHROW
catch (...)
{ DG_THROW ExceptionSignal( ExceptionSignal::SET_IMPOSSIBLE,
"get operation not possible with this signal. ",
"(bad cast while getting value from %s).",
SignalBase<Time>::getName().c_str());
}
signal_disp<T>( this->accessCopy(),os );
}
template< class T,class Time >
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment