You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lokinet/llarp/tooling/router_event.hpp

57 lines
935 B
C++

#pragma once
#include <router_id.hpp>
#include <string>
#include <vector>
#include <memory>
namespace llarp
{
struct PathID_t;
namespace path
{
struct Path;
struct PathHopConfig;
struct TransitHop;
} // namespace path
} // namespace llarp
namespace tooling
{
struct RouterHive;
struct RouterEvent
{
RouterEvent(std::string eventType, llarp::RouterID routerID, bool triggered)
: eventType(eventType), routerID(routerID), triggered(triggered)
{}
virtual ~RouterEvent() = default;
virtual std::string
ToString() const
{
std::string result;
result += eventType;
result += " [";
result += routerID.ShortString();
result += "] -- ";
return result;
}
const std::string eventType;
llarp::RouterID routerID;
bool triggered = false;
};
using RouterEventPtr = std::unique_ptr<RouterEvent>;
} // namespace tooling