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 T * operator->() const
Dereference constant shared memory type member.
const T & operator*() const
Dereference constant shared memory type.
size_t size() const noexcept
Get the shared memory type size.
bool owner() const
Get the shared memory type owner flag (true if the new one was created, false if the existing one was...
T & ref()
Get the shared memory type reference.
T * operator->()
Dereference shared memory type member.
T * ptr()
Get the shared memory type pointer.
const std::string & name() const noexcept
Get the shared memory type name.
SharedType< T > & operator=(SharedType< T > &&)=delete
const T & ref() const
Get the constant shared memory type reference.
SharedType(SharedType< T > &&)=delete
SharedType< T > & operator=(const SharedType< T > &)=delete
const T * ptr() const
Get the constant shared memory type pointer.
T & operator*()
Dereference shared memory type.
SharedType(const SharedType< T > &)=delete
C++ Common project definitions.
Shared memory manager definition.
Shared memory type inline implementation.