xbot/irc_thread.hpp
Eric Mertens a6b6a4179c 🐣
2023-11-22 19:59:34 -08:00

28 lines
569 B
C++

#pragma once
#include "ircmsg.hpp"
enum class EventOutcome
{
Pass,
Consume,
};
enum class ThreadOutcome
{
Continue,
Finish,
};
struct IrcThread
{
using priority_type = std::uint64_t;
using callback_result = std::pair<ThreadOutcome, EventOutcome>;
virtual ~IrcThread() {}
virtual auto on_connect() -> callback_result { return {}; }
virtual auto on_disconnect() -> callback_result { return {}; };
virtual auto on_msg(ircmsg const&) -> callback_result { return {}; };
virtual auto priority() const -> priority_type = 0;
};