1 #ifndef SERVICECOMPONENT_HPP
2 #define SERVICECOMPONENT_HPP
4 #include "Component.hpp"
18 virtual void init() {}
21 virtual void removeInstance()
override;
23 virtual void propertyReceived(
const PropertyKey &key,
24 const PropertyValue &value)
override;
26 typedef std::shared_ptr<ServiceInstance> ServiceInstancePtr;
35 typedef std::function<ServiceInstancePtr(ComponentPtr)> CreateFunction;
39 virtual void placeholderStatusChanged(
const NodeId&
id)
override;
42 virtual ComponentInstancePtr instanceImpl()
override;
43 virtual void initPlaceholder(ComponentPlaceholderPtr placeholder)
override;
46 CreateFunction m_createFunc;
48 typedef std::shared_ptr<ServiceComponent> ServiceComponentPtr;
52 #define SHOWCASE_SERVICE_COMPONENT(name, type) \
54 Showcase::FactoryRegistrant<Showcase::ServiceComponent> MW_PLUGIN_CONCAT(component, __LINE__) \
55 (name, [] { return std::make_shared<Showcase::ServiceComponent>(\
56 [] (Showcase::ComponentPtr comp){ return std::make_shared<type>(comp); } ); }); \
59 #endif // SERVICECOMPONENT_HPP