LibNRG  0.0.1
Networking for Real-time Games library
 All Classes Files Functions Variables Friends
nrg::Message< id, Args > Class Template Reference

Variadic template class that encodes / decodes its data to and from Packets.

#include <nrg_message.h>

Inheritance diagram for nrg::Message< id, Args >:
nrg::MessageBase

Public Member Functions

 Message (Args...args)
 Standard Constructor for a Message to be sent over the network.
 
 Message (Message &&)=default
 Move Constructor.
 
 Message (const Message &)=default
 Copy Constructor.
 
template<class F >
 Message (F &&func)
 Internally used Constructor for a Message that will run a callback function.
 
template<size_t n>
const std::tuple_element< n,
MsgTuple >::type & 
get () const
 Returns the element of the Message specified by the template parameter n.
 
template<size_t n>
void set (const typename tuple_element< n, MsgTuple >::type &val)
 Sets the element of the Message specified by the template parameter n to val.
 
uint16_t getID () const
 Returns the user-defined Message ID.
 
void onReceive (uint32_t creation_ms)
 Function called when the message has been received.
 
MessageBaseclone () const
 Returns a copy of the derived class of this MessageBase.
 
MessageBasemove_clone ()
 Moves the derived class into the returned MessageBase.
 
size_t writeToPacket (Packet &p) const
 Writes this Message to the Packet p.
 
size_t readFromPacket (Packet &p)
 Reads this Message from the Packet p.
 
- Public Member Functions inherited from nrg::MessageBase
virtual ~MessageBase ()
 Standard Destructor.
 

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