29 #ifndef DATATOOLS_SERVICE_TOOLS_INL_H 30 #define DATATOOLS_SERVICE_TOOLS_INL_H 49 const std::type_info & ti =
typeid(T);
50 const std::type_info & tf =
typeid(srvc);
63 const std::type_info & ti =
typeid(T);
64 const std::type_info & tf =
typeid(srvc);
65 DT_THROW_IF(ti != tf, std::logic_error,
"Service '" << service_name_ <<
"' is not of requested type!");
66 return dynamic_cast<T &>(srvc);
78 const std::type_info & ti =
typeid(T);
79 const std::type_info & tf =
typeid(srvc);
80 DT_THROW_IF(ti != tf, std::logic_error,
"Service '" << service_name_ <<
"' is not of requested type!");
81 return dynamic_cast<const T &>(srvc);
86 #endif // DATATOOLS_SERVICE_TOOLS_INL_H
#define DT_THROW_IF(Condition, ExceptionType, Message)
Definition: exception.h:76