Send Message BASIC Active Function module

Send a message to a auto-registered non-type-safe active message handler. This should be used rarely.

Send message using basic function handler. These handlers are NOT type-safe and require the user to cast their message to the correct type as shown. Most likely this will be deprecated unless there is a use for this, since type safety does not cost anything in terms of overhead (either at runtime or compile-time).

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

void basicHandler(vt::BaseMessage* msg_in) {
  MyMsg* msg = static_cast<MyMsg*>(msg_in);
  ...
}

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

Functions

template<ActiveFnType* f, typename MsgT>
auto broadcastMsg(MsgPtrThief<MsgT> msg, bool deliver_to_sender = true, TagType tag = no_tag) -> PendingSendType
Broadcast a message with a type-safe handler.
template<ActiveFnType* f, typename MsgT>
auto sendMsg(NodeType dest, MsgPtrThief<MsgT> msg, TagType tag = no_tag) -> PendingSendType
Send a message with a type-safe handler.

Function documentation

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

Broadcast a message with a type-safe handler.

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

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

Send a message with a type-safe handler.

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