Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
mp Namespace Reference

Functions to serialize / deserialize common bitcoin types. More...

Namespaces

namespace  test

Classes

struct  InvokeContext
struct  ClientInvokeContext
struct  ServerInvokeContext
struct  ProxyClient< Thread >
struct  ProxyServer< Thread >
class  LoggingErrorHandler
 Handler for kj::TaskSet failed task events. More...
struct  LogMessage
struct  LogOptions
class  Logger
class  EventLoop
struct  Waiter
class  Connection
struct  ServerVatId
struct  ThreadContext
class  ValueField
struct  StructField
struct  ReadDestEmplace
struct  ReadDestUpdate
struct  ListOutput
struct  ListOutput<::capnp::List< T, kind > >
struct  IterateFieldsHelper
struct  IterateFields
struct  ClientException
struct  ClientParam
struct  ServerCall
struct  ServerDestroy
struct  ServerRet
struct  ServerExcept
struct  ServerField
struct  CapRequestTraits
struct  CapRequestTraits<::capnp::Request< _Params, _Results > >
struct  ProxyTypeRegister
struct  ProxyClient
struct  ProxyServer
struct  ProxyMethod
 Mapping from capnp method params type to method traits (specializations are generated by proxy-codegen.cpp). More...
struct  ProxyStruct
 Mapping from capnp struct type to struct traits (specializations are generated by proxy-codegen.cpp). More...
struct  ProxyType
 Mapping from local c++ type to capnp type and traits (specializations are generated by proxy-codegen.cpp). More...
class  EventLoopRef
struct  ProxyContext
 Context data associated with proxy client and server classes. More...
class  ProxyClientBase
class  ProxyClientCustom
struct  ProxyServerBase
struct  ProxyServerCustom
struct  FunctionTraits
struct  FunctionTraits< _Result(_Class::*const)(_Params...)>
struct  ProxyMethodTraits
struct  ProxyMethodTraits< MethodParams, Require< decltype(ProxyMethod< MethodParams >::impl)> >
struct  ProxyClientMethodTraits
struct  ProxyServerMethodTraits
struct  Accessor
 Accessor type holding flags that determine how to access a message field. More...
class  ProxyCallback
 Wrapper around std::function for passing std::function objects between client and servers. More...
class  ProxyCallback< std::function< Result(Args...)> >
 Specialization of above to separate Result and Arg types. More...
class  ProxyCallbackImpl
 Adapter to convert ProxyCallback object call to function object call. More...
struct  ProxyCallFn
struct  ProxyServer< ThreadMap >
struct  TypeList
 Generic utility functions used by capnp code. More...
struct  Split
struct  Split< 0, _Second, _First, true >
 Specialization of above (base case). More...
struct  Split< index, TypeList< Type, _Second... >, TypeList< _First... >, false >
 Specialization of above (recursive case). More...
struct  _Require
 SFINAE helper, see using Require below. More...
struct  Priority
struct  Priority< 0 >
 Specialization of above (base case). More...
struct  PtrOrValue
 Convenient wrapper around std::variant<T*, T>. More...
class  Lock
struct  GuardedRef
struct  UnlockGuard
 Analog to std::lock_guard that unlocks instead of locks. More...
struct  InterruptException
 Exception thrown from code executing an IPC call that is interrupted. More...
class  CancelMonitor
class  CancelProbe
 Helper object to attach to a promise and update a CancelMonitor. More...

Concepts

concept  IsSpanOf
concept  IsByteSpan

Typedefs

template<typename Interface, typename Params, typename Results>
using ServerContext = ServerInvokeContext<ProxyServer<Interface>, ::capnp::CallContext<Params, Results>>
using LogFn = std::function<void(LogMessage)>
using ConnThreads = std::map<Connection*, std::optional<ProxyClient<Thread>>>
using ConnThread = ConnThreads::iterator
using CleanupList = std::list<std::function<void()>>
using CleanupIt = typename CleanupList::iterator
template<typename Callable>
using ResultOf = decltype(std::declval<Callable>()())
 Type helper giving return type of a callable type.
template<typename T>
using RemoveCvRef = std::remove_cv_t<std::remove_reference_t<T>>
 Substitutue for std::remove_cvref_t.
template<typename T>
using Decay = std::decay_t<T>
 Type helper abbreviating std::decay.
template<typename SfinaeExpr, typename Result = void>
using Require = typename _Require<SfinaeExpr, Result>::Result
 SFINAE helper, basically the same as to C++17's void_t, but allowing types other than void to be returned.
using FdToArgsFn = std::function<std::vector<std::string>(int fd)>
 Callback type used by SpawnProcess below.

Enumerations

enum class  Log {
  Trace = 0 , Debug , Info , Warning ,
  Error , Raise
}
 Log flags. Update stringify function if changed! More...

Functions

template<typename LocalType, typename Value, typename Output>
requires Serializable<LocalType, DataStream> && std::is_same_v<LocalType, std::remove_cv_t<std::remove_reference_t<LocalType>>>
void CustomBuildField (TypeList< LocalType >, Priority< 1 >, InvokeContext &invoke_context, Value &&value, Output &&output)
template<typename LocalType, typename Input, typename ReadDest>
requires Unserializable<LocalType, DataStream> && (!ipc::capnp::Deserializable<LocalType>)
decltype(auto) CustomReadField (TypeList< LocalType >, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest)
template<typename LocalType, typename Input, typename ReadDest>
requires ipc::capnp::Deserializable<LocalType>
decltype(auto) CustomReadField (TypeList< LocalType >, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest)
template<typename Value, typename Output>
void CustomBuildField (TypeList< UniValue >, Priority< 1 >, InvokeContext &invoke_context, Value &&value, Output &&output)
template<typename Input, typename ReadDest>
decltype(auto) CustomReadField (TypeList< UniValue >, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest)
kj::StringPtr KJ_STRINGIFY (Log flags)
std::string LongThreadName (const char *exe_name)
std::tuple< ConnThread, bool > SetThread (GuardedRef< ConnThreads > threads, Connection *connection, const std::function< Thread::Client()> &make_thread)
template<typename InitInterface>
std::unique_ptr< ProxyClient< InitInterface > > ConnectStream (EventLoop &loop, int fd)
template<typename InitInterface, typename InitImpl>
void _Serve (EventLoop &loop, kj::Own< kj::AsyncIoStream > &&stream, InitImpl &init)
template<typename InitInterface, typename InitImpl>
void _Listen (EventLoop &loop, kj::Own< kj::ConnectionReceiver > &&listener, InitImpl &init)
template<typename InitInterface, typename InitImpl>
void ServeStream (EventLoop &loop, int fd, InitImpl &init)
template<typename InitInterface, typename InitImpl>
void ListenConnections (EventLoop &loop, int fd, InitImpl &init)
template<typename LocalType>
auto ReadDestTemp ()
template<typename... LocalTypes, typename Input>
bool CustomHasField (TypeList< LocalTypes... >, InvokeContext &invoke_context, const Input &input)
template<typename... LocalTypes, typename Input, typename... Args>
decltype(auto) ReadField (TypeList< LocalTypes... >, InvokeContext &invoke_context, Input &&input, Args &&... args)
template<typename LocalType, typename Input>
void ThrowField (TypeList< LocalType >, InvokeContext &invoke_context, Input &&input)
template<typename Input>
void ThrowField (TypeList< std::exception >, InvokeContext &invoke_context, Input &&input)
template<typename... Values>
bool CustomHasValue (InvokeContext &invoke_context, const Values &... value)
template<typename... LocalTypes, typename Context, typename... Values, typename Output>
void BuildField (TypeList< LocalTypes... >, Context &context, Output &&output, Values &&... values)
template<typename LocalType, typename Value, typename Output>
void CustomBuildField (TypeList< LocalType >, Priority< 0 >, InvokeContext &invoke_context, Value &&value, Output &&output)
template<typename Accessor, typename LocalType, typename ServerContext, typename Fn, typename... Args>
auto PassField (Priority< 1 >, TypeList< LocalType & >, ServerContext &server_context, Fn &&fn, Args &&... args) -> Require< typename decltype(Accessor::get(server_context.call_context.getParams()))::Calls >
 PassField override for callable interface reference arguments.
template<typename... Args>
void MaybeBuildField (std::true_type, Args &&... args)
template<typename... Args>
void MaybeBuildField (std::false_type, Args &&...)
template<typename... Args>
void MaybeReadField (std::true_type, Args &&... args)
template<typename... Args>
void MaybeReadField (std::false_type, Args &&...)
template<typename LocalType, typename Value, typename Output>
void MaybeSetWant (TypeList< LocalType * >, Priority< 1 >, const Value &value, Output &&output)
template<typename LocalTypes, typename... Args>
void MaybeSetWant (LocalTypes, Priority< 0 >, const Args &...)
template<typename Accessor, typename LocalType, typename ServerContext, typename Fn, typename... Args>
void PassField (Priority< 0 >, TypeList< LocalType >, ServerContext &server_context, Fn &&fn, Args &&... args)
 Default PassField implementation calling MaybeReadField/MaybeBuildField.
template<typename Accessor, typename ServerContext, typename Fn, typename... Args>
void PassField (Priority< 0 >, TypeList<>, ServerContext &server_context, const Fn &fn, Args &&... args)
 Default PassField implementation for count(0) arguments, calling ReadField/BuildField.
template<typename Accessor, typename... Types>
ClientParam< Accessor, Types... > MakeClientParam (Types &&... values)
template<typename Accessor, typename Message>
decltype(auto) MaybeGet (Message &&message, decltype(Accessor::get(message)) *enable=nullptr)
template<typename Accessor>
::capnp::Void MaybeGet (...)
template<class Accessor>
void CustomPassField ()
template<typename Accessor, typename... Args>
auto PassField (Priority< 2 >, Args &&... args) -> decltype(CustomPassField< Accessor >(std::forward< Args >(args)...))
template<int argc, typename Accessor, typename Parent>
ServerField< argc, Accessor, Parent > MakeServerField (Parent parent)
template<typename Client>
void clientDestroy (Client &client)
template<typename Server>
void serverDestroy (Server &server)
template<typename ProxyClient, typename GetRequest, typename... FieldObjs>
void clientInvoke (ProxyClient &proxy_client, const GetRequest &get_request, FieldObjs &&... fields)
template<typename Fn, typename Ret>
auto ReplaceVoid (Fn &&fn, Ret &&ret)
template<typename Server, typename CallContext, typename Fn>
kj::Promise< void > serverInvoke (Server &server, CallContext &call_context, Fn fn)
void CleanupRun (CleanupList &fns)
template<typename Output, size_t size>
void CustomBuildField (TypeList< const unsigned char * >, Priority< 3 >, InvokeContext &invoke_context, const unsigned char(&value)[size], Output &&output)
template<size_t size, typename Input, typename ReadDest>
decltype(auto) CustomReadField (TypeList< unsigned char[size]>, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest)
template<class Rep, class Period, typename Value, typename Output>
void CustomBuildField (TypeList< std::chrono::duration< Rep, Period > >, Priority< 1 >, InvokeContext &invoke_context, Value &&value, Output &&output)
template<class Rep, class Period, typename Input, typename ReadDest>
decltype(auto) CustomReadField (TypeList< std::chrono::duration< Rep, Period > >, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest)
template<typename Output>
void CustomBuildField (TypeList<>, Priority< 1 >, ClientInvokeContext &invoke_context, Output &&output, typename std::enable_if< std::is_same< decltype(output.get()), Context::Builder >::value >::type *enable=nullptr)
template<typename Accessor, typename ServerContext, typename Fn, typename... Args>
auto PassField (Priority< 1 >, TypeList<>, ServerContext &server_context, const Fn &fn, Args &&... args) -> typename std::enable_if< std::is_same< decltype(Accessor::get(server_context.call_context.getParams())), Context::Reader >::value, kj::Promise< typename ServerContext::CallContext > >::type
template<typename LocalType, typename Value, typename Output>
requires (std::is_same_v<decltype(output.get()), ::capnp::Data::Builder> && IsByteSpan<LocalType>)
void CustomBuildField (TypeList< LocalType >, Priority< 2 >, InvokeContext &invoke_context, Value &&value, Output &&output)
template<typename LocalType, typename Input, typename ReadDest>
requires (std::is_same_v<decltype(input.get()), ::capnp::Data::Reader> && IsByteSpan<LocalType>)
decltype(auto) CustomReadField (TypeList< LocalType >, Priority< 2 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest)
template<typename LocalType, typename Value, typename Output>
void CustomBuildField (TypeList< const LocalType >, Priority< 0 >, InvokeContext &invoke_context, Value &&value, Output &&output)
template<typename LocalType, typename Value, typename Output>
void CustomBuildField (TypeList< LocalType & >, Priority< 0 >, InvokeContext &invoke_context, Value &&value, Output &&output)
template<typename LocalType, typename Value, typename Output>
void CustomBuildField (TypeList< LocalType && >, Priority< 0 >, InvokeContext &invoke_context, Value &&value, Output &&output)
template<typename Output>
void CustomBuildField (TypeList< std::exception >, Priority< 1 >, InvokeContext &invoke_context, const std::exception &value, Output &&output)
template<typename Value, typename FnR, typename... FnParams, typename Output>
void CustomBuildField (TypeList< std::function< FnR(FnParams...)> >, Priority< 1 >, InvokeContext &invoke_context, Value &&value, Output &&output)
template<typename FnR, typename... FnParams, typename Input, typename ReadDest>
decltype(auto) CustomReadField (TypeList< std::function< FnR(FnParams...)> > types, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest)
template<typename Interface, typename Impl>
kj::Own< typename Interface::Server > MakeProxyServer (InvokeContext &context, std::shared_ptr< Impl > impl)
template<typename Interface, typename Impl>
kj::Own< typename Interface::Server > CustomMakeProxyServer (InvokeContext &context, std::shared_ptr< Impl > &&impl)
template<typename Impl, typename Value, typename Output>
void CustomBuildField (TypeList< std::unique_ptr< Impl > >, Priority< 1 >, InvokeContext &invoke_context, Value &&value, Output &&output, typename Decay< decltype(output.get())>::Calls *enable=nullptr)
template<typename Impl, typename Value, typename Output>
void CustomBuildField (TypeList< std::shared_ptr< Impl > >, Priority< 2 >, InvokeContext &invoke_context, Value &&value, Output &&output, typename Decay< decltype(output.get())>::Calls *enable=nullptr)
template<typename Impl, typename Output>
void CustomBuildField (TypeList< Impl & >, Priority< 1 >, InvokeContext &invoke_context, Impl &value, Output &&output, typename decltype(output.get())::Calls *enable=nullptr)
template<typename Interface, typename Impl>
std::unique_ptr< Impl > MakeProxyClient (InvokeContext &context, typename Interface::Client &&client)
template<typename Interface, typename Impl>
std::unique_ptr< Impl > CustomMakeProxyClient (InvokeContext &context, typename Interface::Client &&client)
template<typename LocalType, typename Input, typename ReadDest>
decltype(auto) CustomReadField (TypeList< std::unique_ptr< LocalType > >, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest, typename Decay< decltype(input.get())>::Calls *enable=nullptr)
template<typename LocalType, typename Input, typename ReadDest>
decltype(auto) CustomReadField (TypeList< std::shared_ptr< LocalType > >, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest, typename Decay< decltype(input.get())>::Calls *enable=nullptr)
template<typename KeyLocalType, typename ValueLocalType, typename Value, typename Output>
void CustomBuildField (TypeList< std::map< KeyLocalType, ValueLocalType > >, Priority< 1 >, InvokeContext &invoke_context, Value &&value, Output &&output)
template<class Map, class Tuple1, class Tuple2>
auto EmplacePiecewiseSafe (Map &m, const std::piecewise_construct_t &, Tuple1 &&t1, Tuple2 &&t2)
template<typename KeyLocalType, typename ValueLocalType, typename Input, typename ReadDest>
decltype(auto) CustomReadField (TypeList< std::map< KeyLocalType, ValueLocalType > >, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest)
template<typename LocalType, typename Value, typename Output>
void CustomBuildField (TypeList< LocalType >, Priority< 2 >, InvokeContext &invoke_context, Value &&value, Output &&output, decltype(CustomBuildMessage(invoke_context, value, std::move(output.get()))) *enable=nullptr)
template<typename LocalType, typename Input, typename ReadDest>
decltype(auto) CustomReadField (TypeList< LocalType >, Priority< 2 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest, decltype(CustomReadMessage(invoke_context, input.get(), std::declval< LocalType & >())) *enable=nullptr)
template<typename Accessor, typename Message>
decltype(auto) MaybeInit (Message &&message, decltype(Accessor::get(message)) *enable=nullptr)
template<typename Accessor>
::capnp::Void MaybeInit (...)
template<typename Accessor, typename... LocalTypes, typename ServerContext, typename Fn, typename... Args>
auto CustomPassField (TypeList< LocalTypes... >, ServerContext &server_context, Fn &&fn, Args &&... args) -> decltype(CustomPassMessage(server_context, MaybeGet< Accessor >(server_context.call_context.getParams()), MaybeGet< Accessor >(server_context.call_context.getResults()), nullptr))
template<typename LocalType, typename Value>
LocalType BuildPrimitive (InvokeContext &invoke_context, const Value &value, TypeList< LocalType >, typename std::enable_if< std::is_enum< Value >::value >::type *enable=nullptr)
template<typename LocalType, typename Value>
LocalType BuildPrimitive (InvokeContext &invoke_context, const Value &value, TypeList< LocalType >, typename std::enable_if< std::is_integral< Value >::value, int >::type *enable=nullptr)
template<typename LocalType, typename Value>
LocalType BuildPrimitive (InvokeContext &invoke_context, const Value &value, TypeList< LocalType >, typename std::enable_if< std::is_floating_point< Value >::value >::type *enable=nullptr)
template<typename LocalType, typename Input, typename ReadDest>
decltype(auto) CustomReadField (TypeList< LocalType >, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest, typename std::enable_if< std::is_enum< LocalType >::value >::type *enable=nullptr)
template<typename LocalType, typename Input, typename ReadDest>
decltype(auto) CustomReadField (TypeList< LocalType >, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest, typename std::enable_if< std::is_integral< LocalType >::value >::type *enable=nullptr)
template<typename LocalType, typename Input, typename ReadDest>
decltype(auto) CustomReadField (TypeList< LocalType >, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest, typename std::enable_if< std::is_floating_point< LocalType >::value >::type *enable=0)
template<typename LocalType, typename Value, typename Output>
void CustomBuildField (TypeList< std::optional< LocalType > >, Priority< 1 >, InvokeContext &invoke_context, Value &&value, Output &&output)
template<typename LocalType, typename Input, typename ReadDest>
decltype(auto) CustomReadField (TypeList< std::optional< LocalType > >, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest)
template<typename KeyLocalType, typename ValueLocalType, typename Value, typename Output>
void CustomBuildField (TypeList< std::pair< KeyLocalType, ValueLocalType > >, Priority< 1 >, InvokeContext &invoke_context, Value &&value, Output &&output)
template<typename KeyLocalType, typename ValueLocalType, typename Input, typename ReadDest>
decltype(auto) CustomReadField (TypeList< std::pair< KeyLocalType, ValueLocalType > >, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest)
template<typename LocalType, typename Value, typename Output>
void CustomBuildField (TypeList< LocalType * >, Priority< 3 >, InvokeContext &invoke_context, Value &&value, Output &&output)
template<typename LocalType, typename Value, typename Output>
void CustomBuildField (TypeList< std::shared_ptr< LocalType > >, Priority< 1 >, InvokeContext &invoke_context, Value &&value, Output &&output)
template<typename LocalType, typename Input, typename ReadDest>
decltype(auto) CustomReadField (TypeList< LocalType * >, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest)
template<typename LocalType, typename Input, typename ReadDest>
decltype(auto) CustomReadField (TypeList< std::shared_ptr< LocalType > >, Priority< 0 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest)
template<typename LocalType, typename Input, typename ReadDest>
decltype(auto) CustomReadField (TypeList< std::shared_ptr< const LocalType > >, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest)
template<typename Accessor, typename LocalType, typename ServerContext, typename Fn, typename... Args>
void PassField (Priority< 1 >, TypeList< LocalType * >, ServerContext &server_context, const Fn &fn, Args &&... args)
 PassField override for C++ pointer arguments.
template<typename LocalType, typename Value, typename Output>
void CustomBuildField (TypeList< std::set< LocalType > >, Priority< 1 >, InvokeContext &invoke_context, Value &&value, Output &&output)
template<typename LocalType, typename Input, typename ReadDest>
decltype(auto) CustomReadField (TypeList< std::set< LocalType > >, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest)
template<typename Value, typename Output>
void CustomBuildField (TypeList< std::string >, Priority< 1 >, InvokeContext &invoke_context, Value &&value, Output &&output)
template<typename Input, typename ReadDest>
decltype(auto) CustomReadField (TypeList< std::string >, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest)
template<size_t index, typename LocalType, typename Value, typename Output>
void BuildOne (TypeList< LocalType > param, InvokeContext &invoke_context, Output &&output, Value &&value, typename std::enable_if< index< ProxyType< LocalType >::fields >::type *enable=nullptr)
template<size_t index, typename LocalType, typename Value, typename Output>
void BuildOne (TypeList< LocalType > param, InvokeContext &invoke_context, Output &&output, Value &&value, typename std::enable_if< index==ProxyType< LocalType >::fields >::type *enable=nullptr)
template<typename LocalType, typename Value, typename Output>
void CustomBuildField (TypeList< LocalType > local_type, Priority< 1 >, InvokeContext &invoke_context, Value &&value, Output &&output, typename ProxyType< LocalType >::Struct *enable=nullptr)
template<size_t index, typename LocalType, typename Input, typename Value>
void ReadOne (TypeList< LocalType > param, InvokeContext &invoke_context, Input &&input, Value &&value, typename std::enable_if< index !=ProxyType< LocalType >::fields >::type *enable=nullptr)
template<size_t index, typename LocalType, typename Input, typename Value>
void ReadOne (TypeList< LocalType > param, InvokeContext &invoke_context, Input &input, Value &value, typename std::enable_if< index==ProxyType< LocalType >::fields >::type *enable=nullptr)
template<typename LocalType, typename Input, typename ReadDest>
decltype(auto) CustomReadField (TypeList< LocalType > param, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest, typename ProxyType< LocalType >::Struct *enable=nullptr)
template<typename Output>
void CustomBuildField (TypeList<>, Priority< 1 >, InvokeContext &invoke_context, Output &&output, typename std::enable_if< std::is_same< decltype(output.get()), ThreadMap::Client >::value >::type *enable=nullptr)
template<typename Input>
decltype(auto) CustomReadField (TypeList<>, Priority< 1 >, InvokeContext &invoke_context, Input &&input, typename std::enable_if< std::is_same< decltype(input.get()), ThreadMap::Client >::value >::type *enable=nullptr)
template<typename KeyLocalType, typename ValueLocalType, typename Value, typename Output>
void CustomBuildField (TypeList< std::tuple< KeyLocalType, ValueLocalType > >, Priority< 1 >, InvokeContext &invoke_context, Value &&value, Output &&output)
template<typename KeyLocalType, typename ValueLocalType, typename Input, typename ReadDest>
decltype(auto) CustomReadField (TypeList< std::tuple< KeyLocalType, ValueLocalType > >, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest)
template<typename LocalType, typename Value, typename Output>
void CustomBuildField (TypeList< std::vector< LocalType > >, Priority< 1 >, InvokeContext &invoke_context, Value &&value, Output &&output)
static bool BuildPrimitive (InvokeContext &invoke_context, std::vector< bool >::const_reference value, TypeList< bool >)
template<typename LocalType, typename Input, typename ReadDest>
decltype(auto) CustomReadField (TypeList< std::vector< LocalType > >, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest)
template<typename Input, typename ReadDest>
decltype(auto) CustomReadField (TypeList< std::vector< bool > >, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest)
template<typename Value>
::capnp::Void BuildPrimitive (InvokeContext &invoke_context, Value &&, TypeList<::capnp::Void >)
template<typename LocalType, typename Output>
void CustomBuildField (TypeList< LocalType >, Priority< 1 >, InvokeContext &invoke_context, ::capnp::Void, Output &&output)
template<template< typename... > class Class, typename... Types, typename... Args>
Class< Types..., std::remove_reference_t< Args >... > Make (Args &&... args)
template<typename T>
const char * TypeName ()
 Return capnp type name with filename prefix removed.
class MP_CAPABILITY ("mutex") Mutex
template<class U>
 GuardedRef (Mutex &, U &) -> GuardedRef< U >
template<typename Lock, typename Callback>
void Unlock (Lock &lock, Callback &&callback)
template<typename Fn, typename After>
decltype(auto) TryFinally (Fn &&fn, After &&after)
std::string ThreadName (const char *exe_name)
 Format current thread name as "{exe_name}-{$pid}/{thread_name}-{$tid}".
std::string LogEscape (const kj::StringTree &string, size_t max_size)
int SpawnProcess (int &pid, FdToArgsFn &&fd_to_args)
void ExecProcess (const std::vector< std::string > &args)
int WaitProcess (int pid)
 Wait for a process to exit and return its exit code.
char * CharCast (char *c)
char * CharCast (unsigned char *c)
const char * CharCast (const char *c)
const char * CharCast (const unsigned char *c)
template<typename Input>
bool CustomHasField (TypeList< test::FooData >, InvokeContext &invoke_context, const Input &input)
void CustomBuildMessage (InvokeContext &invoke_context, const test::FooMessage &src, test::messages::FooMessage::Builder &&builder)
void CustomReadMessage (InvokeContext &invoke_context, const test::messages::FooMessage::Reader &reader, test::FooMessage &dest)
void CustomBuildMessage (InvokeContext &invoke_context, const test::FooMutable &src, test::messages::FooMutable::Builder &&builder)
void CustomReadMessage (InvokeContext &invoke_context, const test::messages::FooMutable::Reader &reader, test::FooMutable &dest)
void CustomPassMessage (InvokeContext &invoke_context, const test::messages::FooMutable::Reader &reader, test::messages::FooMutable::Builder builder, std::function< void(test::FooMutable &)> &&fn)

Variables

ThreadContext g_thread_context
std::atomic< int > server_reqs {0}
static constexpr int FIELD_IN = 1
static constexpr int FIELD_OUT = 2
static constexpr int FIELD_OPTIONAL = 4
static constexpr int FIELD_REQUESTED = 8
static constexpr int FIELD_BOXED = 16

Detailed Description

Functions to serialize / deserialize common bitcoin types.

Typedef Documentation

◆ CleanupIt

using mp::CleanupIt = typename CleanupList::iterator

Definition at line 37 of file proxy.h.

◆ CleanupList

using mp::CleanupList = std::list<std::function<void()>>

Definition at line 36 of file proxy.h.

◆ ConnThread

using mp::ConnThread = ConnThreads::iterator

Definition at line 654 of file proxy-io.h.

◆ ConnThreads

using mp::ConnThreads = std::map<Connection*, std::optional<ProxyClient<Thread>>>

Map from Connection to local or remote thread handle which will be used over that connection. This map will typically only contain one entry, but can contain multiple if a single thread makes IPC calls over multiple connections. A std::optional value type is used to avoid the map needing to be locked while ProxyClient<Thread> objects are constructed, see ThreadContext "Synchronization note" below.

Definition at line 653 of file proxy-io.h.

◆ Decay

template<typename T>
using mp::Decay = std::decay_t<T>

Type helper abbreviating std::decay.

Definition at line 86 of file util.h.

◆ FdToArgsFn

using mp::FdToArgsFn = std::function<std::vector<std::string>(int fd)>

Callback type used by SpawnProcess below.

Definition at line 253 of file util.h.

◆ LogFn

using mp::LogFn = std::function<void(LogMessage)>

Definition at line 147 of file proxy-io.h.

◆ RemoveCvRef

template<typename T>
using mp::RemoveCvRef = std::remove_cv_t<std::remove_reference_t<T>>

Substitutue for std::remove_cvref_t.

Definition at line 82 of file util.h.

◆ Require

template<typename SfinaeExpr, typename Result = void>
using mp::Require = typename _Require<SfinaeExpr, Result>::Result

SFINAE helper, basically the same as to C++17's void_t, but allowing types other than void to be returned.

Definition at line 97 of file util.h.

◆ ResultOf

template<typename Callable>
using mp::ResultOf = decltype(std::declval<Callable>()())

Type helper giving return type of a callable type.

Definition at line 78 of file util.h.

◆ ServerContext

template<typename Interface, typename Params, typename Results>
using mp::ServerContext = ServerInvokeContext<ProxyServer<Interface>, ::capnp::CallContext<Params, Results>>

Definition at line 72 of file proxy-io.h.

Enumeration Type Documentation

◆ Log

enum class mp::Log
strong

Log flags. Update stringify function if changed!

Enumerator
Trace 
Debug 
Info 
Warning 
Error 
Raise 

Definition at line 127 of file proxy-io.h.

Function Documentation

◆ _Listen()

template<typename InitInterface, typename InitImpl>
void mp::_Listen ( EventLoop & loop,
kj::Own< kj::ConnectionReceiver > && listener,
InitImpl & init )

Given connection receiver and an init object, handle incoming connections by calling _Serve, to create ProxyServer objects and forward requests to the init object.

Definition at line 844 of file proxy-io.h.

Here is the caller graph for this function:

◆ _Serve()

template<typename InitInterface, typename InitImpl>
void mp::_Serve ( EventLoop & loop,
kj::Own< kj::AsyncIoStream > && stream,
InitImpl & init )

Given stream and init objects, construct a new ProxyServer object that handles requests from the stream by calling the init object. Embed the ProxyServer in a Connection object that is stored and erased if disconnected. This should be called from the event loop thread.

Definition at line 824 of file proxy-io.h.

Here is the caller graph for this function:

◆ BuildField()

template<typename... LocalTypes, typename Context, typename... Values, typename Output>
void mp::BuildField ( TypeList< LocalTypes... > ,
Context & context,
Output && output,
Values &&... values )

Definition at line 250 of file proxy-types.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BuildOne() [1/2]

template<size_t index, typename LocalType, typename Value, typename Output>
void mp::BuildOne ( TypeList< LocalType > param,
InvokeContext & invoke_context,
Output && output,
Value && value )

Definition at line 12 of file type-struct.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BuildOne() [2/2]

template<size_t index, typename LocalType, typename Value, typename Output>
void mp::BuildOne ( TypeList< LocalType > param,
InvokeContext & invoke_context,
Output && output,
Value && value,
typename std::enable_if< index==ProxyType< LocalType >::fields >::type * enable = nullptr )

Definition at line 28 of file type-struct.h.

◆ BuildPrimitive() [1/5]

template<typename LocalType, typename Value>
LocalType mp::BuildPrimitive ( InvokeContext & invoke_context,
const Value & value,
TypeList< LocalType > ,
typename std::enable_if< std::is_enum< Value >::value >::type * enable = nullptr )

Definition at line 12 of file type-number.h.

Here is the caller graph for this function:

◆ BuildPrimitive() [2/5]

template<typename LocalType, typename Value>
LocalType mp::BuildPrimitive ( InvokeContext & invoke_context,
const Value & value,
TypeList< LocalType > ,
typename std::enable_if< std::is_floating_point< Value >::value >::type * enable = nullptr )

Definition at line 37 of file type-number.h.

◆ BuildPrimitive() [3/5]

template<typename LocalType, typename Value>
LocalType mp::BuildPrimitive ( InvokeContext & invoke_context,
const Value & value,
TypeList< LocalType > ,
typename std::enable_if< std::is_integral< Value >::value, int >::type * enable = nullptr )

Definition at line 24 of file type-number.h.

◆ BuildPrimitive() [4/5]

bool mp::BuildPrimitive ( InvokeContext & invoke_context,
std::vector< bool >::const_reference value,
TypeList< bool >  )
inlinestatic

Definition at line 27 of file type-vector.h.

◆ BuildPrimitive() [5/5]

template<typename Value>
::capnp::Void mp::BuildPrimitive ( InvokeContext & invoke_context,
Value && ,
TypeList<::capnp::Void >  )

Definition at line 12 of file type-void.h.

◆ CharCast() [1/4]

char * mp::CharCast ( char * c)
inline

Definition at line 272 of file util.h.

Here is the caller graph for this function:

◆ CharCast() [2/4]

const char * mp::CharCast ( const char * c)
inline

Definition at line 274 of file util.h.

◆ CharCast() [3/4]

const char * mp::CharCast ( const unsigned char * c)
inline

Definition at line 275 of file util.h.

◆ CharCast() [4/4]

char * mp::CharCast ( unsigned char * c)
inline

Definition at line 273 of file util.h.

◆ CleanupRun()

void mp::CleanupRun ( CleanupList & fns)
inline

Definition at line 39 of file proxy.h.

Here is the caller graph for this function:

◆ clientDestroy()

template<typename Client>
void mp::clientDestroy ( Client & client)

Entry point called by all generated ProxyClient destructors. This only logs the object destruction. The actual cleanup happens in the ProxyClient base destructor.

Definition at line 645 of file proxy-types.h.

◆ clientInvoke()

template<typename ProxyClient, typename GetRequest, typename... FieldObjs>
void mp::clientInvoke ( ProxyClient & proxy_client,
const GetRequest & get_request,
FieldObjs &&... fields )

Entry point called by generated client code that looks like:

ProxyClient<ClassName>::M0::Result ProxyClient<ClassName>::methodName(M0::Param<0> arg0, M0::Param<1> arg1) { typename M0::Result result; clientInvoke(*this, &InterfaceName::Client::methodNameRequest, MakeClientParam<...>(M0::Fwd<0>(arg0)), MakeClientParam<...>(M0::Fwd<1>(arg1)), MakeClientParam<...>(result)); return result; }

Ellipses above are where generated Accessor<> type declarations are inserted.

Definition at line 670 of file proxy-types.h.

Here is the call graph for this function:

◆ ConnectStream()

template<typename InitInterface>
std::unique_ptr< ProxyClient< InitInterface > > mp::ConnectStream ( EventLoop & loop,
int fd )

Given stream file descriptor, make a new ProxyClient object to send requests over the stream. Also create a new Connection object embedded in the client that is freed when the client is closed.

Definition at line 800 of file proxy-io.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CustomBuildField() [1/28]

template<typename LocalType, typename Value, typename Output>
void mp::CustomBuildField ( TypeList< const LocalType > ,
Priority< 0 > ,
InvokeContext & invoke_context,
Value && value,
Output && output )

Definition at line 12 of file type-decay.h.

Here is the call graph for this function:

◆ CustomBuildField() [2/28]

template<typename Output, size_t size>
void mp::CustomBuildField ( TypeList< const unsigned char * > ,
Priority< 3 > ,
InvokeContext & invoke_context,
const unsigned char(&) value[size],
Output && output )

Definition at line 12 of file type-char.h.

◆ CustomBuildField() [3/28]

template<typename Impl, typename Output>
void mp::CustomBuildField ( TypeList< Impl & > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Impl & value,
Output && output,
typename decltype(output.get())::Calls * enable = nullptr )

Definition at line 52 of file type-interface.h.

Here is the call graph for this function:

◆ CustomBuildField() [4/28]

template<typename LocalType, typename Value, typename Output>
void mp::CustomBuildField ( TypeList< LocalType & > ,
Priority< 0 > ,
InvokeContext & invoke_context,
Value && value,
Output && output )

Definition at line 22 of file type-decay.h.

Here is the call graph for this function:

◆ CustomBuildField() [5/28]

template<typename LocalType, typename Value, typename Output>
void mp::CustomBuildField ( TypeList< LocalType && > ,
Priority< 0 > ,
InvokeContext & invoke_context,
Value && value,
Output && output )

Definition at line 28 of file type-decay.h.

Here is the call graph for this function:

◆ CustomBuildField() [6/28]

template<typename LocalType, typename Value, typename Output>
void mp::CustomBuildField ( TypeList< LocalType * > ,
Priority< 3 > ,
InvokeContext & invoke_context,
Value && value,
Output && output )

Definition at line 12 of file type-pointer.h.

Here is the call graph for this function:

◆ CustomBuildField() [7/28]

template<typename LocalType, typename Value, typename Output>
void mp::CustomBuildField ( TypeList< LocalType > local_type,
Priority< 1 > ,
InvokeContext & invoke_context,
Value && value,
Output && output,
typename ProxyType< LocalType >::Struct * enable = nullptr )

Definition at line 37 of file type-struct.h.

Here is the call graph for this function:

◆ CustomBuildField() [8/28]

template<typename LocalType, typename Value, typename Output>
void mp::CustomBuildField ( TypeList< LocalType > ,
Priority< 0 > ,
InvokeContext & invoke_context,
Value && value,
Output && output )

Definition at line 284 of file proxy-types.h.

Here is the call graph for this function:

◆ CustomBuildField() [9/28]

template<typename LocalType, typename Output>
void mp::CustomBuildField ( TypeList< LocalType > ,
Priority< 1 > ,
InvokeContext & invoke_context,
::capnp::Void ,
Output && output )

Definition at line 18 of file type-void.h.

◆ CustomBuildField() [10/28]

template<typename LocalType, typename Value, typename Output>
requires Serializable<LocalType, DataStream> && std::is_same_v<LocalType, std::remove_cv_t<std::remove_reference_t<LocalType>>>
void mp::CustomBuildField ( TypeList< LocalType > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Value && value,
Output && output )

Overload multiprocess library's CustomBuildField hook to allow any serializable object to be stored in a capnproto Data field or passed to a capnproto interface. Use Priority<1> so this hook has medium priority, and higher priority hooks could take precedence over this one.

Definition at line 63 of file common-types.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CustomBuildField() [11/28]

template<typename LocalType, typename Value, typename Output>
requires (std::is_same_v<decltype(output.get()), ::capnp::Data::Builder> && IsByteSpan<LocalType>)
void mp::CustomBuildField ( TypeList< LocalType > ,
Priority< 2 > ,
InvokeContext & invoke_context,
Value && value,
Output && output )

Generic ::capnp::Data field builder for any C++ type that can be converted to a span of bytes, like std::vector<char> or std::array<uint8_t>, or custom blob types like uint256 or PKHash with data() and size() methods pointing to bytes.

Definition at line 31 of file type-data.h.

◆ CustomBuildField() [12/28]

template<typename LocalType, typename Value, typename Output>
void mp::CustomBuildField ( TypeList< LocalType > ,
Priority< 2 > ,
InvokeContext & invoke_context,
Value && value,
Output && output,
decltype(CustomBuildMessage(invoke_context, value, std::move(output.get()))) * enable = nullptr )

Overload CustomBuildField to serialize objects that have CustomBuildMessage overloads. Defining a CustomBuildMessage overload is simpler than defining a CustomBuildField overload because it only requires defining a normal function, not a template function, but less flexible.

Definition at line 16 of file type-message.h.

Here is the call graph for this function:

◆ CustomBuildField() [13/28]

template<class Rep, class Period, typename Value, typename Output>
void mp::CustomBuildField ( TypeList< std::chrono::duration< Rep, Period > > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Value && value,
Output && output )

Overload CustomBuildField and CustomReadField to serialize std::chrono parameters and return values as numbers.

Definition at line 16 of file type-chrono.h.

◆ CustomBuildField() [14/28]

template<typename Output>
void mp::CustomBuildField ( TypeList< std::exception > ,
Priority< 1 > ,
InvokeContext & invoke_context,
const std::exception & value,
Output && output )

Definition at line 12 of file type-exception.h.

Here is the call graph for this function:

◆ CustomBuildField() [15/28]

template<typename Value, typename FnR, typename... FnParams, typename Output>
void mp::CustomBuildField ( TypeList< std::function< FnR(FnParams...)> > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Value && value,
Output && output )

Definition at line 24 of file type-function.h.

◆ CustomBuildField() [16/28]

template<typename KeyLocalType, typename ValueLocalType, typename Value, typename Output>
void mp::CustomBuildField ( TypeList< std::map< KeyLocalType, ValueLocalType > > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Value && value,
Output && output )

Definition at line 14 of file type-map.h.

Here is the call graph for this function:

◆ CustomBuildField() [17/28]

template<typename LocalType, typename Value, typename Output>
void mp::CustomBuildField ( TypeList< std::optional< LocalType > > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Value && value,
Output && output )

Definition at line 12 of file type-optional.h.

Here is the call graph for this function:

◆ CustomBuildField() [18/28]

template<typename KeyLocalType, typename ValueLocalType, typename Value, typename Output>
void mp::CustomBuildField ( TypeList< std::pair< KeyLocalType, ValueLocalType > > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Value && value,
Output && output )

Definition at line 13 of file type-pair.h.

Here is the call graph for this function:

◆ CustomBuildField() [19/28]

template<typename LocalType, typename Value, typename Output>
void mp::CustomBuildField ( TypeList< std::set< LocalType > > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Value && value,
Output && output )

Definition at line 13 of file type-set.h.

Here is the call graph for this function:

◆ CustomBuildField() [20/28]

template<typename Impl, typename Value, typename Output>
void mp::CustomBuildField ( TypeList< std::shared_ptr< Impl > > ,
Priority< 2 > ,
InvokeContext & invoke_context,
Value && value,
Output && output,
typename Decay< decltype(output.get())>::Calls * enable = nullptr )

Definition at line 38 of file type-interface.h.

Here is the call graph for this function:

◆ CustomBuildField() [21/28]

template<typename LocalType, typename Value, typename Output>
void mp::CustomBuildField ( TypeList< std::shared_ptr< LocalType > > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Value && value,
Output && output )

Definition at line 20 of file type-pointer.h.

Here is the call graph for this function:

◆ CustomBuildField() [22/28]

template<typename Value, typename Output>
void mp::CustomBuildField ( TypeList< std::string > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Value && value,
Output && output )

Definition at line 12 of file type-string.h.

◆ CustomBuildField() [23/28]

template<typename KeyLocalType, typename ValueLocalType, typename Value, typename Output>
void mp::CustomBuildField ( TypeList< std::tuple< KeyLocalType, ValueLocalType > > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Value && value,
Output && output )

Definition at line 13 of file type-tuple.h.

Here is the call graph for this function:

◆ CustomBuildField() [24/28]

template<typename Impl, typename Value, typename Output>
void mp::CustomBuildField ( TypeList< std::unique_ptr< Impl > > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Value && value,
Output && output,
typename Decay< decltype(output.get())>::Calls * enable = nullptr )

Definition at line 24 of file type-interface.h.

Here is the call graph for this function:

◆ CustomBuildField() [25/28]

template<typename LocalType, typename Value, typename Output>
void mp::CustomBuildField ( TypeList< std::vector< LocalType > > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Value && value,
Output && output )

Definition at line 13 of file type-vector.h.

Here is the call graph for this function:

◆ CustomBuildField() [26/28]

template<typename Value, typename Output>
void mp::CustomBuildField ( TypeList< UniValue > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Value && value,
Output && output )

Overload CustomBuildField and CustomReadField to serialize UniValue parameters and return values as JSON strings.

Definition at line 113 of file common-types.h.

◆ CustomBuildField() [27/28]

template<typename Output>
void mp::CustomBuildField ( TypeList<> ,
Priority< 1 > ,
ClientInvokeContext & invoke_context,
Output && output,
typename std::enable_if< std::is_same< decltype(output.get()), Context::Builder >::value >::type * enable = nullptr )

Definition at line 15 of file type-context.h.

Here is the call graph for this function:

◆ CustomBuildField() [28/28]

template<typename Output>
void mp::CustomBuildField ( TypeList<> ,
Priority< 1 > ,
InvokeContext & invoke_context,
Output && output,
typename std::enable_if< std::is_same< decltype(output.get()), ThreadMap::Client >::value >::type * enable = nullptr )

Definition at line 21 of file type-threadmap.h.

◆ CustomBuildMessage() [1/2]

void mp::CustomBuildMessage ( InvokeContext & invoke_context,
const test::FooMessage & src,
test::messages::FooMessage::Builder && builder )
inline

Definition at line 69 of file foo-types.h.

Here is the caller graph for this function:

◆ CustomBuildMessage() [2/2]

void mp::CustomBuildMessage ( InvokeContext & invoke_context,
const test::FooMutable & src,
test::messages::FooMutable::Builder && builder )
inline

Definition at line 83 of file foo-types.h.

◆ CustomHasField() [1/2]

template<typename... LocalTypes, typename Input>
bool mp::CustomHasField ( TypeList< LocalTypes... > ,
InvokeContext & invoke_context,
const Input & input )

Return whether to read a C++ value from a Cap'n Proto field. Returning false can be useful to interpret certain Cap'n Proto field values as null C++ values when initializing nullable C++ std::optional / std::unique_ptr / std::shared_ptr types.

For example, when reading from a List(Data) field into a std::vector<std::shared_ptr<const CTransaction>> value, it's useful to be able to interpret empty Data values as null pointers. This is useful because the Cap'n Proto C++ API does not currently provide a way to distinguish between null and empty Data values in a List[*], so we need to choose some Data value to represent null if we want to allow passing null pointers. Since no CTransaction is ever serialized as empty Data, it's safe to use empty Data values to represent null pointers.

[*] The Cap'n Proto wire format actually does distinguish between null and empty Data values inside Lists, and the C++ API does allow distinguishing between null and empty Data values in other contexts, just not the List context, so this limitation could be removed in the future.

Design note: CustomHasField() and CustomHasValue() are inverses of each other. CustomHasField() allows leaving Cap'n Proto fields unset when C++ types have certain values, and CustomHasValue() allows leaving C++ values unset when Cap'n Proto fields have certain values. But internally the functions get called in different ways. This is because in C++, unlike in Cap'n Proto not every C++ type is default constructible, and it may be impossible to leave certain C++ values unset. For example if a C++ method requires function parameters, there's no way to call the function without constructing values for each of the parameters. Similarly there's no way to add values to C++ vectors or maps without initializing those values. This is not the case in Cap'n Proto where all values are optional and it's possible to skip initializing parameters and list elements.

Because of this difference, CustomHasValue() works universally and can be used to disable BuildField() calls in every context, while CustomHasField() can only be used to disable ReadField() calls in certain contexts like std::optional and pointer contexts.

Definition at line 207 of file proxy-types.h.

Here is the caller graph for this function:

◆ CustomHasField() [2/2]

template<typename Input>
bool mp::CustomHasField ( TypeList< test::FooData > ,
InvokeContext & invoke_context,
const Input & input )

Definition at line 62 of file foo-types.h.

◆ CustomHasValue()

template<typename... Values>
bool mp::CustomHasValue ( InvokeContext & invoke_context,
const Values &... value )

Return whether to write a C++ value into a Cap'n Proto field. Returning false can be useful to map certain C++ values to unset Cap'n Proto fields.

For example the bitcoin Coin class asserts false when a spent coin is serialized. But some C++ methods return these coins, so there needs to be a way to represent them in Cap'n Proto and a null Data field is a convenient representation.

Definition at line 244 of file proxy-types.h.

Here is the caller graph for this function:

◆ CustomMakeProxyClient()

template<typename Interface, typename Impl>
std::unique_ptr< Impl > mp::CustomMakeProxyClient ( InvokeContext & context,
typename Interface::Client && client )

Definition at line 74 of file type-interface.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CustomMakeProxyServer()

template<typename Interface, typename Impl>
kj::Own< typename Interface::Server > mp::CustomMakeProxyServer ( InvokeContext & context,
std::shared_ptr< Impl > && impl )

Definition at line 18 of file type-interface.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CustomPassField() [1/2]

template<class Accessor>
void mp::CustomPassField ( )
Here is the caller graph for this function:

◆ CustomPassField() [2/2]

template<typename Accessor, typename... LocalTypes, typename ServerContext, typename Fn, typename... Args>
auto mp::CustomPassField ( TypeList< LocalTypes... > ,
ServerContext & server_context,
Fn && fn,
Args &&... args ) -> decltype(CustomPassMessage(server_context, MaybeGet< Accessor >(server_context.call_context.getParams()), MaybeGet< Accessor >(server_context.call_context.getResults()), nullptr))

Overload CustomPassField to serialize objects that have CustomPassMessage overloads. Defining a CustomPassMessage overload is simpler than defining a CustomPassField overload because it only requires defining a normal function, not a template function, but less flexible.

Definition at line 54 of file type-message.h.

Here is the call graph for this function:

◆ CustomPassMessage()

void mp::CustomPassMessage ( InvokeContext & invoke_context,
const test::messages::FooMutable::Reader & reader,
test::messages::FooMutable::Builder builder,
std::function< void(test::FooMutable &)> && fn )
inline

Definition at line 97 of file foo-types.h.

Here is the caller graph for this function:

◆ CustomReadField() [1/26]

template<typename LocalType, typename Input, typename ReadDest>
decltype(auto) mp::CustomReadField ( TypeList< LocalType * > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Input && input,
ReadDest && read_dest )

Definition at line 32 of file type-pointer.h.

Here is the call graph for this function:

◆ CustomReadField() [2/26]

template<typename LocalType, typename Input, typename ReadDest>
decltype(auto) mp::CustomReadField ( TypeList< LocalType > param,
Priority< 1 > ,
InvokeContext & invoke_context,
Input && input,
ReadDest && read_dest,
typename ProxyType< LocalType >::Struct * enable = nullptr )

Definition at line 74 of file type-struct.h.

Here is the call graph for this function:

◆ CustomReadField() [3/26]

template<typename LocalType, typename Input, typename ReadDest>
requires ipc::capnp::Deserializable<LocalType>
decltype(auto) mp::CustomReadField ( TypeList< LocalType > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Input && input,
ReadDest && read_dest )

Overload multiprocess library's CustomReadField hook to allow any object with a deserialize constructor to be read from a capnproto Data field or returned from capnproto interface. Use Priority<1> so this hook has medium priority, and higher priority hooks could take precedence over this one.

Definition at line 100 of file common-types.h.

Here is the call graph for this function:

◆ CustomReadField() [4/26]

template<typename LocalType, typename Input, typename ReadDest>
requires Unserializable<LocalType, DataStream> && (!ipc::capnp::Deserializable<LocalType>)
decltype(auto) mp::CustomReadField ( TypeList< LocalType > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Input && input,
ReadDest && read_dest )

Overload multiprocess library's CustomReadField hook to allow any object with an Unserialize method to be read from a capnproto Data field or returned from capnproto interface. Use Priority<1> so this hook has medium priority, and higher priority hooks could take precedence over this one.

Definition at line 83 of file common-types.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CustomReadField() [5/26]

template<typename LocalType, typename Input, typename ReadDest>
decltype(auto) mp::CustomReadField ( TypeList< LocalType > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Input && input,
ReadDest && read_dest,
typename std::enable_if< std::is_enum< LocalType >::value >::type * enable = nullptr )

Definition at line 48 of file type-number.h.

◆ CustomReadField() [6/26]

template<typename LocalType, typename Input, typename ReadDest>
decltype(auto) mp::CustomReadField ( TypeList< LocalType > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Input && input,
ReadDest && read_dest,
typename std::enable_if< std::is_floating_point< LocalType >::value >::type * enable = 0 )

Definition at line 80 of file type-number.h.

◆ CustomReadField() [7/26]

template<typename LocalType, typename Input, typename ReadDest>
decltype(auto) mp::CustomReadField ( TypeList< LocalType > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Input && input,
ReadDest && read_dest,
typename std::enable_if< std::is_integral< LocalType >::value >::type * enable = nullptr )

Definition at line 65 of file type-number.h.

◆ CustomReadField() [8/26]

template<typename LocalType, typename Input, typename ReadDest>
requires (std::is_same_v<decltype(input.get()), ::capnp::Data::Reader> && IsByteSpan<LocalType>)
decltype(auto) mp::CustomReadField ( TypeList< LocalType > ,
Priority< 2 > ,
InvokeContext & invoke_context,
Input && input,
ReadDest && read_dest )

Definition at line 40 of file type-data.h.

◆ CustomReadField() [9/26]

template<typename LocalType, typename Input, typename ReadDest>
decltype(auto) mp::CustomReadField ( TypeList< LocalType > ,
Priority< 2 > ,
InvokeContext & invoke_context,
Input && input,
ReadDest && read_dest,
decltype(CustomReadMessage(invoke_context, input.get(), std::declval< LocalType & >())) * enable = nullptr )

Overload CustomReadField to serialize objects that have CustomReadMessage overloads. Defining a CustomReadMessage overload is simpler than defining a CustomReadField overload because it only requires defining a normal function, not a template function, but less flexible.

Definition at line 27 of file type-message.h.

Here is the call graph for this function:

◆ CustomReadField() [10/26]

template<class Rep, class Period, typename Input, typename ReadDest>
decltype(auto) mp::CustomReadField ( TypeList< std::chrono::duration< Rep, Period > > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Input && input,
ReadDest && read_dest )

Definition at line 27 of file type-chrono.h.

◆ CustomReadField() [11/26]

template<typename FnR, typename... FnParams, typename Input, typename ReadDest>
decltype(auto) mp::CustomReadField ( TypeList< std::function< FnR(FnParams...)> > types,
Priority< 1 > ,
InvokeContext & invoke_context,
Input && input,
ReadDest && read_dest )

Definition at line 51 of file type-function.h.

Here is the call graph for this function:

◆ CustomReadField() [12/26]

template<typename KeyLocalType, typename ValueLocalType, typename Input, typename ReadDest>
decltype(auto) mp::CustomReadField ( TypeList< std::map< KeyLocalType, ValueLocalType > > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Input && input,
ReadDest && read_dest )

Definition at line 60 of file type-map.h.

Here is the call graph for this function:

◆ CustomReadField() [13/26]

template<typename LocalType, typename Input, typename ReadDest>
decltype(auto) mp::CustomReadField ( TypeList< std::optional< LocalType > > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Input && input,
ReadDest && read_dest )

Definition at line 25 of file type-optional.h.

Here is the call graph for this function:

◆ CustomReadField() [14/26]

template<typename KeyLocalType, typename ValueLocalType, typename Input, typename ReadDest>
decltype(auto) mp::CustomReadField ( TypeList< std::pair< KeyLocalType, ValueLocalType > > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Input && input,
ReadDest && read_dest )

Definition at line 26 of file type-pair.h.

Here is the call graph for this function:

◆ CustomReadField() [15/26]

template<typename LocalType, typename Input, typename ReadDest>
decltype(auto) mp::CustomReadField ( TypeList< std::set< LocalType > > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Input && input,
ReadDest && read_dest )

Definition at line 29 of file type-set.h.

Here is the call graph for this function:

◆ CustomReadField() [16/26]

template<typename LocalType, typename Input, typename ReadDest>
decltype(auto) mp::CustomReadField ( TypeList< std::shared_ptr< const LocalType > > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Input && input,
ReadDest && read_dest )

Definition at line 68 of file type-pointer.h.

Here is the call graph for this function:

◆ CustomReadField() [17/26]

template<typename LocalType, typename Input, typename ReadDest>
decltype(auto) mp::CustomReadField ( TypeList< std::shared_ptr< LocalType > > ,
Priority< 0 > ,
InvokeContext & invoke_context,
Input && input,
ReadDest && read_dest )

Definition at line 46 of file type-pointer.h.

Here is the call graph for this function:

◆ CustomReadField() [18/26]

template<typename LocalType, typename Input, typename ReadDest>
decltype(auto) mp::CustomReadField ( TypeList< std::shared_ptr< LocalType > > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Input && input,
ReadDest && read_dest,
typename Decay< decltype(input.get())>::Calls * enable = nullptr )

Definition at line 96 of file type-interface.h.

Here is the call graph for this function:

◆ CustomReadField() [19/26]

template<typename Input, typename ReadDest>
decltype(auto) mp::CustomReadField ( TypeList< std::string > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Input && input,
ReadDest && read_dest )

Definition at line 23 of file type-string.h.

Here is the call graph for this function:

◆ CustomReadField() [20/26]

template<typename KeyLocalType, typename ValueLocalType, typename Input, typename ReadDest>
decltype(auto) mp::CustomReadField ( TypeList< std::tuple< KeyLocalType, ValueLocalType > > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Input && input,
ReadDest && read_dest )

Definition at line 27 of file type-tuple.h.

Here is the call graph for this function:

◆ CustomReadField() [21/26]

template<typename LocalType, typename Input, typename ReadDest>
decltype(auto) mp::CustomReadField ( TypeList< std::unique_ptr< LocalType > > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Input && input,
ReadDest && read_dest,
typename Decay< decltype(input.get())>::Calls * enable = nullptr )

Definition at line 80 of file type-interface.h.

Here is the call graph for this function:

◆ CustomReadField() [22/26]

template<typename Input, typename ReadDest>
decltype(auto) mp::CustomReadField ( TypeList< std::vector< bool > > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Input && input,
ReadDest && read_dest )

Definition at line 54 of file type-vector.h.

Here is the call graph for this function:

◆ CustomReadField() [23/26]

template<typename LocalType, typename Input, typename ReadDest>
decltype(auto) mp::CustomReadField ( TypeList< std::vector< LocalType > > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Input && input,
ReadDest && read_dest )

Definition at line 33 of file type-vector.h.

Here is the call graph for this function:

◆ CustomReadField() [24/26]

template<typename Input, typename ReadDest>
decltype(auto) mp::CustomReadField ( TypeList< UniValue > ,
Priority< 1 > ,
InvokeContext & invoke_context,
Input && input,
ReadDest && read_dest )

Definition at line 121 of file common-types.h.

◆ CustomReadField() [25/26]

template<size_t size, typename Input, typename ReadDest>
decltype(auto) mp::CustomReadField ( TypeList< unsigned char[size]> ,
Priority< 1 > ,
InvokeContext & invoke_context,
Input && input,
ReadDest && read_dest )

Definition at line 23 of file type-char.h.

◆ CustomReadField() [26/26]

template<typename Input>
decltype(auto) mp::CustomReadField ( TypeList<> ,
Priority< 1 > ,
InvokeContext & invoke_context,
Input && input,
typename std::enable_if< std::is_same< decltype(input.get()), ThreadMap::Client >::value >::type * enable = nullptr )

Definition at line 31 of file type-threadmap.h.

◆ CustomReadMessage() [1/2]

void mp::CustomReadMessage ( InvokeContext & invoke_context,
const test::messages::FooMessage::Reader & reader,
test::FooMessage & dest )
inline

Definition at line 76 of file foo-types.h.

Here is the caller graph for this function:

◆ CustomReadMessage() [2/2]

void mp::CustomReadMessage ( InvokeContext & invoke_context,
const test::messages::FooMutable::Reader & reader,
test::FooMutable & dest )
inline

Definition at line 90 of file foo-types.h.

◆ EmplacePiecewiseSafe()

template<class Map, class Tuple1, class Tuple2>
auto mp::EmplacePiecewiseSafe ( Map & m,
const std::piecewise_construct_t & ,
Tuple1 && t1,
Tuple2 && t2 )

Definition at line 41 of file type-map.h.

Here is the caller graph for this function:

◆ ExecProcess()

void mp::ExecProcess ( const std::vector< std::string > & args)

Call execvp with vector args. Not safe to call in a post-fork child of a multi-threaded process. Currently only used by mpgen at build time.

Definition at line 174 of file util.cpp.

Here is the caller graph for this function:

◆ GuardedRef()

template<class U>
mp::GuardedRef ( Mutex & ,
U &  ) -> GuardedRef< U >

◆ KJ_STRINGIFY()

kj::StringPtr mp::KJ_STRINGIFY ( Log flags)

Definition at line 441 of file proxy.cpp.

◆ ListenConnections()

template<typename InitInterface, typename InitImpl>
void mp::ListenConnections ( EventLoop & loop,
int fd,
InitImpl & init )

Given listening socket file descriptor and an init object, handle incoming connections and requests by calling methods on the Init object.

Definition at line 866 of file proxy-io.h.

Here is the call graph for this function:

◆ LogEscape()

std::string mp::LogEscape ( const kj::StringTree & string,
size_t max_size )

Escape binary string for use in log so it doesn't trigger unicode decode errors in python unit tests.

Definition at line 95 of file util.cpp.

Here is the caller graph for this function:

◆ LongThreadName()

std::string mp::LongThreadName ( const char * exe_name)

Definition at line 436 of file proxy.cpp.

Here is the call graph for this function:

◆ Make()

template<template< typename... > class Class, typename... Types, typename... Args>
Class< Types..., std::remove_reference_t< Args >... > mp::Make ( Args &&... args)

Construct a template class value by deducing template arguments from the types of constructor arguments, so they don't need to be specified manually.

Uses of this can go away with class template deduction in C++17 (https://en.cppreference.com/w/cpp/language/class_template_argument_deduction)

Example: Make<std::pair>(5, true) // Constructs std::pair<int, bool>(5, true);

Definition at line 46 of file util.h.

Here is the caller graph for this function:

◆ MakeClientParam()

template<typename Accessor, typename... Types>
ClientParam< Accessor, Types... > mp::MakeClientParam ( Types &&... values)

Definition at line 487 of file proxy-types.h.

◆ MakeProxyClient()

template<typename Interface, typename Impl>
std::unique_ptr< Impl > mp::MakeProxyClient ( InvokeContext & context,
typename Interface::Client && client )

Definition at line 67 of file type-interface.h.

Here is the caller graph for this function:

◆ MakeProxyServer()

template<typename Interface, typename Impl>
kj::Own< typename Interface::Server > mp::MakeProxyServer ( InvokeContext & context,
std::shared_ptr< Impl > impl )

Definition at line 12 of file type-interface.h.

Here is the caller graph for this function:

◆ MakeServerField()

template<int argc, typename Accessor, typename Parent>
ServerField< argc, Accessor, Parent > mp::MakeServerField ( Parent parent)

Definition at line 626 of file proxy-types.h.

◆ MaybeBuildField() [1/2]

template<typename... Args>
void mp::MaybeBuildField ( std::false_type ,
Args && ... )

Definition at line 313 of file proxy-types.h.

◆ MaybeBuildField() [2/2]

template<typename... Args>
void mp::MaybeBuildField ( std::true_type ,
Args &&... args )

Definition at line 308 of file proxy-types.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MaybeGet() [1/2]

template<typename Accessor>
::capnp::Void mp::MaybeGet ( ...)

Definition at line 582 of file proxy-types.h.

◆ MaybeGet() [2/2]

template<typename Accessor, typename Message>
decltype(auto) mp::MaybeGet ( Message && message,
decltype(Accessor::get(message)) * enable = nullptr )

Helper for CustomPassField below. Call Accessor::get method if it has one, otherwise return capnp::Void.

Definition at line 576 of file proxy-types.h.

Here is the caller graph for this function:

◆ MaybeInit() [1/2]

template<typename Accessor>
::capnp::Void mp::MaybeInit ( ...)

Definition at line 44 of file type-message.h.

◆ MaybeInit() [2/2]

template<typename Accessor, typename Message>
decltype(auto) mp::MaybeInit ( Message && message,
decltype(Accessor::get(message)) * enable = nullptr )

Helper for CustomPassField below. Call Accessor::init method if it has one, otherwise do nothing.

Definition at line 38 of file type-message.h.

Here is the caller graph for this function:

◆ MaybeReadField() [1/2]

template<typename... Args>
void mp::MaybeReadField ( std::false_type ,
Args && ... )

Definition at line 322 of file proxy-types.h.

◆ MaybeReadField() [2/2]

template<typename... Args>
void mp::MaybeReadField ( std::true_type ,
Args &&... args )

Definition at line 317 of file proxy-types.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MaybeSetWant() [1/2]

template<typename LocalTypes, typename... Args>
void mp::MaybeSetWant ( LocalTypes ,
Priority< 0 > ,
const Args & ... )

Definition at line 335 of file proxy-types.h.

◆ MaybeSetWant() [2/2]

template<typename LocalType, typename Value, typename Output>
void mp::MaybeSetWant ( TypeList< LocalType * > ,
Priority< 1 > ,
const Value & value,
Output && output )

Definition at line 327 of file proxy-types.h.

Here is the caller graph for this function:

◆ MP_CAPABILITY()

class mp::MP_CAPABILITY ( "mutex" )

Definition at line 120 of file util.h.

◆ PassField() [1/6]

template<typename Accessor, typename LocalType, typename ServerContext, typename Fn, typename... Args>
void mp::PassField ( Priority< 0 > ,
TypeList< LocalType > ,
ServerContext & server_context,
Fn && fn,
Args &&... args )

Default PassField implementation calling MaybeReadField/MaybeBuildField.

Definition at line 341 of file proxy-types.h.

Here is the call graph for this function:

◆ PassField() [2/6]

template<typename Accessor, typename ServerContext, typename Fn, typename... Args>
void mp::PassField ( Priority< 0 > ,
TypeList<> ,
ServerContext & server_context,
const Fn & fn,
Args &&... args )

Default PassField implementation for count(0) arguments, calling ReadField/BuildField.

Definition at line 365 of file proxy-types.h.

Here is the call graph for this function:

◆ PassField() [3/6]

template<typename Accessor, typename LocalType, typename ServerContext, typename Fn, typename... Args>
auto mp::PassField ( Priority< 1 > ,
TypeList< LocalType & > ,
ServerContext & server_context,
Fn && fn,
Args &&... args ) -> Require< typename decltype(Accessor::get(server_context.call_context.getParams()))::Calls >

PassField override for callable interface reference arguments.

Definition at line 291 of file proxy-types.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PassField() [4/6]

template<typename Accessor, typename LocalType, typename ServerContext, typename Fn, typename... Args>
void mp::PassField ( Priority< 1 > ,
TypeList< LocalType * > ,
ServerContext & server_context,
const Fn & fn,
Args &&... args )

PassField override for C++ pointer arguments.

Definition at line 89 of file type-pointer.h.

Here is the call graph for this function:

◆ PassField() [5/6]

template<typename Accessor, typename ServerContext, typename Fn, typename... Args>
auto mp::PassField ( Priority< 1 > ,
TypeList<> ,
ServerContext & server_context,
const Fn & fn,
Args &&... args ) -> typename std::enable_if< std::is_same< decltype(Accessor::get(server_context.call_context.getParams())), Context::Reader >::value, kj::Promise< typename ServerContext::CallContext > >::type

PassField override for mp.Context arguments. Return asynchronously and call function on other thread found in context.

Definition at line 59 of file type-context.h.

Here is the call graph for this function:

◆ PassField() [6/6]

template<typename Accessor, typename... Args>
auto mp::PassField ( Priority< 2 > ,
Args &&... args ) -> decltype(CustomPassField< Accessor >(std::forward< Args >(args)...))

PassField override calling CustomPassField function, if it exists. Defining a CustomPassField or CustomPassMessage overload is useful for input/output parameters. If an overload is not defined these parameters will just be deserialized on the server side with ReadField into a temporary variable, then the server method will be called passing the temporary variable as a parameter, then the temporary variable will be serialized and sent back to the client with BuildField. But if a PassField or PassMessage overload is defined, the overload is called with a callback to invoke and pass parameters to the server side function, and run arbitrary code before and after invoking the function.

Definition at line 601 of file proxy-types.h.

Here is the call graph for this function:

◆ ReadDestTemp()

template<typename LocalType>
auto mp::ReadDestTemp ( )

Helper function to create a ReadDestEmplace object that constructs a temporary, ReadField can return.

Definition at line 133 of file proxy-types.h.

Here is the caller graph for this function:

◆ ReadField()

template<typename... LocalTypes, typename Input, typename... Args>
decltype(auto) mp::ReadField ( TypeList< LocalTypes... > ,
InvokeContext & invoke_context,
Input && input,
Args &&... args )

Definition at line 213 of file proxy-types.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadOne() [1/2]

template<size_t index, typename LocalType, typename Input, typename Value>
void mp::ReadOne ( TypeList< LocalType > param,
InvokeContext & invoke_context,
Input && input,
Value && value,
typename std::enable_if< index !=ProxyType< LocalType >::fields >::type * enable = nullptr )

Definition at line 48 of file type-struct.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadOne() [2/2]

template<size_t index, typename LocalType, typename Input, typename Value>
void mp::ReadOne ( TypeList< LocalType > param,
InvokeContext & invoke_context,
Input & input,
Value & value,
typename std::enable_if< index==ProxyType< LocalType >::fields >::type * enable = nullptr )

Definition at line 65 of file type-struct.h.

◆ ReplaceVoid()

template<typename Fn, typename Ret>
auto mp::ReplaceVoid ( Fn && fn,
Ret && ret )

Invoke callable fn() that may return void. If it does return void, replace return value with value of ret(). This is useful for avoiding code duplication and branching in generic code that forwards calls to functions.

Definition at line 757 of file proxy-types.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ serverDestroy()

template<typename Server>
void mp::serverDestroy ( Server & server)

Definition at line 655 of file proxy-types.h.

◆ serverInvoke()

template<typename Server, typename CallContext, typename Fn>
kj::Promise< void > mp::serverInvoke ( Server & server,
CallContext & call_context,
Fn fn )

Entry point called by generated server code that looks like:

kj::Promise<void> ProxyServer<InterfaceName>::methodName(CallContext call_context) { return serverInvoke(*this, call_context, MakeServerField<0, ...>(MakeServerField<1, ...>(Make<ServerRet, ...>(ServerCall())))); }

Ellipses above are where generated Accessor<> type declarations are inserted.

Definition at line 777 of file proxy-types.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ServeStream()

template<typename InitInterface, typename InitImpl>
void mp::ServeStream ( EventLoop & loop,
int fd,
InitImpl & init )

Given stream file descriptor and an init object, handle requests on the stream by calling methods on the Init object.

Definition at line 857 of file proxy-io.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetThread()

std::tuple< ConnThread, bool > mp::SetThread ( GuardedRef< ConnThreads > threads,
Connection * connection,
const std::function< Thread::Client()> & make_thread )

Definition at line 321 of file proxy.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SpawnProcess()

int mp::SpawnProcess ( int & pid,
FdToArgsFn && fd_to_args )

Spawn a new process that communicates with the current process over a socket pair. Returns pid through an output argument, and file descriptor for the local side of the socket. The fd_to_args callback is invoked in the parent process before fork(). It must not rely on child pid/state, and must return the command line arguments that should be used to execute the process. Embed the remote file descriptor number in whatever format the child process expects.

Definition at line 119 of file util.cpp.

Here is the caller graph for this function:

◆ ThreadName()

std::string mp::ThreadName ( const char * exe_name)

Format current thread name as "{exe_name}-{$pid}/{thread_name}-{$tid}".

Definition at line 64 of file util.cpp.

Here is the caller graph for this function:

◆ ThrowField() [1/2]

template<typename LocalType, typename Input>
void mp::ThrowField ( TypeList< LocalType > ,
InvokeContext & invoke_context,
Input && input )

Definition at line 219 of file proxy-types.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ThrowField() [2/2]

template<typename Input>
void mp::ThrowField ( TypeList< std::exception > ,
InvokeContext & invoke_context,
Input && input )

Special case for generic std::exception. It's an abstract type so it can't be created directly. Rethrow as std::runtime_error so callers expecting it will still catch it.

Definition at line 230 of file proxy-types.h.

Here is the call graph for this function:

◆ TryFinally()

template<typename Fn, typename After>
decltype(auto) mp::TryFinally ( Fn && fn,
After && after )

Invoke a function and run a follow-up action before returning the original result.

This can be used similarly to KJ_DEFER to run cleanup code, but works better if the cleanup function can throw because it avoids clang bug https://github.com/llvm/llvm-project/issues/12658 which skips calling destructors in that case and can lead to memory leaks. Also, if both functions throw, this lets one exception take precedence instead of terminating due to having two active exceptions.

Definition at line 223 of file util.h.

Here is the caller graph for this function:

◆ TypeName()

template<typename T>
const char * mp::TypeName ( )

Return capnp type name with filename prefix removed.

Definition at line 120 of file util.h.

Here is the caller graph for this function:

◆ Unlock()

template<typename Lock, typename Callback>
void mp::Unlock ( Lock & lock,
Callback && callback )

Definition at line 207 of file util.h.

Here is the caller graph for this function:

◆ WaitProcess()

int mp::WaitProcess ( int pid)

Wait for a process to exit and return its exit code.

Definition at line 186 of file util.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ FIELD_BOXED

int mp::FIELD_BOXED = 16
staticconstexpr

Definition at line 311 of file proxy.h.

◆ FIELD_IN

int mp::FIELD_IN = 1
staticconstexpr

Definition at line 307 of file proxy.h.

◆ FIELD_OPTIONAL

int mp::FIELD_OPTIONAL = 4
staticconstexpr

Definition at line 309 of file proxy.h.

◆ FIELD_OUT

int mp::FIELD_OUT = 2
staticconstexpr

Definition at line 308 of file proxy.h.

◆ FIELD_REQUESTED

int mp::FIELD_REQUESTED = 8
staticconstexpr

Definition at line 310 of file proxy.h.

◆ g_thread_context

ThreadContext mp::g_thread_context
thread_local

Definition at line 41 of file proxy.cpp.

◆ server_reqs

std::atomic< int > mp::server_reqs {0}

Definition at line 434 of file proxy.cpp.