---
title: tooling::HiveContext
summary: HiveContext is a subclass of llarp::Context which allows RouterHive to perform custom behavior which might be undesirable in production code. 

---

# tooling::HiveContext



[HiveContext]() is a subclass of llarp::Context which allows [RouterHive]() to perform custom behavior which might be undesirable in production code. 


`#include <hive_context.hpp>`

Inherits from llarp::Context

## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[HiveContext](Classes/structtooling_1_1HiveContext.md#function-hivecontext)**([RouterHive](Classes/structtooling_1_1RouterHive.md) * hive) |
| std::shared_ptr< [llarp::AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) > | **[makeRouter](Classes/structtooling_1_1HiveContext.md#function-makerouter)**(const llarp::EventLoop_ptr & loop) override |
| [HiveRouter](Classes/structtooling_1_1HiveRouter.md) * | **[getRouterAsHiveRouter](Classes/structtooling_1_1HiveContext.md#function-getrouterashiverouter)**()<br>Get this context's router as a [HiveRouter]().  |

## Protected Attributes

|                | Name           |
| -------------- | -------------- |
| [RouterHive](Classes/structtooling_1_1RouterHive.md) * | **[m_hive](Classes/structtooling_1_1HiveContext.md#variable-m-hive)**  |

## Public Functions Documentation

### function HiveContext

```cpp
HiveContext(
    RouterHive * hive
)
```


### function makeRouter

```cpp
std::shared_ptr< llarp::AbstractRouter > makeRouter(
    const llarp::EventLoop_ptr & loop
) override
```


### function getRouterAsHiveRouter

```cpp
HiveRouter * getRouterAsHiveRouter()
```

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](Classes/structtooling_1_1HiveRouter.md). 


## Protected Attributes Documentation

### variable m_hive

```cpp
RouterHive * m_hive = nullptr;
```


-------------------------------

Updated on 2022-09-10 at 18:17:12 +0000