Project
Loading...
Searching...
No Matches
o2::pmr::MessageResource Class Reference

#include <MemoryResources.h>

Inherits FairMQMemoryResource.

Public Member Functions

 MessageResource () noexcept=delete
 
 MessageResource (const MessageResource &) noexcept=default
 
 MessageResource (MessageResource &&) noexcept=default
 
MessageResourceoperator= (const MessageResource &)=default
 
MessageResourceoperator= (MessageResource &&)=default
 
 MessageResource (fair::mq::MessagePtr message)
 
fair::mq::MessagePtr getMessage (void *p) override
 
voidsetMessage (fair::mq::MessagePtr message) override
 
fair::mq::TransportFactory * getTransportFactory () noexcept override
 
size_t getNumberOfMessages () const noexcept override
 

Protected Member Functions

voiddo_allocate (std::size_t bytes, std::size_t alignment) override
 
void do_deallocate (void *p, std::size_t bytes, std::size_t alignment) override
 
bool do_is_equal (const memory_resource &) const noexcept override
 

Protected Attributes

FairMQMemoryResourcemUpstream {nullptr}
 
size_t mMessageSize {0}
 
voidmMessageData {nullptr}
 
bool initialImport {true}
 

Detailed Description

This memory resource only watches, does not allocate/deallocate anything. Ownership of hte message is taken. Meant to be used for transparent data adoption in containers. In combination with the SpectatorAllocator this is an alternative to using span, as raw memory (e.g. an existing buffer message) will be accessible with appropriate container.

Definition at line 63 of file MemoryResources.h.

Constructor & Destructor Documentation

◆ MessageResource() [1/4]

o2::pmr::MessageResource::MessageResource ( )
deletenoexcept

◆ MessageResource() [2/4]

o2::pmr::MessageResource::MessageResource ( const MessageResource )
defaultnoexcept

◆ MessageResource() [3/4]

o2::pmr::MessageResource::MessageResource ( MessageResource &&  )
defaultnoexcept

◆ MessageResource() [4/4]

o2::pmr::MessageResource::MessageResource ( fair::mq::MessagePtr  message)
inline

Definition at line 72 of file MemoryResources.h.

Member Function Documentation

◆ do_allocate()

void * o2::pmr::MessageResource::do_allocate ( std::size_t  bytes,
std::size_t  alignment 
)
inlineoverrideprotected

Definition at line 90 of file MemoryResources.h.

◆ do_deallocate()

void o2::pmr::MessageResource::do_deallocate ( void p,
std::size_t  bytes,
std::size_t  alignment 
)
inlineoverrideprotected

Definition at line 102 of file MemoryResources.h.

◆ do_is_equal()

bool o2::pmr::MessageResource::do_is_equal ( const memory_resource &  ) const
inlineoverrideprotectednoexcept

Definition at line 107 of file MemoryResources.h.

◆ getMessage()

fair::mq::MessagePtr o2::pmr::MessageResource::getMessage ( void p)
inlineoverride

Definition at line 79 of file MemoryResources.h.

◆ getNumberOfMessages()

size_t o2::pmr::MessageResource::getNumberOfMessages ( ) const
inlineoverridenoexcept

Definition at line 82 of file MemoryResources.h.

◆ getTransportFactory()

fair::mq::TransportFactory * o2::pmr::MessageResource::getTransportFactory ( )
inlineoverridenoexcept

Definition at line 81 of file MemoryResources.h.

◆ operator=() [1/2]

MessageResource & o2::pmr::MessageResource::operator= ( const MessageResource )
default

◆ operator=() [2/2]

MessageResource & o2::pmr::MessageResource::operator= ( MessageResource &&  )
default

◆ setMessage()

void * o2::pmr::MessageResource::setMessage ( fair::mq::MessagePtr  message)
inlineoverride

Definition at line 80 of file MemoryResources.h.

Member Data Documentation

◆ initialImport

bool o2::pmr::MessageResource::initialImport {true}
protected

Definition at line 88 of file MemoryResources.h.

◆ mMessageData

void* o2::pmr::MessageResource::mMessageData {nullptr}
protected

Definition at line 87 of file MemoryResources.h.

◆ mMessageSize

size_t o2::pmr::MessageResource::mMessageSize {0}
protected

Definition at line 86 of file MemoryResources.h.

◆ mUpstream

FairMQMemoryResource* o2::pmr::MessageResource::mUpstream {nullptr}
protected

Definition at line 85 of file MemoryResources.h.


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