23 #ifndef USSERVICETRACKER_H
24 #define USSERVICETRACKER_H
59 template<
class T,
class TTT>
67 throw std::runtime_error(
"A custom ServiceTrackerCustomizer instance is required for custom tracked objects.");
74 throw std::runtime_error(
"A custom ServiceTrackerCustomizer instance is required for custom tracked objects.");
80 template<
class S,
class T>
81 struct TrackedTypeTraits;
95 template<
class S,
class T>
118 struct TrackedTypeTraits<S,S*>
120 typedef S* TrackedType;
122 static bool IsValid(
const TrackedType& t)
127 static TrackedType DefaultValue()
132 static void Dispose(TrackedType& t)
137 static TrackedType ConvertToTrackedType(S* s)
152 struct TrackedTypeTraits<void,void*>
156 static bool IsValid(
const TrackedType& t)
161 static TrackedType DefaultValue()
163 return TrackedType();
166 static void Dispose(TrackedType& t)
171 static TrackedType ConvertToTrackedType(
const InterfaceMap& im)
230 template<
class S,
class TTT = TrackedTypeTraits<S,S*> >
238 typedef typename TTT::TrackedType
T;
267 const ServiceReferenceType& reference,
357 virtual void Close();
376 virtual T WaitForService(
unsigned long timeoutMillis = 0);
384 virtual std::vector<ServiceReferenceType> GetServiceReferences()
const;
405 virtual ServiceReferenceType GetServiceReference()
const;
417 virtual T GetService(
const ServiceReferenceType& reference)
const;
432 virtual std::vector<T> GetServices()
const;
445 virtual T GetService()
const;
457 virtual void Remove(
const ServiceReferenceType& reference);
465 virtual int Size()
const;
486 virtual int GetTrackingCount()
const;
500 virtual void GetTracked(TrackingMap& tracked)
const;
508 virtual bool IsEmpty()
const;
538 T AddingService(
const ServiceReferenceType& reference);
555 void ModifiedService(
const ServiceReferenceType& reference, T service);
578 void RemovedService(
const ServiceReferenceType& reference, T service);
590 _ServiceTrackerPrivate*
const d;
597 #endif // USSERVICETRACKER_H
ServiceReference< S > ServiceReferenceType
std::map< ServiceReference< S >, T > TrackingMap
S ServiceType
The type of the service being tracked.
static bool IsValid(const TrackedType &t)
std::map< std::string, void * > InterfaceMap
static TrackedType DefaultValue()
static TrackedType ConvertToTrackedType(void *)
TTT::TrackedType T
The type of the tracked object.
static TrackedType ConvertToTrackedType(const InterfaceMap &)
static void Dispose(TrackedType &t)