Fix shared memory non-copyable properties

This commit is contained in:
Daniel J. Hofmann 2016-01-13 10:57:05 +01:00 committed by Patrick Niklaus
parent cf30628d4e
commit 25c8711aad

View File

@ -99,6 +99,7 @@ class SharedMemory
SharedMemory() = delete; SharedMemory() = delete;
SharedMemory(const SharedMemory &) = delete; SharedMemory(const SharedMemory &) = delete;
SharedMemory &operator=(const SharedMemory &) = delete;
template <typename IdentifierT> template <typename IdentifierT>
SharedMemory(const boost::filesystem::path &lock_file, SharedMemory(const boost::filesystem::path &lock_file,
@ -208,11 +209,13 @@ class SharedMemory
class SharedMemory class SharedMemory
{ {
SharedMemory(const SharedMemory &) = delete; SharedMemory(const SharedMemory &) = delete;
SharedMemory &operator=(const SharedMemory &) = delete;
// Remove shared memory on destruction // Remove shared memory on destruction
class shm_remove class shm_remove
{ {
private: private:
shm_remove(const shm_remove &) = delete; shm_remove(const shm_remove &) = delete;
shm_remove &operator=(const shm_remove &) = delete;
char *m_shmid; char *m_shmid;
bool m_initialized; bool m_initialized;
@ -375,6 +378,7 @@ template <class LockFileT = OSRMLockFile> class SharedMemoryFactory_tmpl
SharedMemoryFactory_tmpl() = delete; SharedMemoryFactory_tmpl() = delete;
SharedMemoryFactory_tmpl(const SharedMemoryFactory_tmpl &) = delete; SharedMemoryFactory_tmpl(const SharedMemoryFactory_tmpl &) = delete;
SharedMemoryFactory_tmpl &operator=(const SharedMemoryFactory_tmpl &) = delete;
}; };
using SharedMemoryFactory = SharedMemoryFactory_tmpl<>; using SharedMemoryFactory = SharedMemoryFactory_tmpl<>;