16 #include <type_traits> 40 while (!fns.empty()) {
41 auto fn = std::move(fns.front());
61 void reset(
bool relock=
false);
79 template <
typename Interface_,
typename Impl_>
138 template <
typename Interface,
typename Impl>
146 template <
typename Interface_,
typename Impl_>
156 using Interface_::Server::thisCap;
195 template <
typename Interface,
typename Impl>
222 template <
class _Class,
class _Result,
class... _Params>
228 using Param =
typename std::tuple_element<N, std::tuple<_Params...>>::type;
230 std::conditional_t<std::is_same_v<void, Result>,
Params,
TypeList<_Params..., _Result>>;
240 static decltype(
auto) Fwd(
Param<N>& arg) {
return static_cast<Param<N>&&
>(arg); }
257 template <
typename MethodParams,
typename Enable =
void>
264 template <
typename ServerContext>
282 template <
typename MethodParams>
284 :
public FunctionTraits<decltype(ProxyMethod<MethodParams>::impl)>
295 template <
typename MethodParams>
302 template <
typename MethodParams>
314 template <
typename Field,
int flags>
325 template <
typename Fn>
329 template <
typename Result,
typename... Args>
ProxyServerBase(std::shared_ptr< Impl > impl, Connection &connection)
EventLoop * operator->() const
Wrapper around std::function for passing std::function objects between client and servers...
Base class for generated ProxyClient classes that implement a C++ interface and forward calls to a ca...
Mapping from capnp method params type to method traits (specializations are generated by proxy-codege...
Object holding network & rpc state associated with either an incoming server connection, or an outgoing client connection.
std::conditional_t< std::is_same_v< void, Result >, Params, TypeList< _Params..., _Result > > Fields
Accessor type holding flags that determine how to access a message field.
std::shared_ptr< Impl > m_impl
Implementation pointer that may or may not be owned and deleted when this capnp server goes out of sc...
static constexpr int FIELD_REQUESTED
static void construct(Super &)
Generic utility functions used by capnp code.
Customizable (through template specialization) traits class used in generated ProxyServer implementat...
Functions to serialize / deserialize common bitcoin types.
Event loop implementation.
Context data associated with proxy client and server classes.
Customizable (through template specialization) base class which ProxyServer classes produced by gener...
Mapping from capnp interface type to proxy server implementation (specializations are generated by pr...
static constexpr int FIELD_BOXED
typename _Require< SfinaeExpr, Result >::Result Require
SFINAE helper, basically the same as to C++17's void_t, but allowing types other than void to be retu...
ProxyContext(Connection *connection)
static constexpr int FIELD_IN
Customizable (through template specialization) traits class used in generated ProxyClient implementat...
EventLoopRef(EventLoop &loop, Lock *lock=nullptr)
ServerInvokeContext< ProxyServer< Interface >, ::capnp::CallContext< Params, Results > > ServerContext
ProxyClientBase(typename Interface::Client client, Connection *connection, bool destroy_connection)
Construct libmultiprocess client object wrapping Cap'n Proto client object with a reference to the as...
Mapping from capnp struct type to struct traits (specializations are generated by proxy-codegen...
EventLoopRef(EventLoopRef &&other) noexcept
std::list< std::function< void()> > CleanupList
Mapping from local c++ type to capnp type and traits (specializations are generated by proxy-codegen...
static void invoke(ServerContext &)
static const bool requested
EventLoopRef & operator=(const EventLoopRef &)=delete
Customizable (through template specialization) base class used in generated ProxyClient implementatio...
static const bool optional
const CChainParams & Params()
Return the currently selected parameters.
typename std::tuple_element< N, std::tuple< _Params... > >::type Param
static constexpr int FIELD_OUT
static void destroy(Super &)
virtual ~ProxyServerBase()
ProxyServer destructor, called from the EventLoop thread by Cap'n Proto garbage collection code after...
Event loop smart pointer automatically managing m_num_clients.
Function traits class used to get method parameter and result types, used in generated ProxyClient an...
static constexpr int FIELD_OPTIONAL
Traits class for a proxy method, providing the same Params/Result/Param/Fields described in the Funct...
void invokeDestroy()
If the capnp interface defined a special "destroy" method, as described the ProxyClientBase class...
Interface::Client m_client
Base class for generated ProxyServer classes that implement capnp server methods and forward calls to...
typename CleanupList::iterator CleanupIt
void CleanupRun(CleanupList &fns)
EventLoop & operator*() const
Mapping from capnp interface type to proxy client implementation (specializations are generated by pr...
void reset(bool relock=false)
~ProxyClientBase() noexcept