9 #ifndef CPPCOMMON_SYSTEM_SHARED_TYPE_H
10 #define CPPCOMMON_SYSTEM_SHARED_TYPE_H
43 explicit operator bool()
const {
return (_shared.
ptr() !=
nullptr); }
56 const std::string&
name() const noexcept {
return _shared.
name(); }
58 size_t size() const noexcept {
return _shared.
size(); }
61 T*
ptr() {
return (T*)_shared.
ptr(); }
63 const T*
ptr()
const {
return (
const T*)_shared.
ptr(); }
68 const T&
ref()
const {
return *
ptr(); }
void * ptr()
Get the shared memory block pointer.
bool owner() const
Get the shared memory owner flag (true if the new one was created, false if the existing one was open...
size_t size() const noexcept
Get the shared memory block size.
const std::string & name() const noexcept
Get the shared memory block name.
const std::string & name() const noexcept
Get the shared memory type name.
const T & operator*() const
Dereference constant shared memory type.
size_t size() const noexcept
Get the shared memory type size.
const T * ptr() const
Get the constant shared memory type pointer.
SharedType< T > & operator=(SharedType< T > &&)=delete
bool owner() const
Get the shared memory type owner flag (true if the new one was created, false if the existing one was...
const T & ref() const
Get the constant shared memory type reference.
T * operator->()
Dereference shared memory type member.
SharedType< T > & operator=(const SharedType< T > &)=delete
SharedType(const std::string &name)
Create a new or open existing shared memory type with a given name.
SharedType(SharedType< T > &&)=delete
T * ptr()
Get the shared memory type pointer.
T & operator*()
Dereference shared memory type.
const T * operator->() const
Dereference constant shared memory type member.
T & ref()
Get the shared memory type reference.
SharedType(const SharedType< T > &)=delete
C++ Common project definitions.
Shared memory manager definition.
Shared memory type inline implementation.