μHAL (v2.8.17)
Part of the IPbus software repository
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SharedObject.hpp
Go to the documentation of this file.
1
2#ifndef _uhal_detail_SharedObject_hpp_
3#define _uhal_detail_SharedObject_hpp_
4
5#include <string>
6
7#include <boost/interprocess/managed_shared_memory.hpp>
8
9
10namespace uhal {
11namespace detail {
12
14template <class T>
16public:
17
18 SharedObject(const SharedObject<T>&) = delete;
20
21 SharedObject(const std::string& aName);
23
24 T* operator->();
25
26 T& operator*();
27
28private:
29 std::string mName;
30 boost::interprocess::managed_shared_memory mSharedMem;
31 T* mObj;
32};
33
34}
35}
36
37#endif
Wrapper for C++ object that's placed in shared memory.
SharedObject(const SharedObject< T > &)=delete
SharedObject< T > & operator=(const SharedObject< T > &)=delete
boost::interprocess::managed_shared_memory mSharedMem