tooling::RouterHive

Public Types

Name
using std::shared_ptr< HiveContext > Context_ptr

Public Functions

Name
RouterHive() =default
void AddRelay(const std::shared_ptr< llarp::Config > & conf)
void AddClient(const std::shared_ptr< llarp::Config > & conf)
void StartRelays()
void StartClients()
void StopRouters()
void NotifyEvent(RouterEventPtr event)
RouterEventPtr GetNextEvent()
std::deque< RouterEventPtr > GetAllEvents()
void ForEachRelay(std::function< void(Context_ptr)> visit)
void ForEachClient(std::function< void(Context_ptr)> visit)
void ForEachRouter(std::function< void(Context_ptr)> visit)
HiveRouter * GetRelay(const llarp::RouterID & id, bool needMutexLock =true)
std::vector< size_t > RelayConnectedRelays()
std::vector< llarp::RouterContact > GetRelayRCs()

Public Attributes

Name
std::mutex routerMutex
std::unordered_map< llarp::RouterID, Context_ptr > relays
std::unordered_map< llarp::RouterID, Context_ptr > clients
std::vector< std::thread > routerMainThreads
std::mutex eventQueueMutex
std::deque< RouterEventPtr > eventQueue

Public Types Documentation

using Context_ptr

using tooling::RouterHive::Context_ptr =  std::shared_ptr<HiveContext>;

Public Functions Documentation

function RouterHive

RouterHive() =default

function AddRelay

void AddRelay(
    const std::shared_ptr< llarp::Config > & conf
)

function AddClient

void AddClient(
    const std::shared_ptr< llarp::Config > & conf
)

function StartRelays

void StartRelays()

function StartClients

void StartClients()

function StopRouters

void StopRouters()

function NotifyEvent

void NotifyEvent(
    RouterEventPtr event
)

function GetNextEvent

RouterEventPtr GetNextEvent()

function GetAllEvents

std::deque< RouterEventPtr > GetAllEvents()

function ForEachRelay

void ForEachRelay(
    std::function< void(Context_ptr)> visit
)

function ForEachClient

void ForEachClient(
    std::function< void(Context_ptr)> visit
)

function ForEachRouter

void ForEachRouter(
    std::function< void(Context_ptr)> visit
)

function GetRelay

HiveRouter * GetRelay(
    const llarp::RouterID & id,
    bool needMutexLock =true
)

function RelayConnectedRelays

std::vector< size_t > RelayConnectedRelays()

function GetRelayRCs

std::vector< llarp::RouterContact > GetRelayRCs()

Public Attributes Documentation

variable routerMutex

std::mutex routerMutex;

variable relays

std::unordered_map< llarp::RouterID, Context_ptr > relays;

variable clients

std::unordered_map< llarp::RouterID, Context_ptr > clients;

variable routerMainThreads

std::vector< std::thread > routerMainThreads;

variable eventQueueMutex

std::mutex eventQueueMutex;

variable eventQueue

std::deque< RouterEventPtr > eventQueue;

Updated on 2026-01-10 at 22:49:45 +0000