better example
This commit is contained in:
16
include/sp/default/DefaultPacket.h
Normal file
16
include/sp/default/DefaultPacket.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include <sp/protocol/Message.h>
|
||||
#include <sp/protocol/GenericHandler.h>
|
||||
|
||||
namespace sp {
|
||||
class PacketHandler;
|
||||
|
||||
using PacketMessage = Message<
|
||||
option::MsgIdType<std::uint8_t>, // add id() operation
|
||||
option::ReadOperations, // add read() operation
|
||||
option::WriteOperations, // add write() operation
|
||||
option::Handler<PacketHandler> // add dispatch() operation
|
||||
>;
|
||||
|
||||
} // namespace sp
|
||||
9
include/sp/default/DefaultPacketHandler.h
Normal file
9
include/sp/default/DefaultPacketHandler.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <sp/protocol/GenericHandler.h>
|
||||
|
||||
// the tuple AllPackets must be defined !
|
||||
|
||||
namespace sp {
|
||||
class PacketHandler : public sp::GenericHandler<PacketMessage, AllPackets> {};
|
||||
} // namespace sp
|
||||
Reference in New Issue
Block a user