svc_enum.h 523 B

123456789101112131415161718192021222324
  1. #ifndef _SVC_ENUM_H
  2. #define _SVC_ENUM_H
  3. // try to use this one, it does a clientLock for you
  4. #include <api/service/waservicefactory.h>
  5. template <class T>
  6. class castService {
  7. public:
  8. castService(waServiceFactory *w, int global_lock=TRUE) : was(w), gl(global_lock) { }
  9. operator T *() {
  10. if (was == NULL) return NULL;
  11. T *ret = static_cast<T *>(was->getInterface(gl));
  12. return ret;
  13. }
  14. private:
  15. waServiceFactory *was;
  16. int gl;
  17. };
  18. #include "svcenumbyguid.h"
  19. #include "svcenum.h"
  20. #include "svcenumt.h"
  21. #endif