Initial community commit
This commit is contained in:
parent
537bcbc862
commit
fc06254474
16440 changed files with 4239995 additions and 2 deletions
30
Src/Wasabi/api/service/svcenumt.h
Normal file
30
Src/Wasabi/api/service/svcenumt.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
#ifndef _SVCENUMT_H
|
||||
#define _SVCENUMT_H
|
||||
|
||||
#include "svcenum.h"
|
||||
|
||||
template <class T>
|
||||
class SvcEnumT : private SvcEnum {
|
||||
protected:
|
||||
SvcEnumT() { type = T::getServiceType(); }
|
||||
|
||||
public:
|
||||
void reset() { SvcEnum::reset(); }
|
||||
T *getFirst(int global_lock = TRUE) { reset(); return getNext(global_lock); }
|
||||
T *getNext(int global_lock = TRUE) { return static_cast<T*>(_getNext(global_lock)); }
|
||||
|
||||
// these would just be 'using' but msvc.net sucks butt
|
||||
inline int release(void *ptr) { return SvcEnum::release(ptr); }
|
||||
inline waServiceFactory *getLastFactory() { return SvcEnum::getLastFactory(); }
|
||||
|
||||
protected:
|
||||
// override this one (or don't if you want to return all of them)
|
||||
virtual int testService(T *svc) { return TRUE; }
|
||||
|
||||
private:
|
||||
virtual int _testService(void *svc) {
|
||||
return testService(static_cast<T *>(svc));
|
||||
}
|
||||
};
|
||||
|
||||
#endif // _SVCENUMT_H
|
Loading…
Add table
Add a link
Reference in a new issue