read/write for basic types
All checks were successful
Linux arm64 / Build (push) Successful in 14s

This commit is contained in:
2025-06-26 16:02:18 +02:00
parent 073872df94
commit 59bedd6482
6 changed files with 76 additions and 3 deletions

View File

@@ -5,8 +5,9 @@
#include <cstdint>
#include <iostream>
#include <fstream>
enum class PacketID { KeepAlive = 0};
enum class PacketID { KeepAlive = 0 };
class PacketHandler;
@@ -38,6 +39,9 @@ using PacketFactory = sp::MessageFactory<PacketBase, AllMessages>;
int main() {
KeepAliveMessage m{5UL};
// dispatch tests
MyHandler h;
PacketDispatcher d;
d.RegisterHandler(PacketID::KeepAlive, &h);
@@ -45,5 +49,17 @@ int main() {
PacketFactory f;
auto message = f.CreateMessage(PacketID::KeepAlive);
d.Dispatch(*message);
// write tests
std::ofstream file {"test.bin"};
message->Write(file);
// file << std::endl;
m.Write(file);
// file << std::endl;
// message->Read(file);
return 0;
}