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;
357 virtual void Close();
376 virtual T WaitForService(
unsigned long timeoutMillis = 0);
384 virtual std::vector<ServiceReferenceType> GetServiceReferences()
const;
432 virtual std::vector<T> GetServices()
const;
445 virtual T GetService()
const;
465 virtual int Size()
const;
486 virtual int GetTrackingCount()
const;
500 virtual void GetTracked(
TrackingMap& tracked)
const;
508 virtual bool IsEmpty()
const;
595 #include "usServiceTracker.tpp"
597 #endif // USSERVICETRACKER_H