fair::mq::ChannelResource Class Reference

`#include <MemoryResources.h>`

Inheritance diagram for fair::mq::ChannelResource:
[legend]
Collaboration diagram for fair::mq::ChannelResource:
[legend]

## Public Member Functions

| ChannelResource (FairMQTransportFactory *_factory)
FairMQMessagePtr | getMessage (void *p) override
void * | setMessage (FairMQMessagePtr message) override
FairMQTransportFactory * | getTransportFactory () noexcept override
size_t | getNumberOfMessages () const noexcept override

## Protected Member Functions

void * | do_allocate (std::size_t bytes, std::size_t alignment) override
| Memory allocators and interfaces related to managing memory via the trasport layer. More...
void | do_deallocate (void *p, std::size_t, std::size_t) override
bool | do_is_equal (const pmr::memory_resource &other) const noexcept override

## Protected Attributes

FairMQTransportFactory * | factory {nullptr}
boost::container::flat_map< void *, FairMQMessagePtr > | messageMap

## Detailed Description

This is the allocator that interfaces to FairMQ memory management. All allocations are delegated to FairMQ so standard (e.g. STL) containers can construct their stuff in memory regions appropriate for the data channel configuration.

## Member Function Documentation

## do_allocate()

void * fair::mq::ChannelResource::do_allocate | ( | std::size_t | bytes,
|  | std::size_t | alignment
| ) |  |

overrideprotected

Memory allocators and interfaces related to managing memory via the trasport layer.

Author
  Mikolaj Krzewicki, mkrze.nosp@m.wic@.nosp@m.cern..nosp@m.ch

## getMessage()

FairMQMessagePtr fair::mq::ChannelResource::getMessage | ( | void * | p | ) |

inlineoverridevirtual

return the message containing data associated with the pointer (to start of buffer), e.g. pointer returned by std::vector::data() return nullptr if returning a message does not make sense!

Implements fair::mq::FairMQMemoryResource.

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

- fairmq/MemoryResources.h
- fairmq/MemoryResources.cxx

privacy