libsharememory.h 918 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef RVC_LOG_LIBSHAREMEMRY
  2. #define RVC_LOG_LIBSHAREMEMRY
  3. #ifdef _WIN32
  4. #include <windows.h>
  5. #else
  6. #include <sys/mman.h>
  7. #include <unistd.h>
  8. #include <fcntl.h>
  9. #include <semaphore.h>
  10. #include <time.h>
  11. #ifndef MAX_PATH
  12. #define MAX_PATH 260
  13. #endif // !MAX_PATH
  14. #ifndef INFINITE
  15. #define INFINITE 0xFFFFFFFF // Infinite timeout
  16. #endif // !INFINITE
  17. #endif //_WIN32
  18. //using namespace std ;
  19. class sharememory_impl4sdk; //桥接
  20. // 此类是从 libsharememory.dll 导出的
  21. class Clibsharememory4SDK
  22. {
  23. public:
  24. Clibsharememory4SDK(void);
  25. ~Clibsharememory4SDK();
  26. // TODO: 在此添加您的方法。
  27. void Unlock();
  28. bool IsLocked();
  29. void* Lock(unsigned int dwWaitTimeout=INFINITE);
  30. bool IsValid();
  31. unsigned int GetBytes();
  32. void Close();
  33. bool Open(const char* szName, unsigned int dwBytes);
  34. bool Create(const char* szName, unsigned int dwBytes);
  35. private:
  36. sharememory_impl4sdk*m_pImpl;
  37. };
  38. #endif