CppCommon 1.0.6.0
C++ Common Library
Loading...
Searching...
No Matches
shared_type.inl
Go to the documentation of this file.
1
8
9namespace CppCommon {
10
11template <typename T>
12inline SharedType<T>::SharedType(const std::string& name) : _shared(name, sizeof(T))
13{
14 // Check for the owner flag
15 if (_shared.owner())
16 {
17 // Call in place constructor
18 new (_shared.ptr()) T();
19 }
20}
21
22} // namespace CppCommon
SharedType(const std::string &name)
Create a new or open existing shared memory type with a given name.
const std::string & name() const noexcept
Get the shared memory type name.
Definition shared_type.h:56
C++ Common project definitions.