lokinet/llarp/tooling/router_event.hpp

58 lines
940 B
C++
Raw Normal View History

2020-02-26 19:19:38 +00:00
#pragma once
2020-02-27 21:16:46 +00:00
#include <router_id.hpp>
2020-02-26 19:19:38 +00:00
#include <string>
#include <vector>
2020-02-27 21:16:46 +00:00
#include <memory>
2020-02-26 19:19:38 +00:00
namespace llarp
{
struct PathID_t;
namespace path
{
2020-03-01 00:26:23 +00:00
struct Path;
struct PathHopConfig;
2020-03-01 00:26:23 +00:00
struct TransitHop;
2020-03-07 01:20:11 +00:00
} // namespace path
2020-02-26 19:19:38 +00:00
2020-03-07 01:20:11 +00:00
} // namespace llarp
2020-02-26 19:19:38 +00:00
namespace tooling
{
struct RouterHive;
2020-02-26 19:19:38 +00:00
struct RouterEvent
{
RouterEvent(std::string eventType, llarp::RouterID routerID, bool triggered)
: eventType(eventType), routerID(routerID), triggered(triggered)
{
}
2020-02-27 21:16:46 +00:00
2020-02-26 19:19:38 +00:00
virtual ~RouterEvent() = default;
2020-03-07 01:20:11 +00:00
virtual std::string
ToString() const
{
std::string result;
result += eventType;
result += " [";
result += routerID.ShortString();
result += "] -- ";
return result;
}
2020-03-01 02:04:28 +00:00
const std::string eventType;
2020-02-26 19:19:38 +00:00
llarp::RouterID routerID;
bool triggered = false;
2020-02-26 19:19:38 +00:00
};
using RouterEventPtr = std::unique_ptr<RouterEvent>;
2020-02-27 21:16:46 +00:00
2020-03-07 01:20:11 +00:00
} // namespace tooling