dxd - dynax driver framework 3.0.0d222
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx::shared::memory< buffer_t > Class Template Reference

macOS user space shared memory More...

#include <dx_shared_memory.h>

Inheritance diagram for dx::shared::memory< buffer_t >:
Collaboration diagram for dx::shared::memory< buffer_t >:

Classes

struct  header

Public Member Functions

 catch (...)
 catch (...)
void free () noexcept
void free () noexcept
memoryinitialize (const std::string &name, uint32_t version, size_t size=0)
memoryinitialize (const std::string &name, uint32_t version, size_t size=0)
memoryinitialize (size_t size=0)
memoryinitialize (size_t size=0)
referenceinitialize (const std::string &name)
 memory ()=default
 memory ()=default
 memory (const std::string &name, uint32_t version, size_t size=0) noexcept
 memory (const std::string &name, uint32_t version, size_t size=sizeof(buffer_t) - sizeof(header)) noexcept
 operator bool () const noexcept
 true if this shared memory is currently in use by some process - a cheap, non-destructive existence probe (shm_open without O_CREAT, then immediately close) that neither maps nor creates anything itself.
 operator bool () const noexcept
 true if this shared memory is currently in use by some process - a cheap, non-destructive existence probe (open, then immediately close, the underlying file mapping object by name) that neither maps nor creates anything itself. Crash-safe without any separate refcounting primitive: the OS keeps the file mapping kernel object alive exactly as long as any process holds a real (mapped) handle to it, closing it automatically on that process' crash/exit.
 operator buffer_t & ()
 operator buffer_t & ()
 operator buffer_t * ()
 operator buffer_t * ()
 operator const os_event () const noexcept
 operator const os_event () const noexcept
 operator os_event () noexcept
 operator os_event () noexcept
 operator struct ::stat ()
buffer_t & operator* ()
buffer_t & operator* ()
buffer_t * operator-> ()
buffer_t * operator-> ()
 operator::HANDLE () const noexcept
 operator::HANDLE () const noexcept
memoryoperator= (const buffer_t &buffer)
memoryoperator= (const buffer_t &buffer)
bool release () noexcept
 releases this hold
bool release () noexcept
 releases this hold
size_t size () const
 ~memory ()
 ~memory () noexcept

Public Attributes

bool joined {}
 true if initialize() found another holder already present, false if this was the first

Protected Attributes

::HANDLE process
::HANDLE process

Detailed Description

template<typename buffer_t>
class dx::shared::memory< buffer_t >

macOS user space shared memory

windows user space shared memory

The constructor only stores the canonical name/version/size - the actual mapping only happens once the buffer is first genuinely requested (through one of the pointer/reference accessors), not eagerly at construction: whichever side (server or client) first actually wants the buffer becomes the creator, rather than whichever side's device object simply happens to construct first.

The constructor only stores the requested name/version/size - the actual mapping only happens once the buffer is first genuinely requested (through one of the pointer/reference accessors), not eagerly at construction: whichever side (server or client) first actually wants the buffer becomes the creator, rather than whichever side's device object simply happens to construct first.

Constructor & Destructor Documentation

◆ memory() [1/4]

template<typename buffer_t>
dx::shared::memory< buffer_t >::memory ( )
default

◆ memory() [2/4]

template<typename buffer_t>
dx::shared::memory< buffer_t >::memory ( const std::string & name,
uint32_t version,
size_t size = 0 )
inlinenoexcept

◆ ~memory() [1/2]

template<typename buffer_t>
dx::shared::memory< buffer_t >::~memory ( )
inline

◆ memory() [3/4]

template<typename buffer_t>
dx::shared::memory< buffer_t >::memory ( )
default

◆ memory() [4/4]

template<typename buffer_t>
dx::shared::memory< buffer_t >::memory ( const std::string & name,
uint32_t version,
size_t size = sizeof(buffer_t)- sizeof(header) )
inlinenoexcept

◆ ~memory() [2/2]

template<typename buffer_t>
dx::shared::memory< buffer_t >::~memory ( )
inlinenoexcept

Member Function Documentation

◆ catch() [1/2]

template<typename buffer_t>
dx::shared::memory< buffer_t >::catch ( ...)
inline

◆ catch() [2/2]

template<typename buffer_t>
dx::shared::memory< buffer_t >::catch ( ...)
inline

◆ free() [1/2]

template<typename buffer_t>
void dx::shared::memory< buffer_t >::free ( )
inlinevirtualnoexcept

Reimplemented from dx::resource< nullptr >.

Reimplemented in dx::stream::shared::stream< device_t, circular_t, super_stream_t, event_t >, dx::stream::shared::stream< device_t, circular_t >, dx::stream::shared::stream< device_t, circular_t, super_stream_t, event_t >, and dx::stream::shared::stream< device_t, dx::circular >.

Here is the caller graph for this function:

◆ free() [2/2]

template<typename buffer_t>
void dx::shared::memory< buffer_t >::free ( )
inlinevirtualnoexcept

◆ initialize() [1/5]

template<typename buffer_t>
memory & dx::shared::memory< buffer_t >::initialize ( const std::string & name,
uint32_t version,
size_t size = 0 )
inline
Here is the caller graph for this function:

◆ initialize() [2/5]

template<typename buffer_t>
memory & dx::shared::memory< buffer_t >::initialize ( const std::string & name,
uint32_t version,
size_t size = 0 )
inline

◆ initialize() [3/5]

template<typename buffer_t>
memory & dx::shared::memory< buffer_t >::initialize ( size_t size = 0)
inline
Todo
shared::memory: buffer initialization @ version mismatch!

◆ initialize() [4/5]

template<typename buffer_t>
memory & dx::shared::memory< buffer_t >::initialize ( size_t size = 0)
inline

◆ initialize() [5/5]

reference & dx::shared::reference::initialize ( const std::string & name)
inlineinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator bool() [1/2]

template<typename buffer_t>
dx::shared::memory< buffer_t >::operator bool ( ) const
inlinenoexcept

true if this shared memory is currently in use by some process - a cheap, non-destructive existence probe (shm_open without O_CREAT, then immediately close) that neither maps nor creates anything itself.

◆ operator bool() [2/2]

template<typename buffer_t>
dx::shared::memory< buffer_t >::operator bool ( ) const
inlinenoexcept

true if this shared memory is currently in use by some process - a cheap, non-destructive existence probe (open, then immediately close, the underlying file mapping object by name) that neither maps nor creates anything itself. Crash-safe without any separate refcounting primitive: the OS keeps the file mapping kernel object alive exactly as long as any process holds a real (mapped) handle to it, closing it automatically on that process' crash/exit.

◆ operator buffer_t &() [1/2]

template<typename buffer_t>
dx::shared::memory< buffer_t >::operator buffer_t & ( )
inline

◆ operator buffer_t &() [2/2]

template<typename buffer_t>
dx::shared::memory< buffer_t >::operator buffer_t & ( )
inline

◆ operator buffer_t *() [1/2]

template<typename buffer_t>
dx::shared::memory< buffer_t >::operator buffer_t * ( )
inlineexplicit

◆ operator buffer_t *() [2/2]

template<typename buffer_t>
dx::shared::memory< buffer_t >::operator buffer_t * ( )
inlineexplicit

◆ operator const os_event() [1/2]

dx::resource< invalid_t >::operator const os_event ( ) const
inlinenoexceptinherited

◆ operator const os_event() [2/2]

dx::resource< invalid_t >::operator const os_event ( ) const
inlinenoexceptinherited

◆ operator os_event() [1/2]

dx::resource< invalid_t >::operator os_event ( )
inlinenoexceptinherited

◆ operator os_event() [2/2]

dx::resource< invalid_t >::operator os_event ( )
inlinenoexceptinherited

◆ operator struct ::stat()

template<typename buffer_t>
dx::shared::memory< buffer_t >::operator struct ::stat ( )
inline

◆ operator*() [1/2]

template<typename buffer_t>
buffer_t & dx::shared::memory< buffer_t >::operator* ( )
inline

◆ operator*() [2/2]

template<typename buffer_t>
buffer_t & dx::shared::memory< buffer_t >::operator* ( )
inline

◆ operator->() [1/2]

template<typename buffer_t>
buffer_t * dx::shared::memory< buffer_t >::operator-> ( )
inline

◆ operator->() [2/2]

template<typename buffer_t>
buffer_t * dx::shared::memory< buffer_t >::operator-> ( )
inline

◆ operator::HANDLE() [1/2]

dx::resource< invalid_t >::operator::HANDLE ( ) const
inlinenoexceptinherited
Here is the caller graph for this function:

◆ operator::HANDLE() [2/2]

dx::resource< invalid_t >::operator::HANDLE ( ) const
inlinenoexceptinherited
Here is the caller graph for this function:

◆ operator=() [1/2]

template<typename buffer_t>
memory & dx::shared::memory< buffer_t >::operator= ( const buffer_t & buffer)
inline

◆ operator=() [2/2]

template<typename buffer_t>
memory & dx::shared::memory< buffer_t >::operator= ( const buffer_t & buffer)
inline

◆ release() [1/2]

bool dx::shared::reference::release ( )
inlinenoexceptinherited

releases this hold

Returns
true if this was the last holder of this name - i.e. no other process currently has it open, and cleanup guarded by this name is now safe
Here is the call graph for this function:
Here is the caller graph for this function:

◆ release() [2/2]

bool dx::shared::reference::release ( )
inlinenoexceptinherited

releases this hold

Returns
true if this was the last holder of this name - i.e. no other process currently has it open, and cleanup guarded by this name is now safe
Here is the call graph for this function:

◆ size()

template<typename buffer_t>
size_t dx::shared::memory< buffer_t >::size ( ) const
inline
Here is the caller graph for this function:

Member Data Documentation

◆ joined

bool dx::shared::reference::joined {}
inherited

true if initialize() found another holder already present, false if this was the first

◆ process [1/2]

::HANDLE dx::resource< invalid_t >::process
protectedinherited

◆ process [2/2]

::HANDLE dx::resource< invalid_t >::process
protectedinherited

The documentation for this class was generated from the following files:

(c) copyright 2009 dynamic acoustics e.U. generated on

a closed source license may be obtained by requesting a written permission from dynamic acoustics e.U.
however - governmental use generally and military use especially is strictly prohibited though.