Signbit MPSCQ  0.5.0
Public Member Functions | List of all members
sbit::mpscq::MessagePool< Payload > Class Template Reference

#include <mpscq.h>

Public Member Functions

 MessagePool (size_t allocationGroupSize, std::pmr::memory_resource *memoryResource)
 
Messageallocate ()
 

Detailed Description

template<typename Payload>
class sbit::mpscq::MessagePool< Payload >

Efficient object pool for messages

Allocates objects in batches, using the passed-in memory resource.

Template Parameters
PayloadIs the type of the useful payload processed via the queue

Constructor & Destructor Documentation

◆ MessagePool()

template<typename Payload >
sbit::mpscq::MessagePool< Payload >::MessagePool ( size_t  allocationGroupSize,
std::pmr::memory_resource *  memoryResource 
)
inline

Constructs a message pool

Parameters
allocationGroupSizeSpecifies how many objects to allocate at once
memoryResourceIndicates the memory resource backing the allocations

Member Function Documentation

◆ allocate()

template<typename Payload >
Message* sbit::mpscq::MessagePool< Payload >::allocate ( )
inline

Allocates a message

Returns
a pointer to the message

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