lokinet/llarp/messages/common.hpp
dr7ana 1a9f977208 Message method implementation continued
- tons of surrounding stupid refactoring required
2023-10-03 13:00:32 -07:00

30 lines
551 B
C++

#pragma once
#include <llarp/util/buffer.hpp>
#include <oxenc/bt.h>
#include <llarp/util/logging.hpp>
namespace
{
static auto link_cat = llarp::log::Cat("lokinet.link");
} // namespace
namespace llarp
{
/// abstract base class for serialized messages
struct AbstractSerializable
{
virtual std::string
bt_encode() const = 0;
virtual void
bt_encode(oxenc::bt_dict_producer& btdp) const = 0;
};
struct AbstractMessageHandler
{
virtual bool
handle_message(AbstractSerializable&) = 0;
};
} // namespace llarp