nexuslua
Loading...
Searching...
No Matches
nexuslua::Message Struct Reference

This type is the actual message type that is sent by function send. More...

#include <message.hpp>

Collaboration diagram for nexuslua::Message:

Public Member Functions

 Message (int agent_n, const std::string &my_name, const LuaTable &my_parameters)
 Message (int agent_n, const Message &message)
 Message (int agent_n)
 Message ()=default
virtual ~Message ()=default
std::string GetOriginalMessageNameOrEmpty () const
 return the original message name, in case this message is a reply to a message that specified a reply_to sub table
LuaTable GetOriginalMessageParametersOrEmpty () const
 return the original message parameters, in case this message is a reply to a message that specified a reply_to sub table
virtual std::shared_ptr< Messageclone () const

Public Attributes

int agent_n = -1
std::string name
 name of the message; second parameter of send
LuaTable parameters
 parameter table of the message; third parameter of send

Static Public Attributes

static constexpr std::string_view originalMessageTableId {"original_message"}
 name of the SubTable that stores the original message, in case this message is a reply to a message that specified a reply_to sub table
static constexpr std::string_view originalMessageNameId {"message_name"}
 name of an entry that stores the original message name, in case this message is a reply to a message that specified a reply_to sub table
static constexpr std::string_view originalMessageParametersId {"parameters"}
 name of an entry that stores the original message parameters, in case this message is a reply to a message that specified a reply_to sub table

Detailed Description

This type is the actual message type that is sent by function send.

If the message contains a sub table reply_to with entries agent and message, the original message will be included in the result message in a SubTable named original_message with entries message_name and parameters.

Constructor & Destructor Documentation

◆ Message() [1/4]

nexuslua::Message::Message ( int agent_n,
const std::string & my_name,
const LuaTable & my_parameters )
inline

◆ Message() [2/4]

nexuslua::Message::Message ( int agent_n,
const Message & message )
inline

◆ Message() [3/4]

nexuslua::Message::Message ( int agent_n)
inline

◆ Message() [4/4]

nexuslua::Message::Message ( )
default

◆ ~Message()

virtual nexuslua::Message::~Message ( )
virtualdefault

Member Function Documentation

◆ clone()

virtual std::shared_ptr< Message > nexuslua::Message::clone ( ) const
inlinevirtual

◆ GetOriginalMessageNameOrEmpty()

std::string nexuslua::Message::GetOriginalMessageNameOrEmpty ( ) const

return the original message name, in case this message is a reply to a message that specified a reply_to sub table

◆ GetOriginalMessageParametersOrEmpty()

LuaTable nexuslua::Message::GetOriginalMessageParametersOrEmpty ( ) const

return the original message parameters, in case this message is a reply to a message that specified a reply_to sub table

Member Data Documentation

◆ agent_n

int nexuslua::Message::agent_n = -1

◆ name

std::string nexuslua::Message::name

name of the message; second parameter of send

◆ originalMessageNameId

std::string_view nexuslua::Message::originalMessageNameId {"message_name"}
staticconstexpr

name of an entry that stores the original message name, in case this message is a reply to a message that specified a reply_to sub table

◆ originalMessageParametersId

std::string_view nexuslua::Message::originalMessageParametersId {"parameters"}
staticconstexpr

name of an entry that stores the original message parameters, in case this message is a reply to a message that specified a reply_to sub table

◆ originalMessageTableId

std::string_view nexuslua::Message::originalMessageTableId {"original_message"}
staticconstexpr

name of the SubTable that stores the original message, in case this message is a reply to a message that specified a reply_to sub table

◆ parameters

LuaTable nexuslua::Message::parameters

parameter table of the message; third parameter of send


The documentation for this struct was generated from the following file: