9 #include "fwServices/config.hpp" 11 #include <fwCore/mt/types.hpp> 13 #include <fwRuntime/Bundle.hpp> 15 #include <fwTools/Object.hpp> 17 #include <boost/unordered_map.hpp> 19 #include <unordered_map> 38 typedef std::string KeyType;
39 typedef std::vector<KeyType> KeyVectorType;
40 typedef std::pair<std::string, std::string> StringPair;
44 typedef std::function< SPTR(::fwServices::IService)() > FactoryType;
52 FWSERVICES_API
void parseBundleInformation( );
54 FWSERVICES_API
void addServiceFactory( FactoryType _factory,
55 const
std::
string& simpl,
56 const
std::
string& stype);
58 FWSERVICES_API
void addObjectFactory( const
std::
string& simpl,
59 const
std::
string& oimpl);
62 FWSERVICES_API
SPTR(
IService) create( const
std::
string& _srvImpl ) const;
65 FWSERVICES_API
SPTR(
IService) create( const
std::
string& _srvType, const
std::
string& _srvImpl ) const;
67 FWSERVICES_API
void clearFactory();
70 FWSERVICES_API
std::vector<
std::
string > getImplementationIdFromObjectAndType(const
std::
string&
object,
71 const
std::
string& type) const;
74 FWSERVICES_API
std::
string getDefaultImplementationIdFromObjectAndType( const
std::
string&
object,
75 const
std::
string& type ) const;
78 FWSERVICES_API const
std::vector<
std::
string>& getServiceObjects(const
std::
string& srvImpl) const;
81 FWSERVICES_API
std::
string getServiceDescription(const
std::
string& srvImpl) const;
84 FWSERVICES_API
std::
string getServiceTags(const
std::
string& srvImpl) const;
87 FWSERVICES_API
bool checkServiceValidity(const
std::
string&
object, const
std::
string& srvImpl) const;
93 FWSERVICES_API
bool support(const
std::
string&
object, const
std::
string& srvType);
99 FWSERVICES_API
bool support(const
std::
string&
object, const
std::
string& srvType,
100 const
std::
string& srvImpl) const;
105 FWSERVICES_API virtual KeyVectorType getFactoryKeys() const;
111 std::string serviceType;
112 std::vector<std::string> objectImpl;
115 std::shared_ptr< ::fwRuntime::Bundle > bundle;
117 bool objectsSetFromBundle {
false};
119 typedef std::unordered_map< KeyType, ServiceInfo > SrvRegContainer;
125 void printInfoMap(
const SrvRegContainer& src )
const;
131 void checkServicesNotDeclaredInPluginXml()
const;
134 SrvRegContainer m_srvImplTosrvInfo;
135 SupportMapType m_supportMap;
137 mutable ::fwCore::mt::ReadWriteMutex m_srvImplTosrvInfoMutex;
138 mutable ::fwCore::mt::ReadWriteMutex m_supportMapMutex;
Base class for all services.
Contains fwAtomsFilter::registry details.
Base class for all FW4SPL's classes.
Namespace fwServices is dedicated to (mimic) the dynamic affectation of methods to (pure data) object...
Contains fwAtomsFilter::factory utilities.
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
::boost::unordered_map< StringPair, bool > SupportMapType
We keep boost here because std implementation does not support a pair of std::string as key...