UCommon
Public Member Functions
ucommon::mapped_view< T > Class Template Reference

Class to access a named mapped segment published from another process. More...

#include <mapped.h>

Inheritance diagram for ucommon::mapped_view< T >:
Inheritance graph
[legend]
Collaboration diagram for ucommon::mapped_view< T >:
Collaboration graph
[legend]

Public Member Functions

void copy (unsigned member, T &buffer)
 
unsigned count (void) const
 Get count of typed member objects held in this map. More...
 
volatile const T * get (unsigned member)
 
 mapped_view (const char *name)
 Map existing named memory segment. More...
 
volatile const T * operator() (unsigned member)
 Access typed member object in the mapped segment. More...
 
volatile const T & operator[] (unsigned member)
 Reference typed member object in the mapped segment. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ucommon::MappedMemory
void create (const char *name, size_t size=(size_t) 0)
 Supporting function to construct a new or access an existing shared memory segment. More...
 
caddr_t addr (void)
 Get starting address of mapped segment. More...
 
bool copy (size_t offset, void *buffer, size_t size) const
 Copy memory from specific offset within the mapped memory segment. More...
 
size_t len (void) const
 Get size of mapped segment. More...
 
 MappedMemory (const char *name, size_t size)
 Construct a read/write access mapped shared segment of memory of a known size. More...
 
 MappedMemory (const char *name)
 Provide read-only mapped access to an existing named shared memory segment. More...
 
void * offset (size_t offset) const
 Get memory from a specific offset within the mapped memory segment. More...
 
 operator bool () const
 Test if map active. More...
 
bool operator! () const
 Test if map is inactive. More...
 
void release (void)
 Unmap memory segment.
 
void * sbrk (size_t size)
 Extend size of managed heap on shared memory segment. More...
 
virtual ~MappedMemory ()
 Unmap memory segment.
 
- Static Protected Member Functions inherited from ucommon::MappedMemory
static void disable (void)
 An API that allows "disabling" of publishing shared memory maps. More...
 
static void remove (const char *name)
 Destroy a previously existing memory segment under the specified name. More...
 
- Protected Attributes inherited from ucommon::MappedMemory
bool erase
 
char idname [65]
 
size_t size
 
size_t used
 

Detailed Description

template<class T>
class ucommon::mapped_view< T >

Class to access a named mapped segment published from another process.

This offers a simple typed vector interface to access the shared memory segment in read-only mode.

Author
David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org

Definition at line 469 of file mapped.h.

Constructor & Destructor Documentation

◆ mapped_view()

template<class T >
ucommon::mapped_view< T >::mapped_view ( const char *  name)
inline

Map existing named memory segment.

The size of the map is derived from the existing map alone.

Parameters
nameof memory segment to map.

Definition at line 480 of file mapped.h.

Member Function Documentation

◆ count()

template<class T >
unsigned ucommon::mapped_view< T >::count ( void  ) const
inline

Get count of typed member objects held in this map.

Returns
count of typed member objects.

Definition at line 509 of file mapped.h.

◆ operator()()

template<class T >
volatile const T* ucommon::mapped_view< T >::operator() ( unsigned  member)
inline

Access typed member object in the mapped segment.

Parameters
memberto access.
Returns
typed object pointer.

Definition at line 488 of file mapped.h.

Here is the call graph for this function:

◆ operator[]()

template<class T >
volatile const T& ucommon::mapped_view< T >::operator[] ( unsigned  member)
inline

Reference typed member object in the mapped segment.

Parameters
memberto access.
Returns
typed object reference.

Definition at line 496 of file mapped.h.

Here is the call graph for this function:

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