working dispatcher + factory
All checks were successful
Linux arm64 / Build (push) Successful in 1m17s
All checks were successful
Linux arm64 / Build (push) Successful in 1m17s
This commit is contained in:
@@ -3,16 +3,15 @@
|
||||
#include <sp/protocol/GenericHandler.h>
|
||||
#include <sp/protocol/Message.h>
|
||||
|
||||
|
||||
namespace sp {
|
||||
class PacketHandler;
|
||||
|
||||
using PacketID = std::uint8_t;
|
||||
|
||||
using PacketMessage = Message<
|
||||
option::MsgIdType<std::uint8_t>, // add id() operation
|
||||
option::ReadOperations, // add read() operation
|
||||
option::WriteOperations, // add write() operation
|
||||
option::WriteId, // write id before data
|
||||
option::Handler<PacketHandler>, // add dispatch() operation
|
||||
option::DebugPrint // add ToString() operator
|
||||
option::MsgIdType<PacketID>, // add id() operation
|
||||
option::Handler<PacketHandler> // add dispatch() operation
|
||||
>;
|
||||
|
||||
#define PacketConstructor(packetName) \
|
||||
@@ -23,7 +22,7 @@ using PacketMessage = Message<
|
||||
}
|
||||
|
||||
#define DeclarePacket(packetName) \
|
||||
class packetName##Packet : public sp::MessageBase<sp::PacketMessage, sp::option::StaticNumIdImpl<packetName>, \
|
||||
class packetName##Packet : public sp::MessageBase<sp::PacketMessage, \
|
||||
sp::option::DispatchImpl<packetName##Packet>, sp::option::FieldsImpl<packetName##Fields>>, \
|
||||
sp::option::ToStringImpl<packetName##Packet>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user