7 #ifndef __FWSERVICES_OP_GET_HXX__ 8 #define __FWSERVICES_OP_GET_HXX__ 10 #include "fwServices/IService.hpp" 11 #include "fwServices/op/Add.hpp" 12 #include "fwServices/registry/ObjectService.hpp" 19 template<
class SERVICE>
22 auto services = ::fwServices::OSR::getServices< SERVICE >( obj );
24 OSLM_ASSERT(
"Service "<<serviceType<<
" not unique, registered "<<services.size()<<
" time", services.size() == 1);
25 return *services.begin();
FWSERVICES_API::fwServices::IService::sptr get(::fwData::Object::sptr obj, std::string serviceType)
Get the first service of type serviceType which is attached to obj.
#define OSLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...
Namespace fwServices is dedicated to (mimic) the dynamic affectation of methods to (pure data) object...
Type demangler. Use Demangler class to get a demangled string for the type T.
Contains the representation of the data objects used in the framework.