FairMQ  1.4.33
C++ Message Queuing Library and Framework
Public Types | Public Member Functions | Public Attributes | List of all members
FairMQParts Class Reference

FairMQParts is a lightweight convenience wrapper around a vector of unique pointers to FairMQMessage, used for sending multi-part messages. More...

#include <FairMQParts.h>

Public Types

using iterator = container::iterator
 
using const_iterator = container::const_iterator
 

Public Member Functions

 FairMQParts ()
 Default constructor.
 
 FairMQParts (const FairMQParts &)=delete
 Copy Constructor.
 
 FairMQParts (FairMQParts &&p)=default
 Move constructor.
 
FairMQPartsoperator= (const FairMQParts &)=delete
 Assignment operator.
 
template<typename... Ts>
 FairMQParts (Ts &&... messages)
 Constructor from argument pack of std::unique_ptr<FairMQMessage> rvalues.
 
 ~FairMQParts ()
 Default destructor.
 
void AddPart (FairMQMessage *msg)
 
void AddPart (std::unique_ptr< FairMQMessage > &&msg)
 
template<typename... Ts>
void AddPart (std::unique_ptr< FairMQMessage > &&first, Ts &&... remaining)
 Add variable list of parts to the container (move)
 
void AddPart (FairMQParts &&other)
 Add content of another object by move.
 
FairMQMessageoperator[] (const int index)
 
std::unique_ptr< FairMQMessage > & At (const int index)
 
FairMQMessageAtRef (const int index)
 
int Size () const
 
auto begin () -> decltype(fParts.begin())
 
auto end () -> decltype(fParts.end())
 
auto cbegin () -> decltype(fParts.cbegin())
 
auto cend () -> decltype(fParts.cend())
 

Public Attributes

container fParts
 

Detailed Description

FairMQParts is a lightweight convenience wrapper around a vector of unique pointers to FairMQMessage, used for sending multi-part messages.

Member Function Documentation

◆ AddPart() [1/2]

void FairMQParts::AddPart ( FairMQMessage msg)
inline

Adds part (FairMQMessage) to the container

Parameters
msgmessage pointer (for example created with NewMessage() method of FairMQDevice)

◆ AddPart() [2/2]

void FairMQParts::AddPart ( std::unique_ptr< FairMQMessage > &&  msg)
inline

Adds part (std::unique_ptr<FairMQMessage>&) to the container (move)

Parameters
msgunique pointer to FairMQMessage rvalue ref (move required when passing argument)

◆ At()

std::unique_ptr<FairMQMessage>& FairMQParts::At ( const int  index)
inline

Get reference to unique pointer to part in the container at index (with bounds check)

Parameters
indexcontainer index

◆ operator[]()

FairMQMessage& FairMQParts::operator[] ( const int  index)
inline

Get reference to part in the container at index (without bounds check)

Parameters
indexcontainer index

◆ Size()

int FairMQParts::Size ( ) const
inline

Get number of parts in the container

Returns
number of parts in the container

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

privacy