123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- #include "ResDataObject.h"
- #include <dlfcn.h>
- class CDInterface;
- static CDInterface* g_CDInterface = NULL;
- typedef CDInterface* (*GetCDInterface)();
- class CDInterface {
- public :
- CDInterface() {};
- virtual ~CDInterface() {};
- static CDInterface* GetCDI(const char* szModuleName = "CDIX64.so") {
- if (!g_CDInterface) {
- void* hCDI = dlopen(szModuleName, RTLD_LAZY);
- if (!hCDI)
- return nullptr;
- GetCDInterface func = reinterpret_cast<GetCDInterface>(dlsym(hCDI, "GetCDI"));
- if (!func) {
- dlclose(hCDI);
- return nullptr;
- }
- g_CDInterface = func();
- }
- return g_CDInterface;
- }
- //virtual bool RegistClient(UINT64 Address) = 0;
- //virtual bool UnRegistClient(UINT64 Address) = 0;
- //virtual bool ReceivedFromLocalBus(ResDataObject &packet) = 0;
- //virtual bool ReceivedFromEthBus(ResDataObject &packet) = 0;
- //virtual bool ReceivedFromClient(ResDataObject &packet) = 0;
- virtual bool ReceivedFromDevice(ResDataObject &packet) = 0;
- //virtual bool ReceivedDeviceNotify(ResDataObject &packet) = 0;
- virtual bool Registhandle(void * Handle) = 0;
- virtual bool UnRegistHandle(UINT64 CrcCode) = 0;
- //virtual bool RegistThread(PVOID pDiosThread) = 0;
- //virtual void UnRegistThread(DWORD Tid) = 0;
- //virtual bool GetThreadsLogger(DWORD Tid, PVOID& pLogger) = 0;
- };
|