lintel 0.2.0
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
lintel::SharedMemorySegment Class Reference

#include <SharedMemorySegment.h>

Classes

struct  AutoExtendConfig
 

Public Member Functions

 SharedMemorySegment (std::filesystem::path sharedMemoryPath, std::string name, std::size_t size)
 
 SharedMemorySegment (std::filesystem::path sharedMemoryPath, std::string name, std::size_t size, AutoExtendConfig autoExtendConfig)
 
std::filesystem::path getPath () const
 
const std::string & getName () const
 
constexpr size_t getSize () const
 
constexpr bool isAutoExtend () const
 
constexpr size_t getAutoExtendSize () const
 
constexpr size_t getMaxSize () const
 

Detailed Description

Represents a shared memory segment with path, name, size, and auto-extend configuration.

Constructor & Destructor Documentation

◆ SharedMemorySegment() [1/2]

lintel::SharedMemorySegment::SharedMemorySegment ( std::filesystem::path  sharedMemoryPath,
std::string  name,
std::size_t  size 
)

Constructs a shared memory segment with a fixed size.

Parameters
sharedMemoryPathpath to the shared memory file
namename of the segment
sizesize of the segment in bytes

◆ SharedMemorySegment() [2/2]

lintel::SharedMemorySegment::SharedMemorySegment ( std::filesystem::path  sharedMemoryPath,
std::string  name,
std::size_t  size,
AutoExtendConfig  autoExtendConfig 
)

Constructs a shared memory segment with auto-extend capability.

Parameters
sharedMemoryPathpath to the shared memory file
namename of the segment
sizeinitial size of the segment in bytes
autoExtendConfighow much to grow by when full and the hard upper bound

Member Function Documentation

◆ getAutoExtendSize()

constexpr size_t lintel::SharedMemorySegment::getAutoExtendSize ( ) const
inlineconstexpr
Returns
number of bytes to extend by when full

◆ getMaxSize()

constexpr size_t lintel::SharedMemorySegment::getMaxSize ( ) const
inlineconstexpr
Returns
maximum allowed size in bytes

◆ getName()

const std::string & lintel::SharedMemorySegment::getName ( ) const
Returns
reference to the segment name

◆ getPath()

std::filesystem::path lintel::SharedMemorySegment::getPath ( ) const
Returns
path to the shared memory file

◆ getSize()

constexpr size_t lintel::SharedMemorySegment::getSize ( ) const
inlineconstexpr
Returns
size of the segment in bytes

◆ isAutoExtend()

constexpr bool lintel::SharedMemorySegment::isAutoExtend ( ) const
inlineconstexpr
Returns
true if the segment can auto-extend when full

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