template<typename MsgT>
vt::messaging::MsgPtrThief struct

Helper to unify 'stealing' message ownership.

This type is not intended to be used directly. It uses implicit conversion constructors to perform a 'std::move' on a MsgPtr<MsgT>&.

If a normal MsgT* is supplied, it is promoted without stealing.

Constructors, destructors, conversion operators

MsgPtrThief(MsgT const* msgPtr) deprecated
Promote a MsgT*.
MsgPtrThief(MsgSharedPtr<MsgT>& msg)
Moves (steals) the incoming MsgPtr.
MsgPtrThief(MsgSharedPtr<MsgT>&& msg)
Moves (steals) the incoming MsgPtr.

Public variables

MsgSharedPtr<MsgT> msg_

Function documentation

template<typename MsgT>
vt::messaging::MsgPtrThief<MsgT>::MsgPtrThief(MsgT const* msgPtr)

Promote a MsgT*.

The message is promoted without any implicit stealing. It is generally assumed the caller did not 'own' this message anyway.

template<typename MsgT>
vt::messaging::MsgPtrThief<MsgT>::MsgPtrThief(MsgSharedPtr<MsgT>& msg)

Moves (steals) the incoming MsgPtr.

As though std::move(msg) was used, the msg is invalidated.

template<typename MsgT>
vt::messaging::MsgPtrThief<MsgT>::MsgPtrThief(MsgSharedPtr<MsgT>&& msg)

Moves (steals) the incoming MsgPtr.

This form allows code to explicitly use std::move as desired.