OpenDaVINCI  4.16.0
POSIXSharedMemory.h
Go to the documentation of this file.
1 
20 #ifndef OPENDAVINCI_CORE_WRAPPER_POSIX_POSIXSHAREDMEMORY_H_
21 #define OPENDAVINCI_CORE_WRAPPER_POSIX_POSIXSHAREDMEMORY_H_
22 
23 #include <semaphore.h>
24 #include <string>
25 
29 
30 namespace odcore { namespace wrapper { template <odcore::wrapper::SystemLibraryProducts product> class SharedMemoryFactoryWorker; } }
31 
32 namespace odcore {
33  namespace wrapper {
34  namespace POSIX {
35 
36  using namespace std;
37 
44  private:
46 
53  POSIXSharedMemory(const string &name, const uint32_t &size);
54 
60  POSIXSharedMemory(const string &name);
61 
62  private:
69 
75  POSIXSharedMemory& operator=(const POSIXSharedMemory &);
76 
77  public:
78  virtual ~POSIXSharedMemory();
79 
80  virtual bool isValid() const;
81 
82  virtual const string getName() const;
83 
84  virtual void lock();
85 
86  virtual void unlock();
87 
88  virtual void* getSharedMemory() const;
89 
90  virtual uint32_t getSize() const;
91 
92  private:
93  string m_name;
94  string m_internalName;
95  bool m_releaseSharedMemory;
96  int32_t m_shmID;
97  sem_t* m_mutexSharedMemory;
98  void *m_sharedMemory;
99  uint32_t m_size;
100 
107  uint32_t getCRC32(const string &s) const;
108  };
109 
110  }
111  }
112 } // odcore::wrapper::POSIX
113 
114 #endif /*OPENDAVINCI_CORE_WRAPPER_POSIX_POSIXSHAREDMEMORY_H_*/
Definition: POSIXSharedMemory.h:43
Definition: SharedMemory.h:38
Definition: POSIXSharedMemory.h:30
Definition: SystemLibraryProducts.h:28