12 #ifndef CXSERVICETRACKERCUSTOMIZER_H_
13 #define CXSERVICETRACKERCUSTOMIZER_H_
15 #include <boost/function.hpp>
17 #include "ctkServiceTracker.h"
18 #include "ctkServiceTrackerCustomizer.h"
41 T* service = reference.getPlugin()->getPluginContext()->getService<T>(reference);
42 if(mServiceAddedFunction)
43 mServiceAddedFunction(service);
48 if(mServiceModifiedFunction)
49 mServiceModifiedFunction(service);
52 virtual void removedService(
const ctkServiceReference &reference, T* service)
54 if(mServiceRemovedFunction)
55 mServiceRemovedFunction(service);
56 reference.getPlugin()->getPluginContext()->ungetService(reference);
61 mServiceAddedFunction = func;
65 mServiceModifiedFunction = func;
69 mServiceRemovedFunction = func;
73 boost::function<void (T*)> mServiceAddedFunction;
74 boost::function<void (T*)> mServiceModifiedFunction;
75 boost::function<void (T*)> mServiceRemovedFunction;