mal-packet-weaver
C++20 packet serialization/deserialization library.
Loading...
Searching...
No Matches
packet-macro.hpp File Reference
#include <boost/preprocessor.hpp>
#include <boost/preprocessor/seq.hpp>
#include <boost/preprocessor/seq/for_each.hpp>
Include dependency graph for packet-macro.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MAL_PACKET_WEAVER_DECLARE_PACKET(PacketName, Subsystem, ID, TTL)
 Macro to declare an empty packet class with specific parameters.
 
#define MAL_PACKET_WEAVER_DECLARE_PAYLOAD_MEMBER(r, _, elem)   BOOST_PP_TUPLE_ELEM(0, elem) BOOST_PP_TUPLE_ELEM(1, elem);
 Internal macro to declare payload members.
 
#define MAL_PACKET_WEAVER_DECLARE_PAYLOAD_MEMBERS(seq)    BOOST_PP_SEQ_FOR_EACH(MAL_PACKET_WEAVER_DECLARE_PAYLOAD_MEMBER, _, seq)
 Macro to declare payload members using a Boost.PP sequence.
 
#define MAL_PACKET_WEAVER_DECLARE_BASE_CLASS_INHERITANCE(r, _, elem)
 Internal macro to declare inheritance for multiple base classes.
 
#define MAL_PACKET_WEAVER_DECLARE_BASE_CLASSES_INHERITANCE(seq)    BOOST_PP_SEQ_FOR_EACH(MAL_PACKET_WEAVER_DECLARE_BASE_CLASS_INHERITANCE, _, seq)
 Macro to declare inheritance for multiple base classes.
 
#define MAL_PACKET_WEAVER_DECLARE_BASE_CLASS_SERIALIZATION(r, _, elem)    ar(CEREAL_NVP(cereal::base_class<elem>(this)));
 Internal macro to declare serialization for multiple base classes.
 
#define MAL_PACKET_WEAVER_DECLARE_BASE_CLASSES_SERIALIZATION(seq)    BOOST_PP_SEQ_FOR_EACH(MAL_PACKET_WEAVER_DECLARE_BASE_CLASS_SERIALIZATION, _, seq)
 Macro to declare serialization for multiple base classes.
 
#define MAL_PACKET_WEAVER_SERIALIZE_MEMBER(r, ar, elem)   ar(CEREAL_NVP(BOOST_PP_TUPLE_ELEM(1, elem)));
 Internal macro to serialize payload members.
 
#define MAL_PACKET_WEAVER_SERIALIZE_MEMBERS(ar, seq)   BOOST_PP_SEQ_FOR_EACH(MAL_PACKET_WEAVER_SERIALIZE_MEMBER, ar, seq)
 Macro to serialize payload members using a Boost.PP sequence.
 
#define MAL_PACKET_WEAVER_VA_ARGS_COUNT(...)
 Macro to count the number of variadic arguments (up to 62 arguments).
 
#define MAL_PACKET_WEAVER_VA_ARGS_COUNT_IMPL( _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, N, ...)    N
 Internal macro to implement counting of variadic arguments.
 
#define MAL_PACKET_WEAVER_NON_EMPTY_SIZE(...)   MAL_PACKET_WEAVER_VA_ARGS_COUNT(__VA_ARGS__)
 Macro to determine the number of non-empty variadic arguments.
 
#define MAL_PACKET_WEAVER_DECLARE_PACKET_WITH_BODY_WITH_PAYLOAD(PacketName, Subsystem, ID, TTL, PACKET_BODY, ...)
 
#define MAL_PACKET_WEAVER_DECLARE_PACKET_WITH_BODY_WITHOUT_PAYLOAD(PacketName, Subsystem, ID, TTL, PACKET_BODY)
 
#define MAL_PACKET_WEAVER_DECLARE_PACKET_WITH_PAYLOAD(PacketName, Subsystem, ID, TTL, ...)    MAL_PACKET_WEAVER_DECLARE_PACKET_WITH_BODY_WITH_PAYLOAD(PacketName, Subsystem, ID, TTL, /* nothing */, __VA_ARGS__)
 Macro to declare an empty request packet and a response packet with payload.
 
#define MAL_PACKET_WEAVER_DECLARE_PACKET_WITHOUT_PAYLOAD(PacketName, Subsystem, ID, TTL)    MAL_PACKET_WEAVER_DECLARE_PACKET_WITH_BODY_WITHOUT_PAYLOAD(PacketName, Subsystem, ID, TTL, /* nothing */)
 Macro to declare an empty request packet and an empty response packet.
 
#define MAL_PACKET_WEAVER_DECLARE_DERIVED_PACKET_WITH_BODY_WITHOUT_PAYLOAD(PacketName, BasePackets, Subsystem, ID, TTL, PACKET_BODY)
 Macro to declare a derived packet class without payload but with a provided body and specific parameters.
 
#define MAL_PACKET_WEAVER_DECLARE_DERIVED_PACKET_WITH_BODY_WITH_PAYLOAD(PacketName, BasePackets, Subsystem, ID, TTL, PACKET_BODY, ...)
 Macro to declare a derived packet class without payload but with a provided body.
 
#define MAL_PACKET_WEAVER_DECLARE_DERIVED_PACKET_WITH_PAYLOAD(PacketName, BasePackets, Subsystem, ID, TTL, ...)
 Macro to declare a derived packet class with additional payload.
 
#define MAL_PACKET_WEAVER_DECLARE_DERIVED_PACKET_WITHOUT_PAYLOAD(PacketName, BasePackets, Subsystem, ID, TTL)
 Macro to declare a derived packet class without payload but with a provided body.
 
#define MAL_PACKET_WEAVER_DECLARE_EMPTY_REQUEST_AND_RESPONSE_WITH_PAYLOAD(PacketName, Subsystem, ID1, ID2, TTL1, TTL2, ...)
 Macro to declare an empty request packet and a response packet with specific parameters and payload.
 
#define MAL_PACKET_WEAVER_DECLARE_EMPTY_REQUEST_AND_RESPONSE_WITHOUT_PAYLOAD(PacketName, Subsystem, ID1, ID2, TTL1, TTL2, ...)
 Macro to declare an empty request packet and a response packet with specific parameters but without payload.
 
#define MAL_PACKET_WEAVER_DECLARE_EMPTY_REQUEST_AND_DERIVED_RESPONSE_WITH_PAYLOAD(PacketName, BasePackets, Subsystem, ID1, ID2, TTL1, TTL2, ...)
 Macro to declare a derived packet class without payload but with a provided body and specific parameters.
 
#define MAL_PACKET_WEAVER_DECLARE_EMPTY_REQUEST_AND_DERIVED_RESPONSE_WITHOUT_PAYLOAD(PacketName, BasePackets, Subsystem, ID1, ID2, TTL1, TTL2, ...)
 Macro to declare an empty request packet and a derived response packet without payload, with specific parameters.
 

Macro Definition Documentation

◆ MAL_PACKET_WEAVER_DECLARE_BASE_CLASS_INHERITANCE

#define MAL_PACKET_WEAVER_DECLARE_BASE_CLASS_INHERITANCE ( r,
_,
elem )
Value:
public \
elem,

Internal macro to declare inheritance for multiple base classes.

Definition at line 48 of file packet-macro.hpp.

◆ MAL_PACKET_WEAVER_DECLARE_BASE_CLASS_SERIALIZATION

#define MAL_PACKET_WEAVER_DECLARE_BASE_CLASS_SERIALIZATION ( r,
_,
elem )    ar(CEREAL_NVP(cereal::base_class<elem>(this)));

Internal macro to declare serialization for multiple base classes.

Definition at line 63 of file packet-macro.hpp.

◆ MAL_PACKET_WEAVER_DECLARE_BASE_CLASSES_INHERITANCE

#define MAL_PACKET_WEAVER_DECLARE_BASE_CLASSES_INHERITANCE ( seq)     BOOST_PP_SEQ_FOR_EACH(MAL_PACKET_WEAVER_DECLARE_BASE_CLASS_INHERITANCE, _, seq)

Macro to declare inheritance for multiple base classes.

Definition at line 56 of file packet-macro.hpp.

◆ MAL_PACKET_WEAVER_DECLARE_BASE_CLASSES_SERIALIZATION

#define MAL_PACKET_WEAVER_DECLARE_BASE_CLASSES_SERIALIZATION ( seq)     BOOST_PP_SEQ_FOR_EACH(MAL_PACKET_WEAVER_DECLARE_BASE_CLASS_SERIALIZATION, _, seq)

Macro to declare serialization for multiple base classes.

Definition at line 70 of file packet-macro.hpp.

◆ MAL_PACKET_WEAVER_DECLARE_DERIVED_PACKET_WITH_BODY_WITH_PAYLOAD

#define MAL_PACKET_WEAVER_DECLARE_DERIVED_PACKET_WITH_BODY_WITH_PAYLOAD ( PacketName,
BasePackets,
Subsystem,
ID,
TTL,
PACKET_BODY,
... )
Value:
class PacketName final : MAL_PACKET_WEAVER_DECLARE_BASE_CLASSES_INHERITANCE(BOOST_PP_TUPLE_TO_SEQ( \
BasePackets)) public mal_packet_weaver::DerivedPacket<PacketName> \
{ \
public: \
static constexpr char const *const static_packet_name = #PacketName; \
const char* packet_name() const final { return static_packet_name; } \
static constexpr mal_packet_weaver::UniquePacketID static_unique_id = \
mal_packet_weaver::CreatePacketID(Subsystem, ID); \
static constexpr float time_to_live = TTL; \
MAL_PACKET_WEAVER_DECLARE_PAYLOAD_MEMBERS(BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__)) \
PACKET_BODY \
private: \
friend class cereal::access; \
template <class Archive> \
void serialize(Archive &ar) \
{ \
MAL_PACKET_WEAVER_DECLARE_BASE_CLASSES_SERIALIZATION(BOOST_PP_TUPLE_TO_SEQ(BasePackets)) \
MAL_PACKET_WEAVER_SERIALIZE_MEMBERS(ar, BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__)) \
} \
}; \
A templated class representing a derived packet from the base Packet class.
Definition packet.hpp:114
void serialize(Archive &, const unsigned int)
Definition packet.hpp:89
virtual const char * packet_name() const =0
uint32_t UniquePacketID
Unique identifier for a packet, combining subsystem and packet IDs.
Definition packet.hpp:16
#define MAL_PACKET_WEAVER_DECLARE_BASE_CLASSES_INHERITANCE(seq)
Macro to declare inheritance for multiple base classes.
Helper class for registering a packet type with the PacketFactory.

Macro to declare a derived packet class without payload but with a provided body.

Parameters
PacketNameThe name of the packet class.
BasePacketsThe tuple of base classes.
SubsystemThe subsystem identifier.
IDThe packet identifier.
TTLThe time-to-live value.
PACKET_BODYThe body of the packet(function declarations, private/public members, non-serializable once, etc.)
...Payload members for the response packet. They should be defined as tuples, like this: (int, value), (typename, valuename)

Definition at line 244 of file packet-macro.hpp.

◆ MAL_PACKET_WEAVER_DECLARE_DERIVED_PACKET_WITH_BODY_WITHOUT_PAYLOAD

#define MAL_PACKET_WEAVER_DECLARE_DERIVED_PACKET_WITH_BODY_WITHOUT_PAYLOAD ( PacketName,
BasePackets,
Subsystem,
ID,
TTL,
PACKET_BODY )
Value:
class PacketName final : MAL_PACKET_WEAVER_DECLARE_BASE_CLASSES_INHERITANCE(BOOST_PP_TUPLE_TO_SEQ( \
BasePackets)) public mal_packet_weaver::DerivedPacket<PacketName> \
{ \
public: \
static constexpr char const *const static_packet_name = #PacketName; \
const char* packet_name() const final { return static_packet_name; } \
static constexpr mal_packet_weaver::UniquePacketID static_unique_id = \
mal_packet_weaver::CreatePacketID(Subsystem, ID); \
static constexpr float time_to_live = TTL; \
PACKET_BODY \
private: \
friend class cereal::access; \
template <class Archive> \
void serialize(Archive &ar) \
{ \
MAL_PACKET_WEAVER_DECLARE_BASE_CLASSES_SERIALIZATION(BOOST_PP_TUPLE_TO_SEQ(BasePackets)) \
} \
}; \

Macro to declare a derived packet class without payload but with a provided body and specific parameters.

Parameters
PacketNameThe name of the packet class.
BasePacketsThe base classes declared as tuple (BaseClass, BaseClass2, ...).
SubsystemThe subsystem identifier.
IDThe packet identifier.
TTLThe time-to-live value.
PACKET_BODYThe body of the packet(function declarations, private/public members, non-serializable once, etc.)

Definition at line 208 of file packet-macro.hpp.

◆ MAL_PACKET_WEAVER_DECLARE_DERIVED_PACKET_WITH_PAYLOAD

#define MAL_PACKET_WEAVER_DECLARE_DERIVED_PACKET_WITH_PAYLOAD ( PacketName,
BasePackets,
Subsystem,
ID,
TTL,
... )
Value:
MAL_PACKET_WEAVER_DECLARE_DERIVED_PACKET_WITH_BODY_WITH_PAYLOAD(PacketName, BasePackets, Subsystem, ID, TTL, \
/* nothing */, __VA_ARGS__)
#define MAL_PACKET_WEAVER_DECLARE_DERIVED_PACKET_WITH_BODY_WITH_PAYLOAD(PacketName, BasePackets, Subsystem, ID, TTL, PACKET_BODY,...)
Macro to declare a derived packet class without payload but with a provided body.

Macro to declare a derived packet class with additional payload.

Parameters
PacketNameThe name of the packet class.
BasePacketsThe base classes declared as tuple (BaseClass, BaseClass2, ...).
SubsystemThe subsystem identifier.
IDThe packet identifier.
TTLThe time-to-live value.
...Payload members for the response packet. They should be defined as tuples, like this: (int, value), (typename, valuename)

Definition at line 280 of file packet-macro.hpp.

◆ MAL_PACKET_WEAVER_DECLARE_DERIVED_PACKET_WITHOUT_PAYLOAD

#define MAL_PACKET_WEAVER_DECLARE_DERIVED_PACKET_WITHOUT_PAYLOAD ( PacketName,
BasePackets,
Subsystem,
ID,
TTL )
Value:
MAL_PACKET_WEAVER_DECLARE_DERIVED_PACKET_WITH_BODY_WITHOUT_PAYLOAD(PacketName, BasePackets, Subsystem, ID, TTL, \
/* nothing */)
#define MAL_PACKET_WEAVER_DECLARE_DERIVED_PACKET_WITH_BODY_WITHOUT_PAYLOAD(PacketName, BasePackets, Subsystem, ID, TTL, PACKET_BODY)
Macro to declare a derived packet class without payload but with a provided body and specific paramet...

Macro to declare a derived packet class without payload but with a provided body.

Parameters
PacketNameThe name of the packet class.
BasePacketsThe base classes declared as tuple (BaseClass, BaseClass2, ...).
SubsystemThe subsystem identifier.
IDThe packet identifier.
TTLThe time-to-live value.

Definition at line 293 of file packet-macro.hpp.

◆ MAL_PACKET_WEAVER_DECLARE_EMPTY_REQUEST_AND_DERIVED_RESPONSE_WITH_PAYLOAD

#define MAL_PACKET_WEAVER_DECLARE_EMPTY_REQUEST_AND_DERIVED_RESPONSE_WITH_PAYLOAD ( PacketName,
BasePackets,
Subsystem,
ID1,
ID2,
TTL1,
TTL2,
... )
Value:
MAL_PACKET_WEAVER_DECLARE_PACKET(PacketName##Request, Subsystem, ID1, TTL1) \
MAL_PACKET_WEAVER_DECLARE_DERIVED_PACKET_WITH_PAYLOAD(PacketName##Response, BasePackets, Subsystem, ID2, TTL2, \
__VA_ARGS__)
#define MAL_PACKET_WEAVER_DECLARE_PACKET(PacketName, Subsystem, ID, TTL)
Macro to declare an empty packet class with specific parameters.

Macro to declare a derived packet class without payload but with a provided body and specific parameters.

Parameters
PacketNameThe name of the packet class.
BasePacketsThe base classes declared as tuple (BaseClass, BaseClass2, ...).
SubsystemThe subsystem identifier.
IDThe packet identifier.
TTLThe time-to-live value.
...Payload members for the response packet. They should be defined as tuples, like this: (int, value), (typename, valuename)

Definition at line 345 of file packet-macro.hpp.

◆ MAL_PACKET_WEAVER_DECLARE_EMPTY_REQUEST_AND_DERIVED_RESPONSE_WITHOUT_PAYLOAD

#define MAL_PACKET_WEAVER_DECLARE_EMPTY_REQUEST_AND_DERIVED_RESPONSE_WITHOUT_PAYLOAD ( PacketName,
BasePackets,
Subsystem,
ID1,
ID2,
TTL1,
TTL2,
... )
Value:
MAL_PACKET_WEAVER_DECLARE_PACKET(PacketName##Request, Subsystem, ID1, TTL1) \
MAL_PACKET_WEAVER_DECLARE_DERIVED_PACKET_WITHOUT_PAYLOAD(PacketName##Response, BasePackets, Subsystem, ID2, TTL2)

Macro to declare an empty request packet and a derived response packet without payload, with specific parameters.

Parameters
PacketNameThe base name for the request and response packets.
BasePacketsThe base classes declared as tuple (BaseClass, BaseClass2, ...).
ID1The packet identifier for the request.
ID2The packet identifier for the response.
TTL1The time-to-live value for the request.
TTL2The time-to-live value for the response.
...Payload members for the response packet. They should be defined as tuples, like this: (int, value), (typename, valuename)

Definition at line 364 of file packet-macro.hpp.

◆ MAL_PACKET_WEAVER_DECLARE_EMPTY_REQUEST_AND_RESPONSE_WITH_PAYLOAD

#define MAL_PACKET_WEAVER_DECLARE_EMPTY_REQUEST_AND_RESPONSE_WITH_PAYLOAD ( PacketName,
Subsystem,
ID1,
ID2,
TTL1,
TTL2,
... )
Value:
MAL_PACKET_WEAVER_DECLARE_PACKET(PacketName##Request, Subsystem, ID1, TTL1) \
MAL_PACKET_WEAVER_DECLARE_PACKET_WITH_PAYLOAD(PacketName##Response, Subsystem, ID2, TTL2, __VA_ARGS__)

Macro to declare an empty request packet and a response packet with specific parameters and payload.

Parameters
PacketNameThe name of the packet class.
SubsystemThe subsystem identifier.
ID1The packet identifier for the request.
ID2The packet identifier for the response.
TTL1The time-to-live value for the request.
TTL2The time-to-live value for the response.
...Payload members for the response packet. They should be defined as tuples, like this: (int, value), (typename, valuename)

Definition at line 310 of file packet-macro.hpp.

◆ MAL_PACKET_WEAVER_DECLARE_EMPTY_REQUEST_AND_RESPONSE_WITHOUT_PAYLOAD

#define MAL_PACKET_WEAVER_DECLARE_EMPTY_REQUEST_AND_RESPONSE_WITHOUT_PAYLOAD ( PacketName,
Subsystem,
ID1,
ID2,
TTL1,
TTL2,
... )
Value:
MAL_PACKET_WEAVER_DECLARE_PACKET(PacketName##Request, Subsystem, ID1, TTL1) \
MAL_PACKET_WEAVER_DECLARE_PACKET_WITHOUT_PAYLOAD(PacketName##Response, Subsystem, ID2, TTL2)

Macro to declare an empty request packet and a response packet with specific parameters but without payload.

Parameters
PacketNameThe base name for the request and response packets.
SubsystemThe subsystem identifier.
ID1The packet identifier for the request.
ID2The packet identifier for the response.
TTL1The time-to-live value for the request.
TTL2The time-to-live value for the response.
...Payload members for the response packet. They should be defined as tuples, like this: (int, value), (typename, valuename)

Definition at line 328 of file packet-macro.hpp.

◆ MAL_PACKET_WEAVER_DECLARE_PACKET

#define MAL_PACKET_WEAVER_DECLARE_PACKET ( PacketName,
Subsystem,
ID,
TTL )
Value:
class PacketName final : public mal_packet_weaver::DerivedPacket<PacketName> \
{ \
public: \
static constexpr char const *const static_packet_name = #PacketName; \
const char* packet_name() const final { return static_packet_name; } \
static constexpr mal_packet_weaver::UniquePacketID static_unique_id = \
mal_packet_weaver::CreatePacketID(Subsystem, ID); \
static constexpr float time_to_live = TTL; \
}; \

Macro to declare an empty packet class with specific parameters.

Parameters
PacketNameThe name of the packet class.
SubsystemThe subsystem identifier.
IDThe packet identifier.
TTLThe time-to-live value.

Definition at line 18 of file packet-macro.hpp.

◆ MAL_PACKET_WEAVER_DECLARE_PACKET_WITH_BODY_WITH_PAYLOAD

#define MAL_PACKET_WEAVER_DECLARE_PACKET_WITH_BODY_WITH_PAYLOAD ( PacketName,
Subsystem,
ID,
TTL,
PACKET_BODY,
... )
Value:
class PacketName final : public mal_packet_weaver::DerivedPacket<PacketName> \
{ \
public: \
static constexpr char const *const static_packet_name = #PacketName; \
const char* packet_name() const final { return static_packet_name; } \
static constexpr mal_packet_weaver::UniquePacketID static_unique_id = \
mal_packet_weaver::CreatePacketID(Subsystem, ID); \
static constexpr float time_to_live = TTL; \
\
MAL_PACKET_WEAVER_DECLARE_PAYLOAD_MEMBERS(BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__)) \
\
PACKET_BODY \
private: \
friend class cereal::access; \
template <class Archive> \
void serialize(Archive &ar) \
{ \
MAL_PACKET_WEAVER_SERIALIZE_MEMBERS(ar, BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__)) \
} \
}; \

Definition at line 121 of file packet-macro.hpp.

◆ MAL_PACKET_WEAVER_DECLARE_PACKET_WITH_BODY_WITHOUT_PAYLOAD

#define MAL_PACKET_WEAVER_DECLARE_PACKET_WITH_BODY_WITHOUT_PAYLOAD ( PacketName,
Subsystem,
ID,
TTL,
PACKET_BODY )
Value:
class PacketName final : public mal_packet_weaver::DerivedPacket<PacketName> \
{ \
public: \
static constexpr char const *const static_packet_name = #PacketName; \
const char* packet_name() const final { return static_packet_name; } \
static constexpr mal_packet_weaver::UniquePacketID static_unique_id = \
mal_packet_weaver::CreatePacketID(Subsystem, ID); \
static constexpr float time_to_live = TTL; \
\
PACKET_BODY \
private: \
}; \

Definition at line 154 of file packet-macro.hpp.

◆ MAL_PACKET_WEAVER_DECLARE_PACKET_WITH_PAYLOAD

#define MAL_PACKET_WEAVER_DECLARE_PACKET_WITH_PAYLOAD ( PacketName,
Subsystem,
ID,
TTL,
... )    MAL_PACKET_WEAVER_DECLARE_PACKET_WITH_BODY_WITH_PAYLOAD(PacketName, Subsystem, ID, TTL, /* nothing */, __VA_ARGS__)

Macro to declare an empty request packet and a response packet with payload.

Parameters
PacketNameThe base name for the request and response packets.
SubsystemThe subsystem identifier.
ID1The packet identifier for the request.
ID2The packet identifier for the response.
TTL1The time-to-live value for the request.
TTL2The time-to-live value for the response.
...Payload members for the response packet. They should be defined as tuples, like this: (int, value), (typename, valuename)

Definition at line 181 of file packet-macro.hpp.

◆ MAL_PACKET_WEAVER_DECLARE_PACKET_WITHOUT_PAYLOAD

#define MAL_PACKET_WEAVER_DECLARE_PACKET_WITHOUT_PAYLOAD ( PacketName,
Subsystem,
ID,
TTL )    MAL_PACKET_WEAVER_DECLARE_PACKET_WITH_BODY_WITHOUT_PAYLOAD(PacketName, Subsystem, ID, TTL, /* nothing */)

Macro to declare an empty request packet and an empty response packet.

Parameters
PacketNameThe base name for the request and response packets.
SubsystemThe subsystem identifier.
ID1The packet identifier for the request.
ID2The packet identifier for the response.
TTL1The time-to-live value for the request.
TTL2The time-to-live value for the response.

Definition at line 194 of file packet-macro.hpp.

◆ MAL_PACKET_WEAVER_DECLARE_PAYLOAD_MEMBER

#define MAL_PACKET_WEAVER_DECLARE_PAYLOAD_MEMBER ( r,
_,
elem )   BOOST_PP_TUPLE_ELEM(0, elem) BOOST_PP_TUPLE_ELEM(1, elem);

Internal macro to declare payload members.

Definition at line 35 of file packet-macro.hpp.

◆ MAL_PACKET_WEAVER_DECLARE_PAYLOAD_MEMBERS

#define MAL_PACKET_WEAVER_DECLARE_PAYLOAD_MEMBERS ( seq)     BOOST_PP_SEQ_FOR_EACH(MAL_PACKET_WEAVER_DECLARE_PAYLOAD_MEMBER, _, seq)

Macro to declare payload members using a Boost.PP sequence.

Definition at line 41 of file packet-macro.hpp.

◆ MAL_PACKET_WEAVER_NON_EMPTY_SIZE

#define MAL_PACKET_WEAVER_NON_EMPTY_SIZE ( ...)    MAL_PACKET_WEAVER_VA_ARGS_COUNT(__VA_ARGS__)

Macro to determine the number of non-empty variadic arguments.

Definition at line 109 of file packet-macro.hpp.

◆ MAL_PACKET_WEAVER_SERIALIZE_MEMBER

#define MAL_PACKET_WEAVER_SERIALIZE_MEMBER ( r,
ar,
elem )   ar(CEREAL_NVP(BOOST_PP_TUPLE_ELEM(1, elem)));

Internal macro to serialize payload members.

Definition at line 77 of file packet-macro.hpp.

◆ MAL_PACKET_WEAVER_SERIALIZE_MEMBERS

#define MAL_PACKET_WEAVER_SERIALIZE_MEMBERS ( ar,
seq )   BOOST_PP_SEQ_FOR_EACH(MAL_PACKET_WEAVER_SERIALIZE_MEMBER, ar, seq)

Macro to serialize payload members using a Boost.PP sequence.

Definition at line 83 of file packet-macro.hpp.

◆ MAL_PACKET_WEAVER_VA_ARGS_COUNT

#define MAL_PACKET_WEAVER_VA_ARGS_COUNT ( ...)
Value:
MAL_PACKET_WEAVER_VA_ARGS_COUNT_IMPL(__VA_ARGS__, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, \
46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, \
27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, \
7, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0)
#define MAL_PACKET_WEAVER_VA_ARGS_COUNT_IMPL( _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, N,...)
Internal macro to implement counting of variadic arguments.

Macro to count the number of variadic arguments (up to 62 arguments).

Definition at line 89 of file packet-macro.hpp.

◆ MAL_PACKET_WEAVER_VA_ARGS_COUNT_IMPL

#define MAL_PACKET_WEAVER_VA_ARGS_COUNT_IMPL ( _1,
_2,
_3,
_4,
_5,
_6,
_7,
_8,
_9,
_10,
_11,
_12,
_13,
_14,
_15,
_16,
_17,
_18,
_19,
_20,
_21,
_22,
_23,
_24,
_25,
_26,
_27,
_28,
_29,
_30,
_31,
_32,
_33,
_34,
_35,
_36,
_37,
_38,
_39,
_40,
_41,
_42,
_43,
_44,
_45,
_46,
_47,
_48,
_49,
_50,
_51,
_52,
_53,
_54,
_55,
_56,
_57,
_58,
_59,
_60,
_61,
_62,
_63,
N,
... )    N

Internal macro to implement counting of variadic arguments.

Definition at line 99 of file packet-macro.hpp.