GHS
Leader Election Based on GHS Minimum Spanning Tree
|
An aggregate type containing all the data to exchange with to/from information. More...
#include <msg.h>
Public Member Functions | |
Msg (agent_t to, agent_t from, msg::NoopPayload p) | |
A type-specific constructor for each payload type. | |
Msg (agent_t to, agent_t from, msg::SrchPayload p) | |
Msg (agent_t to, agent_t from, msg::SrchRetPayload p) | |
Msg (agent_t to, agent_t from, msg::InPartPayload p) | |
Msg (agent_t to, agent_t from, msg::AckPartPayload p) | |
Msg (agent_t to, agent_t from, msg::NackPartPayload p) | |
Msg (agent_t to, agent_t from, msg::JoinUsPayload p) | |
Msg (agent_t to, agent_t from, const Msg &other) | |
Msg (agent_t to, agent_t from, msg::Type t, msg::Data d) | |
agent_t | to () const |
agent_t | from () const |
msg::Type | type () const |
msg::Data | data () const |
An aggregate type containing all the data to exchange with to/from information.
The Msg struct contains all the data which is passed between GhsState objects operating on different systems to coordinate the construction of an MST.
The usual way to construct a Msg is to construct the payload from a struct of type Msg::Data, then to call to_msg() on that payload.
In the example case, the field other_guy
is used twice, but that may not be the case always. to_msg takes the extra step of setting the to/from fields appropriately and seperate from the payload fields. I specifically made this design design to defend myself from myself after messing up the data fields far too often.
A 'redirect' constructor that perserves type and payload, but allows new to/from fields
A generic constructor for generic data, and known type