ipcq 0.12.0
Loading...
Searching...
No Matches
ipcq::detail::ShmControlBase< ShmTraits > Class Template Reference

Non-virtual base-class for ShmControl that does not depend on any static type. More...

#include <shm.hpp>

Public Types

using CounterType = size_t
 
using SharedMemoryObject = typename ShmTraits::SharedMemoryObject
 
using MappedRegion = typename ShmTraits::MappedRegion
 

Public Member Functions

 ShmControlBase (char const *name, QueueInfo queue_info, std::optional< numapp::MemPolicy > mem_policy=std::nullopt, int mmap_flags=0)
 Owner constructor.
 
 ShmControlBase (char const *name)
 Non-owner constructor.
 
 ShmControlBase (ShmControlBase &&rhs) noexcept
 
ShmControlBase & operator= (ShmControlBase &&rhs) noexcept
 
char const * TopicName () const noexcept
 
char const * ShmObjectName () const
 
constexpr size_t Capacity () const noexcept
 
constexpr uint8_t FileVersion () const noexcept
 
constexpr pid_t OwnerPid () const noexcept
 

Protected Attributes

std::string m_topic_name
 Topic name, as provided by user.
 
QueueInfo m_queue_info
 
SharedMemoryObject m_shm_obj
 Manages the shared memory.
 
ShmRemover< ShmTraits > m_shmem_remover
 
MappedRegion m_control_region
 Mapped segment to the control (mapped as read only for Reader).
 
MappedRegion m_queue_region
 Mapped region to the queue (mapped as read only for Reader).
 
Pointers to mapped shared memory regions
ShmControlBlock * m_ctl_block
 
bool m_is_owner
 Indicates if this object owns the shared memory or not.
 

Detailed Description

template<class ShmTraits = BoostInterprocessTraits>
class ipcq::detail::ShmControlBase< ShmTraits >

Non-virtual base-class for ShmControl that does not depend on any static type.

This is mainly a requirement to support ipcq-spy which is not templated on element type or any policies.

Template Parameters
ShmTraitsTrait type used to facilitate testing. Does not depend on user provided types.

Definition at line 371 of file shm.hpp.

Member Typedef Documentation

◆ CounterType

template<class ShmTraits = BoostInterprocessTraits>
using ipcq::detail::ShmControlBase< ShmTraits >::CounterType = size_t

Definition at line 373 of file shm.hpp.

◆ MappedRegion

template<class ShmTraits = BoostInterprocessTraits>
using ipcq::detail::ShmControlBase< ShmTraits >::MappedRegion = typename ShmTraits::MappedRegion

Definition at line 375 of file shm.hpp.

◆ SharedMemoryObject

template<class ShmTraits = BoostInterprocessTraits>
using ipcq::detail::ShmControlBase< ShmTraits >::SharedMemoryObject = typename ShmTraits::SharedMemoryObject

Definition at line 374 of file shm.hpp.

Constructor & Destructor Documentation

◆ ShmControlBase() [1/3]

template<class ShmTraits = BoostInterprocessTraits>
ipcq::detail::ShmControlBase< ShmTraits >::ShmControlBase ( char const * name,
QueueInfo queue_info,
std::optional< numapp::MemPolicy > mem_policy = std::nullopt,
int mmap_flags = 0 )
inlineexplicit

Owner constructor.

Parameters
sizeData buffer in number of bytes.
data_offsetOffset to first byte of the contigous queue buffer, relative m_queue region.

Definition at line 384 of file shm.hpp.

◆ ShmControlBase() [2/3]

template<class ShmTraits = BoostInterprocessTraits>
ipcq::detail::ShmControlBase< ShmTraits >::ShmControlBase ( char const * name)
inlineexplicit

Non-owner constructor.

Definition at line 470 of file shm.hpp.

◆ ShmControlBase() [3/3]

template<class ShmTraits = BoostInterprocessTraits>
ipcq::detail::ShmControlBase< ShmTraits >::ShmControlBase ( ShmControlBase< ShmTraits > && rhs)
inlinenoexcept

Definition at line 503 of file shm.hpp.

Member Function Documentation

◆ Capacity()

template<class ShmTraits = BoostInterprocessTraits>
size_t ipcq::detail::ShmControlBase< ShmTraits >::Capacity ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 540 of file shm.hpp.

◆ FileVersion()

template<class ShmTraits = BoostInterprocessTraits>
uint8_t ipcq::detail::ShmControlBase< ShmTraits >::FileVersion ( ) const
inlinenodiscardconstexprnoexcept
Returns
ipcq shared object file/protocol version

Definition at line 547 of file shm.hpp.

◆ operator=()

template<class ShmTraits = BoostInterprocessTraits>
ShmControlBase & ipcq::detail::ShmControlBase< ShmTraits >::operator= ( ShmControlBase< ShmTraits > && rhs)
inlinenoexcept

Definition at line 517 of file shm.hpp.

◆ OwnerPid()

template<class ShmTraits = BoostInterprocessTraits>
pid_t ipcq::detail::ShmControlBase< ShmTraits >::OwnerPid ( ) const
inlinenodiscardconstexprnoexcept
Returns
PID of registered owner (writer) process.

Definition at line 554 of file shm.hpp.

◆ ShmObjectName()

template<class ShmTraits = BoostInterprocessTraits>
char const * ipcq::detail::ShmControlBase< ShmTraits >::ShmObjectName ( ) const
inlinenodiscard

Definition at line 536 of file shm.hpp.

◆ TopicName()

template<class ShmTraits = BoostInterprocessTraits>
char const * ipcq::detail::ShmControlBase< ShmTraits >::TopicName ( ) const
inlinenodiscardnoexcept

Definition at line 532 of file shm.hpp.

Member Data Documentation

◆ m_control_region

template<class ShmTraits = BoostInterprocessTraits>
MappedRegion ipcq::detail::ShmControlBase< ShmTraits >::m_control_region
protected

Mapped segment to the control (mapped as read only for Reader).

Definition at line 568 of file shm.hpp.

◆ m_ctl_block

template<class ShmTraits = BoostInterprocessTraits>
ShmControlBlock* ipcq::detail::ShmControlBase< ShmTraits >::m_ctl_block
protected

Definition at line 573 of file shm.hpp.

◆ m_is_owner

template<class ShmTraits = BoostInterprocessTraits>
bool ipcq::detail::ShmControlBase< ShmTraits >::m_is_owner
protected

Indicates if this object owns the shared memory or not.

Definition at line 576 of file shm.hpp.

◆ m_queue_info

template<class ShmTraits = BoostInterprocessTraits>
QueueInfo ipcq::detail::ShmControlBase< ShmTraits >::m_queue_info
protected

Definition at line 561 of file shm.hpp.

◆ m_queue_region

template<class ShmTraits = BoostInterprocessTraits>
MappedRegion ipcq::detail::ShmControlBase< ShmTraits >::m_queue_region
protected

Mapped region to the queue (mapped as read only for Reader).

Definition at line 570 of file shm.hpp.

◆ m_shm_obj

template<class ShmTraits = BoostInterprocessTraits>
SharedMemoryObject ipcq::detail::ShmControlBase< ShmTraits >::m_shm_obj
protected

Manages the shared memory.

Definition at line 564 of file shm.hpp.

◆ m_shmem_remover

template<class ShmTraits = BoostInterprocessTraits>
ShmRemover<ShmTraits> ipcq::detail::ShmControlBase< ShmTraits >::m_shmem_remover
protected

Definition at line 566 of file shm.hpp.

◆ m_topic_name

template<class ShmTraits = BoostInterprocessTraits>
std::string ipcq::detail::ShmControlBase< ShmTraits >::m_topic_name
protected

Topic name, as provided by user.

Definition at line 560 of file shm.hpp.


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