28 lines
569 B
C++
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;
|
|
};
|