34 #include <boost/bind.hpp>
40 mPluginContext(context),
44 this->initServiceListener();
49 return mStreamerService->getName();
54 return mStreamerService->getType();
59 return mStreamerService->getSettings(root);
64 return mStreamerService->createStreamer(root);
67 void StreamerServiceProxy::initServiceListener()
71 boost::bind(&StreamerServiceProxy::onServiceAdded,
this, _1),
73 boost::bind(&StreamerServiceProxy::onServiceRemoved,
this, _1)
75 mServiceListener->open();
78 void StreamerServiceProxy::onServiceAdded(StreamerService* service)
80 if(service && service->getName() == mServiceName)
81 mStreamerService.reset(service, null_deleter());
84 void StreamerServiceProxy::onServiceRemoved(StreamerService *service)
86 if(service && (service->getName() == mServiceName))
static StreamerServicePtr getNullObject()
virtual QString getType() const
virtual StreamerPtr createStreamer(QDomElement root)
virtual QString getName()
Helper class for listening to services being added, modified and removed.
StreamerServiceProxy(ctkPluginContext *context, QString name)
Abstract class. Interface to Streamers.
virtual std::vector< PropertyPtr > getSettings(QDomElement root)
boost::shared_ptr< class Streamer > StreamerPtr