From 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d Mon Sep 17 00:00:00 2001 From: Jef Date: Tue, 24 Sep 2024 14:54:57 +0200 Subject: Initial community commit --- Src/bmp/MyFactory.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Src/bmp/MyFactory.h (limited to 'Src/bmp/MyFactory.h') diff --git a/Src/bmp/MyFactory.h b/Src/bmp/MyFactory.h new file mode 100644 index 00000000..5e9db1d6 --- /dev/null +++ b/Src/bmp/MyFactory.h @@ -0,0 +1,39 @@ +#ifndef _MYFACTORY_H_ +#define _MYFACTORY_H_ + +#include "api__bmp.h" +#include +#include + +template +class MyFactory : public waServiceFactory +{ +public: + MyFactory(GUID guid) : guid(guid) {} + FOURCC GetServiceType() { return T::getServiceType(); } + const char *GetServiceName() { return T::getServiceName(); } + GUID GetGUID() { return guid; } + void *GetInterface(int global_lock) { return (Base*)new T; } + int SupportNonLockingInterface() {return 1;} + int ReleaseInterface(void *ifc) { delete static_cast(static_cast(ifc)); return 1; } + const char *GetTestString() {return 0;} + int ServiceNotify(int msg, int param1, int param2) {return 1;} +private: + GUID guid; +protected: + #define CBCLASS MyFactory + START_DISPATCH_INLINE; + CB(WASERVICEFACTORY_GETSERVICETYPE, GetServiceType) + CB(WASERVICEFACTORY_GETSERVICENAME, GetServiceName) + CB(WASERVICEFACTORY_GETGUID, GetGUID) + CB(WASERVICEFACTORY_GETINTERFACE, GetInterface) + CB(WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE, SupportNonLockingInterface) + CB(WASERVICEFACTORY_RELEASEINTERFACE, ReleaseInterface) + CB(WASERVICEFACTORY_GETTESTSTRING, GetTestString) + CB(WASERVICEFACTORY_SERVICENOTIFY, ServiceNotify) + END_DISPATCH; + #undef CBCLASS + //RECVS_DISPATCH; +}; + +#endif \ No newline at end of file -- cgit