ProtocolMessage#
- class ProtocolMessage#
A message in a multi-party protocol.
- get_destination_role(self: pyhelayers.ProtocolMessage) pyhelayers.MultiPartyRole #
Get the destination role of this message.
- Returns:
The destination role.
- Return type:
MultiPartyRole.
- get_metadata_as_string(self: pyhelayers.ProtocolMessage, single_line: bool) str #
- Parameters:
single_line (bool.) – Whether to print the metadata in a single line.
- Returns:
Returns the metadata of this protocol message object as a string.
- Return type:
str.
- get_protocol_type(self: pyhelayers.ProtocolMessage) pyhelayers.ProtocolType #
Get the protocol type of the protocol of this message.
- Returns:
The protocol type.
- Return type:
ProtocolType.
- get_source_participant_id(self: pyhelayers.ProtocolMessage) int #
Get the source participant ID of this message.
- Returns:
The source participant ID.
- Return type:
int.
- get_to_be_received_on_round(self: pyhelayers.ProtocolMessage) int #
Get the round number in which this message is to be received by the destination.
- Returns:
The round number.
- Return type:
int.
-
class ProtocolMessage : public helayers::Saveable#
A message in a multi-party protocol.
Public Functions
-
ProtocolMessage(const HeContext &he)#
Construct an empty ProtocolMessage.
- Parameters:
he – The HeContext.
-
ProtocolMessage(const HeContext &he, ProtocolType protocolType, MultiPartyRole destRole, int32_t toBeReceivedOnRound)#
Construct a ProtocolMessage.
- Parameters:
he – The HeContext.
protocolType – The protocol type of the protocol of this message.
destRole – The destination role of this message.
toBeReceivedOnRound – The round number in which this message is to be received by the destination.
-
ProtocolMessage(const ProtocolMessage &src)#
Copy constructor.
- Parameters:
src – Object to copy.
-
ProtocolMessage(ProtocolMessage &&src) noexcept#
Move constructor.
- Parameters:
src – Object to move.
-
ProtocolMessage &operator=(const ProtocolMessage &src)#
Copy from another object.
- Parameters:
src – Object to copy.
-
ProtocolMessage &operator=(ProtocolMessage &&src) noexcept#
Move from another object.
- Parameters:
src – [in] Object to move.
-
ProtocolType getProtocolType() const#
Get the protocol type of the protocol of this message.
-
int32_t getSourceParticipantId() const#
Get the source participant ID of this message.
-
MultiPartyRole getDestinationRole() const#
Get the destination role of this message.
-
int32_t getToBeReceivedOnRound() const#
Get the round number in which this message is to be received by the destination.
-
inline const AbstractProtocolMessage &getImpl() const#
Reserved for debugging and internal use.
-
inline AbstractProtocolMessage &getImpl()#
Reserved for debugging and internal use.
-
virtual void saveImpl(std::ostream &stream) const override#
Saves the content of this object to the given stream.
- Parameters:
stream – The stream to save to.
-
virtual void loadImpl(std::istream &stream) override#
Loads the content of this object from the given stream.
- Parameters:
stream – The stream to load from.
-
std::string getMetadataAsString(bool singleLine = false) const#
Returns the metadata of this protocol message object as a string.
- Parameters:
singleLine – Whether to print the metadata in a single line.
-
virtual void debugPrint(const std::string &title = "", Verbosity verbosity = VERBOSITY_REGULAR, std::ostream &out = std::cout) const override#
Prints the content of this object.
- Parameters:
title – Text to add to the print
verbosity – Verbosity level
out – Output stream
-
ProtocolMessage(const HeContext &he)#