POSIX Shared Memory Data Structures 1.0
High-performance lock-free data structures for inter-process communication
Loading...
Searching...
No Matches
shm_span< T, ShmType > Class Template Reference

Base class for shared memory data structures that span a region. More...

#include <shm_span.h>

+ Inheritance diagram for shm_span< T, ShmType >:

Public Member Functions

 shm_span (ShmType &shm, size_t off, size_t count)
 
T * data ()
 
const T * data () const
 
size_t size () const
 
T & operator[] (size_t index)
 
const T & operator[] (size_t index) const
 

Protected Attributes

ShmType & shm
 
size_t offset
 
size_t num_elem
 

Detailed Description

template<typename T, typename ShmType>
class shm_span< T, ShmType >

Base class for shared memory data structures that span a region.

Template Parameters
TType of elements (must be trivially copyable)
ShmTypeType of shared memory manager

Definition at line 11 of file shm_span.h.

Constructor & Destructor Documentation

◆ shm_span()

template<typename T , typename ShmType >
shm_span< T, ShmType >::shm_span ( ShmType &  shm,
size_t  off,
size_t  count 
)
inline

Definition at line 18 of file shm_span.h.

Member Function Documentation

◆ data() [1/2]

template<typename T , typename ShmType >
T * shm_span< T, ShmType >::data ( )
inline

◆ data() [2/2]

template<typename T , typename ShmType >
const T * shm_span< T, ShmType >::data ( ) const
inline

Definition at line 27 of file shm_span.h.

References shm_span< T, ShmType >::offset, and shm_span< T, ShmType >::shm.

◆ operator[]() [1/2]

template<typename T , typename ShmType >
T & shm_span< T, ShmType >::operator[] ( size_t  index)
inline

Definition at line 35 of file shm_span.h.

References shm_span< T, ShmType >::data().

◆ operator[]() [2/2]

template<typename T , typename ShmType >
const T & shm_span< T, ShmType >::operator[] ( size_t  index) const
inline

Definition at line 36 of file shm_span.h.

References shm_span< T, ShmType >::data().

◆ size()

template<typename T , typename ShmType >
size_t shm_span< T, ShmType >::size ( ) const
inline

Definition at line 33 of file shm_span.h.

References shm_span< T, ShmType >::num_elem.

Member Data Documentation

◆ num_elem

◆ offset

template<typename T , typename ShmType >
size_t shm_span< T, ShmType >::offset
protected

◆ shm

template<typename T , typename ShmType >
ShmType& shm_span< T, ShmType >::shm
protected

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