lintel 0.2.0
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
lintel::shm Namespace Reference

Classes

class  SegmentSemaphoreGuard
 

Typedefs

using SegmentManager = boost::interprocess::managed_mapped_file::segment_manager
 
template<class Object >
using SegmentAllocator = boost::interprocess::allocator< Object, SegmentManager >
 
using String = boost::container::basic_string< char, std::char_traits< char >, SegmentAllocator< char > >
 
template<class Key , class Value >
using Map = boost::container::map< Key, Value, std::less< Key >, SegmentAllocator< std::pair< const Key, Value > > >
 
template<class Object >
using Vector = boost::container::vector< Object, SegmentAllocator< Object > >
 

Functions

template<class Object , std::size_t Size>
std::array< Object, Size > & constructArray (SharedMemoryService &service, const std::shared_ptr< SharedMemorySegment > &segment, const std::string &name)
 
template<class Key , class Value >
Map< Key, Value > & constructMap (SharedMemoryService &service, const std::shared_ptr< SharedMemorySegment > &segment, const std::string &name)
 
template<class Object >
Vector< Object > & constructVector (SharedMemoryService &service, const std::shared_ptr< SharedMemorySegment > &segment, const std::string &name)
 
template<class Object >
Object & constructObject (SharedMemoryService &service, const std::shared_ptr< SharedMemorySegment > &segment, const std::string &name)
 
template<class Object , class... Args>
Object & constructObjectWith (SharedMemoryService &service, const std::shared_ptr< SharedMemorySegment > &segment, const std::string &name, Args &&...args)
 
String constructString (SharedMemoryService &service, const std::shared_ptr< SharedMemorySegment > &segment, const std::string &name)
 
SegmentManager * segmentManagerOf (SharedMemoryService &service, const std::shared_ptr< SharedMemorySegment > &segment)
 

Typedef Documentation

◆ Map

template<class Key , class Value >
using lintel::shm::Map = typedef boost::container::map<Key, Value, std::less<Key>, SegmentAllocator<std::pair<const Key, Value> >>

Map placed in shared memory.

◆ SegmentAllocator

template<class Object >
using lintel::shm::SegmentAllocator = typedef boost::interprocess::allocator<Object, SegmentManager>

Allocator for data structures placed in shared memory.

◆ SegmentManager

using lintel::shm::SegmentManager = typedef boost::interprocess::managed_mapped_file::segment_manager

Segment manager of a mapped shared memory file.

◆ String

using lintel::shm::String = typedef boost::container::basic_string<char, std::char_traits<char>, SegmentAllocator<char> >

String placed in shared memory.

◆ Vector

template<class Object >
using lintel::shm::Vector = typedef boost::container::vector<Object, SegmentAllocator<Object> >

Vector placed in shared memory.

Function Documentation

◆ constructArray()

template<class Object , std::size_t Size>
std::array< Object, Size > & lintel::shm::constructArray ( SharedMemoryService &  service,
const std::shared_ptr< SharedMemorySegment > &  segment,
const std::string &  name 
)

Find or construct a fixed-size array in the given shared memory segment.

Template Parameters
Objectthe element type
Sizethe array size
Parameters
servicethe shared memory service
segmentthe shared memory segment
namethe name of the array object
Returns
reference to the constructed or found array
Exceptions
ShmSegmentNotFoundif the segment does not exist

◆ constructMap()

template<class Key , class Value >
Map< Key, Value > & lintel::shm::constructMap ( SharedMemoryService &  service,
const std::shared_ptr< SharedMemorySegment > &  segment,
const std::string &  name 
)

Find or construct a map in the given shared memory segment.

Template Parameters
Keythe map key type
Valuethe map value type
Parameters
servicethe shared memory service
segmentthe shared memory segment
namethe name of the map object
Returns
reference to the constructed or found map
Exceptions
ShmSegmentNotFoundif the segment does not exist

◆ constructObject()

template<class Object >
Object & lintel::shm::constructObject ( SharedMemoryService &  service,
const std::shared_ptr< SharedMemorySegment > &  segment,
const std::string &  name 
)

Find or construct a single object in the given shared memory segment.

Template Parameters
Objectthe object type
Parameters
servicethe shared memory service
segmentthe shared memory segment
namethe name of the object
Returns
reference to the constructed or found object
Exceptions
ShmSegmentNotFoundif the segment does not exist

◆ constructObjectWith()

template<class Object , class... Args>
Object & lintel::shm::constructObjectWith ( SharedMemoryService &  service,
const std::shared_ptr< SharedMemorySegment > &  segment,
const std::string &  name,
Args &&...  args 
)

Find or construct a single object with constructor arguments in the given shared memory segment.

Template Parameters
Objectthe object type
Argsthe constructor argument types
Parameters
servicethe shared memory service
segmentthe shared memory segment
namethe name of the object
argsarguments forwarded to the constructor
Returns
reference to the constructed or found object
Exceptions
ShmSegmentNotFoundif the segment does not exist

◆ constructString()

String lintel::shm::constructString ( SharedMemoryService &  service,
const std::shared_ptr< SharedMemorySegment > &  segment,
const std::string &  name 
)
inline

Find or construct a string in the given shared memory segment.

Parameters
servicethe shared memory service
segmentthe shared memory segment
namethe name of the string object
Returns
the constructed or found shared-memory string
Exceptions
ShmSegmentNotFoundif the segment does not exist

◆ constructVector()

template<class Object >
Vector< Object > & lintel::shm::constructVector ( SharedMemoryService &  service,
const std::shared_ptr< SharedMemorySegment > &  segment,
const std::string &  name 
)

Find or construct a vector in the given shared memory segment.

Template Parameters
Objectthe element type
Parameters
servicethe shared memory service
segmentthe shared memory segment
namethe name of the vector object
Returns
reference to the constructed or found vector
Exceptions
ShmSegmentNotFoundif the segment does not exist

◆ segmentManagerOf()

SegmentManager * lintel::shm::segmentManagerOf ( SharedMemoryService &  service,
const std::shared_ptr< SharedMemorySegment > &  segment 
)
inline

Get the raw segment manager of the given shared memory segment.

Parameters
servicethe shared memory service
segmentthe shared memory segment
Returns
the segment manager, or nullptr if the segment does not exist