mirror of https://github.com/oxen-io/lokinet
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.
32 lines
705 B
C++
32 lines
705 B
C++
#include <tooling/hive_context.hpp>
|
|
|
|
#include <tooling/hive_router.hpp>
|
|
|
|
namespace tooling
|
|
{
|
|
HiveContext::HiveContext(RouterHive* hive) : m_hive(hive)
|
|
{
|
|
}
|
|
|
|
std::unique_ptr<llarp::AbstractRouter>
|
|
HiveContext::makeRouter(llarp_ev_loop_ptr netloop, std::shared_ptr<llarp::Logic> logic)
|
|
{
|
|
return std::make_unique<HiveRouter>(netloop, logic, m_hive);
|
|
}
|
|
|
|
HiveRouter*
|
|
HiveContext::getRouterAsHiveRouter()
|
|
{
|
|
if (not router)
|
|
return nullptr;
|
|
|
|
HiveRouter* hiveRouter = dynamic_cast<HiveRouter*>(router.get());
|
|
|
|
if (hiveRouter == nullptr)
|
|
throw std::runtime_error("HiveContext has a router not of type HiveRouter");
|
|
|
|
return hiveRouter;
|
|
}
|
|
|
|
} // namespace tooling
|