Send Message Active Function (type-safe handler) module

Send a message to a auto-registered type-safe active message handler. This is the predominant way that the messenger is expected to be used.

struct MyMsg : vt::Message {
  explicit MyMsg(int in_a) : a_(in_a) { }
  int a_;
};

void myHandler(MyMsg* msg) {
  // do work ...
}

void sendCode() {
  // myHandler is automatically registered with the overload
  theMsg()->sendMsg<MyMsg, myHandler>(1, msg);
}

Functions

template<typename MsgT, ActiveTypedFnType<MsgT>* f>
auto broadcastMsgSz(MsgPtrThief<MsgT> msg, ByteType msg_size, bool deliver_to_sender = true, TagType tag = no_tag) -> PendingSendType
Broadcast a message with an explicit size.
template<typename MsgT, ActiveTypedFnType<MsgT>* f>
auto broadcastMsg(MsgPtrThief<MsgT> msg, bool deliver_to_sender = true, TagType tag = no_tag) -> PendingSendType
Broadcast a message.
template<auto f>
auto broadcastMsg(MsgPtrThief<typename FuncTraits<decltype(f)>::MsgT> msg, bool deliver_to_sender = true, TagType tag = no_tag) -> PendingSendType
Broadcast a message (message type not required).
template<typename MsgT, ActiveTypedFnType<MsgT>* f>
auto sendMsg(NodeType dest, MsgPtrThief<MsgT> msg, TagType tag = no_tag) -> PendingSendType
Send a message.
template<auto f>
auto sendMsg(NodeType dest, MsgPtrThief<typename FuncTraits<decltype(f)>::MsgT> msg, TagType tag = no_tag) -> PendingSendType
Send a message (message type not required).
template<auto f, typename... Params>
auto send(Node dest, Params && ... params) -> PendingSendType
Send parameters to a handler in a message.
template<auto f, typename... Params>
auto broadcast(Params && ... params) -> PendingSendType
Broadcast parameters to a handler in a message.
template<typename MsgT, ActiveTypedFnType<MsgT>* f>
auto sendMsgSz(NodeType dest, MsgPtrThief<MsgT> msg, ByteType msg_size, TagType tag = no_tag) -> PendingSendType
Send a message with explicit size.
template<typename MsgT, ActiveTypedFnType<MsgT>* f>
auto broadcastMsgAuto(MsgPtrThief<MsgT> msg, TagType tag = no_tag) -> PendingSendType deprecated
Broadcast a message.
template<typename MsgT, ActiveTypedFnType<MsgT>* f>
auto sendMsgAuto(NodeType dest, MsgPtrThief<MsgT> msg, TagType tag = no_tag) -> PendingSendType deprecated
Send a message.

Function documentation

template<typename MsgT, ActiveTypedFnType<MsgT>* f>
PendingSendType broadcastMsgSz(MsgPtrThief<MsgT> msg, ByteType msg_size, bool deliver_to_sender = true, TagType tag = no_tag)

Broadcast a message with an explicit size.

Parameters
msg in the message to broadcast
msg_size in the size of the message to send
deliver_to_sender in whether msg should be delivered to sender
tag in the tag to put on the message
Returns the PendingSend for the sent message

Use this variant to broadcast a message when sizeof(Message) != the actual size you want to send (e.g., extra bytes on the end)

template<typename MsgT, ActiveTypedFnType<MsgT>* f>
PendingSendType broadcastMsg(MsgPtrThief<MsgT> msg, bool deliver_to_sender = true, TagType tag = no_tag)

Broadcast a message.

Parameters
msg in the message to broadcast
deliver_to_sender in whether msg should be delivered to sender
tag in the tag to put on the message
Returns the PendingSend for the sent message

template<auto f>
PendingSendType broadcastMsg(MsgPtrThief<typename FuncTraits<decltype(f)>::MsgT> msg, bool deliver_to_sender = true, TagType tag = no_tag)

Broadcast a message (message type not required).

Parameters
msg in the message to broadcast
deliver_to_sender in whether msg should be delivered to sender
tag in the tag to put on the message
Returns the PendingSend for the sent message

template<typename MsgT, ActiveTypedFnType<MsgT>* f>
PendingSendType sendMsg(NodeType dest, MsgPtrThief<MsgT> msg, TagType tag = no_tag)

Send a message.

Parameters
dest in the destination node to send the message to
msg in the message to send
tag in the tag to put on the message
Returns the PendingSend for the sent message

template<auto f>
PendingSendType sendMsg(NodeType dest, MsgPtrThief<typename FuncTraits<decltype(f)>::MsgT> msg, TagType tag = no_tag)

Send a message (message type not required).

Parameters
dest in the destination node to send the message to
msg in the message to send
tag in the tag to put on the message
Returns the PendingSend for the sent message

template<auto f, typename... Params>
PendingSendType send(Node dest, Params && ... params)

Send parameters to a handler in a message.

Parameters
dest in the destination node to send the message to
params in the parameters
Returns the PendingSend for the sent message

template<auto f, typename... Params>
PendingSendType broadcast(Params && ... params)

Broadcast parameters to a handler in a message.

Parameters
params in the parameters
Returns the PendingSend for the sent message

template<typename MsgT, ActiveTypedFnType<MsgT>* f>
PendingSendType sendMsgSz(NodeType dest, MsgPtrThief<MsgT> msg, ByteType msg_size, TagType tag = no_tag)

Send a message with explicit size.

Parameters
dest in node to send the message to
msg in the message to send
msg_size in the size of the message being sent
tag in the tag to put on the message
Returns the PendingSend for the send

Invoke this send variant if you know the size or the sizeof(Message) is different than the number of bytes you actually want to send (e.g., extra bytes on the end of the message)

template<typename MsgT, ActiveTypedFnType<MsgT>* f>
PendingSendType broadcastMsgAuto(MsgPtrThief<MsgT> msg, TagType tag = no_tag)

Broadcast a message.

Parameters
msg in the message to broadcast
tag in the tag to put on the message
Returns the PendingSend for the send

template<typename MsgT, ActiveTypedFnType<MsgT>* f>
PendingSendType sendMsgAuto(NodeType dest, MsgPtrThief<MsgT> msg, TagType tag = no_tag)

Send a message.

Parameters
dest in the destination node to send the message to
msg in the message to send
tag in the tag to put on the message
Returns the PendingSend for the send