mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-17 15:25:35 +00:00
7caa87862e
All #ifndef guards on headers have been removed, I think, in favor of #pragma once Headers are now included as `#include "filename"` if the included file resides in the same directory as the file including it, or any subdirectory therein. Otherwise they are included as `#include <project/top/dir/relative/path/filename>` The above does not include system/os headers.
29 lines
741 B
C++
29 lines
741 B
C++
#pragma once
|
|
|
|
#include <llarp.hpp>
|
|
#include "hive_router.hpp"
|
|
|
|
namespace tooling
|
|
{
|
|
/// HiveContext is a subclass of llarp::Context which allows RouterHive to
|
|
/// perform custom behavior which might be undesirable in production code.
|
|
struct HiveContext : public llarp::Context
|
|
{
|
|
HiveContext(RouterHive* hive);
|
|
|
|
std::shared_ptr<llarp::AbstractRouter>
|
|
makeRouter(const llarp::EventLoop_ptr& loop) override;
|
|
|
|
/// Get this context's router as a HiveRouter.
|
|
///
|
|
/// Returns nullptr if there is no router or throws an exception if the
|
|
/// router is somehow not an instance of HiveRouter.
|
|
HiveRouter*
|
|
getRouterAsHiveRouter();
|
|
|
|
protected:
|
|
RouterHive* m_hive = nullptr;
|
|
};
|
|
|
|
} // namespace tooling
|