μHAL (v2.8.17)
Part of the IPbus software repository
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SharedObject.cpp
Go to the documentation of this file.
1
3
4
6
7
8namespace uhal {
9namespace detail {
10
11template <class T>
12SharedObject<T>::SharedObject(const std::string& aName) :
13 mName(aName),
14 mSharedMem(boost::interprocess::open_or_create, aName.c_str(), 1024, 0x0, boost::interprocess::permissions(0666)),
15 mObj(mSharedMem.find_or_construct<T>(boost::interprocess::unique_instance)())
16{
17}
18
19template <class T>
22 // boost::interprocess::shared_memory_object::remove(mName.c_str());
23}
25template <class T>
27{
28 return mObj;
29}
30
31template <class T>
33{
34 return *mObj;
35}
36
37
39
40}
41}
Wrapper for C++ object that's placed in shared memory.
SharedObject(const SharedObject< T > &)=delete
const char * c_str(Args &&...args)
Constructs a std::string with the given arguments, stores it in internals, and returns its c_str().
Definition: internals.h:534