1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00
lokinet/pybind/common.hpp
Thomas Winget c9a278c0de some more changes to pybind/hive code, read below
hive.py is currently largely for testing the pybind stuff, so changes to it will likely
be frequent and arbitrary for now.

Added pybind for llarp::path::PathHopConfig, but not every member -- just rc and upstream routerID

Hive now uses std::queue with mutex instead of our lockless queue.

Removed some functions from Hive that will not be necessary as things are being handled from python.
2020-03-03 19:57:09 -05:00

80 lines
1.4 KiB
C++

#pragma once
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include <pybind11/functional.h>
#include <nonstd/optional.hpp>
#include <unordered_map>
namespace py = pybind11;
namespace pybind11
{
namespace detail
{
template <typename Key, typename Value, typename Hash, typename Equal, typename Alloc> struct type_caster<std::unordered_multimap<Key, Value, Hash, Equal, Alloc>>
: map_caster<std::unordered_multimap<Key, Value, Hash, Equal, Alloc>, Key, Value> { };
template<typename T>
struct type_caster<nonstd::optional<T>>
: public optional_caster<nonstd::optional<T>> {};
/*
template <typename CharT, class Traits>
struct type_caster<simple_string_view>
: string_caster<simple_string_view, true> {};
*/
} // namespace pybind11::detail
} // namespace pybind11
namespace llarp
{
void
Context_Init(py::module &mod);
void
CryptoTypes_Init(py::module &mod);
void
RouterID_Init(py::module &mod);
void
RouterContact_Init(py::module &mod);
void
Config_Init(py::module & mod);
namespace path
{
void
PathHopConfig_Init(py::module & mod);
}
namespace handlers
{
void
PyHandler_Init(py::module & mod);
}
namespace service
{
void
Address_Init(py::module &mod);
}
} // namespace llarp
namespace tooling
{
void
RouterHive_Init(py::module & mod);
void
RouterEvent_Init(py::module & mod);
}