Bitcoin Core 29.99.0
P2P Digital Currency
Namespaces | Classes | Concepts | Typedefs | Functions | Variables
mp Namespace Reference

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

Namespaces

namespace  test
 

Classes

struct  _Require
 SFINAE helper, see using Require below. More...
 
struct  Accessor
 Accessor type holding flags that determine how to access a message field. More...
 
struct  AsyncCallable
 Wrapper around callback function for compatibility with std::async. More...
 
struct  CapRequestTraits
 
struct  CapRequestTraits<::capnp::Request< _Params, _Results > >
 
struct  ClientException
 
struct  ClientInvokeContext
 
struct  ClientParam
 
class  Connection
 Object holding network & rpc state associated with either an incoming server connection, or an outgoing client connection. More...
 
struct  DestructorCatcher
 Needed for libc++/macOS compatibility. More...
 
class  EventLoop
 Event loop implementation. More...
 
struct  FunctionTraits
 Function traits class used to get method parameter and result types, used in generated ProxyClient and ProxyServer classes produced by gen.cpp to get C++ method type information. More...
 
struct  FunctionTraits< _Result(_Class::*const)(_Params...)>
 Specialization of above extracting result and params types assuming the template argument is a pointer-to-method type, decltype(&ClassName::methodName) More...
 
struct  InvokeContext
 
struct  IterateFields
 
struct  IterateFieldsHelper
 
struct  ListOutput
 
struct  ListOutput<::capnp::List< T, kind > >
 
class  Logger
 
class  LoggingErrorHandler
 Handler for kj::TaskSet failed task events. More...
 
struct  Priority
 Function parameter type for prioritizing overloaded function calls that would otherwise be ambiguous. More...
 
struct  Priority< 0 >
 Specialization of above (base case) 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  ProxyClient
 Mapping from capnp interface type to proxy client implementation (specializations are generated by proxy-codegen.cpp). More...
 
struct  ProxyClient< Thread >
 
class  ProxyClientBase
 Base class for generated ProxyClient classes that implement a C++ interface and forward calls to a capnp interface. More...
 
class  ProxyClientCustom
 Customizable (through template specialization) base class used in generated ProxyClient implementations from proxy-codegen.cpp. More...
 
struct  ProxyClientMethodTraits
 Customizable (through template specialization) traits class used in generated ProxyClient implementations from proxy-codegen.cpp. More...
 
struct  ProxyContext
 Context data associated with proxy client and server classes. More...
 
struct  ProxyMethod
 Mapping from capnp method params type to method traits (specializations are generated by proxy-codegen.cpp). More...
 
struct  ProxyMethodTraits
 Traits class for a proxy method, providing the same Params/Result/Param/Fields described in the FunctionTraits class above, plus an additional invoke() method that calls the C++ method which is being proxied, forwarding any arguments. More...
 
struct  ProxyMethodTraits< MethodParams, Require< decltype(ProxyMethod< MethodParams >::impl)> >
 Specialization of above for proxy methods that have a ProxyMethod<InterfaceName::MethodNameParams>::impl pointer-to-method constant defined by generated code. More...
 
struct  ProxyServer
 Mapping from capnp interface type to proxy server implementation (specializations are generated by proxy-codegen.cpp). More...
 
struct  ProxyServer< Thread >
 
struct  ProxyServer< ThreadMap >
 
struct  ProxyServerBase
 Base class for generated ProxyServer classes that implement capnp server methods and forward calls to a wrapped c++ implementation class. More...
 
struct  ProxyServerCustom
 Customizable (through template specialization) base class which ProxyServer classes produced by generated code will inherit from. More...
 
struct  ProxyServerMethodTraits
 Customizable (through template specialization) traits class used in generated ProxyServer implementations from 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...
 
struct  ProxyTypeRegister
 Map to convert client interface pointers to ProxyContext struct references at runtime using typeids. More...
 
struct  ReadDestEmplace
 
struct  ReadDestUpdate
 Destination parameter type that can be passed to ReadField function as an alternative to ReadDestEmplace. More...
 
struct  ServerCall
 
struct  ServerDestroy
 
struct  ServerExcept
 
struct  ServerField
 
struct  ServerInvokeContext
 
struct  ServerRet
 
struct  ServerVatId
 Vat id for server side of connection. More...
 
struct  Split
 Type helper splitting a TypeList into two halves at position index. More...
 
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  StructField
 
struct  ThreadContext
 
struct  TypeList
 Generic utility functions used by capnp code. More...
 
struct  UnlockGuard
 Analog to std::lock_guard that unlocks instead of locks. More...
 
class  ValueField
 
struct  Waiter
 Single element task queue used to handle recursive capnp calls. 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(bool raise, std::string message)>
 
using ConnThreads = std::map< Connection *, 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. More...
 
template<typename T >
using RemoveCvRef = std::remove_cv_t< std::remove_reference_t< T > >
 Substitutue for std::remove_cvref_t. More...
 
template<typename T >
using Decay = std::decay_t< T >
 Type helper abbreviating std::decay. More...
 
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. More...
 
using FdToArgsFn = std::function< std::vector< std::string >(int fd)>
 Callback type used by SpawnProcess below. 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)
 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. More...
 
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)
 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. More...
 
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)
 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. More...
 
template<typename Value , typename Output >
void 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. More...
 
template<typename Input , typename ReadDest >
decltype(auto) CustomReadField (TypeList< UniValue >, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest)
 
void CustomBuildMessage (InvokeContext &invoke_context, const BlockValidationState &src, ipc::capnp::messages::BlockValidationState::Builder &&builder)
 
void CustomReadMessage (InvokeContext &invoke_context, const ipc::capnp::messages::BlockValidationState::Reader &reader, BlockValidationState &dest)
 
std::string LongThreadName (const char *exe_name)
 
std::tuple< ConnThread, bool > SetThread (ConnThreads &threads, std::mutex &mutex, Connection *connection, const std::function< Thread::Client()> &make_thread)
 
template<typename InitInterface >
std::unique_ptr< ProxyClient< InitInterface > > ConnectStream (EventLoop &loop, int fd)
 Given stream file descriptor, make a new ProxyClient object to send requests over the stream. More...
 
template<typename InitInterface , typename InitImpl >
void _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. More...
 
template<typename InitInterface , typename InitImpl >
void _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. More...
 
template<typename InitInterface , typename InitImpl >
void 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. More...
 
template<typename InitInterface , typename InitImpl >
void 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. More...
 
template<typename LocalType >
auto ReadDestTemp ()
 Helper function to create a ReadDestEmplace object that constructs a temporary, ReadField can return. More...
 
template<typename... LocalTypes, typename... Args>
decltype(auto) ReadField (TypeList< LocalTypes... >, 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)
 Special case for generic std::exception. More...
 
template<typename... Values>
bool CustomHasValue (InvokeContext &invoke_context, 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. More...
 
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 >, Value &&value, Output &&output)
 
template<typename LocalTypes , typename... Args>
void MaybeSetWant (LocalTypes, Priority< 0 >, 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. More...
 
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. More...
 
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)
 Helper for CustomPassField below. More...
 
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)...))
 PassField override calling CustomPassField function, if it exists. More...
 
template<int argc, typename Accessor , typename Parent >
ServerField< argc, Accessor, Parent > MakeServerField (Parent parent)
 
template<typename Client >
void clientDestroy (Client &client)
 Entry point called by all generated ProxyClient destructors. More...
 
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)
 Entry point called by generated client code that looks like: More...
 
template<typename Fn , typename Ret >
auto ReplaceVoid (Fn &&fn, Ret &&ret) -> std::enable_if_t< std::is_same_v< void, decltype(fn())>, decltype(ret())>
 Invoke callable fn() that may return void. More...
 
template<typename Server , typename CallContext , typename Fn >
kj::Promise< void > serverInvoke (Server &server, CallContext &call_context, Fn fn)
 Entry point called by generated server code that looks like: More...
 
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)
 Overload CustomBuildField and CustomReadField to serialize std::chrono parameters and return values as numbers. More...
 
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
 PassField override for mp.Context arguments. More...
 
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)
 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. More...
 
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< 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...)> >, 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<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)
 Overload CustomBuildField to serialize objects that have CustomBuildMessage overloads. More...
 
template<typename LocalType , typename Reader , typename ReadDest >
decltype(auto) CustomReadField (TypeList< LocalType >, Priority< 2 >, InvokeContext &invoke_context, Reader &&reader, ReadDest &&read_dest, decltype(CustomReadMessage(invoke_context, reader.get(), std::declval< LocalType & >())) *enable=nullptr)
 Overload CustomReadField to serialize objects that have CustomReadMessage overloads. More...
 
template<typename Accessor , typename Message >
decltype(auto) MaybeInit (Message &&message, decltype(Accessor::get(message)) *enable=nullptr)
 Helper for CustomPassField below. More...
 
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))
 Overload CustomPassField to serialize objects that have CustomPassMessage overloads. More...
 
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=0)
 
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. More...
 
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)
 Construct a template class value by deducing template arguments from the types of constructor arguments, so they don't need to be specified manually. More...
 
template<typename T >
const char * TypeName ()
 Return capnp type name with filename prefix removed. More...
 
template<typename Lock , typename Callback >
void Unlock (Lock &lock, Callback &&callback)
 
template<typename Callable >
AsyncCallable< std::remove_reference_t< Callable > > MakeAsyncCallable (Callable &&callable)
 Construct AsyncCallable object. More...
 
std::string ThreadName (const char *exe_name)
 Format current thread name as "{exe_name}-{$pid}/{thread_name}-{$tid}". More...
 
std::string LogEscape (const kj::StringTree &string)
 Escape binary string for use in log so it doesn't trigger unicode decode errors in python unit tests. More...
 
int SpawnProcess (int &pid, FdToArgsFn &&fd_to_args)
 Spawn a new process that communicates with the current process over a socket pair. More...
 
void ExecProcess (const std::vector< std::string > &args)
 Call execvp with vector args. More...
 
int WaitProcess (int pid)
 Wait for a process to exit and return its exit code. More...
 
char * CharCast (char *c)
 
char * CharCast (unsigned char *c)
 
const char * CharCast (const char *c)
 
const char * CharCast (const unsigned char *c)
 
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

thread_local 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 = typedef typename CleanupList::iterator

Definition at line 40 of file proxy.h.

◆ CleanupList

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

Definition at line 39 of file proxy.h.

◆ ConnThread

using mp::ConnThread = typedef ConnThreads::iterator

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

◆ ConnThreads

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

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

◆ Decay

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

Type helper abbreviating std::decay.

Definition at line 86 of file util.h.

◆ FdToArgsFn

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

Callback type used by SpawnProcess below.

Definition at line 197 of file util.h.

◆ LogFn

using mp::LogFn = typedef std::function<void(bool raise, std::string message)>

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

◆ RemoveCvRef

template<typename T >
using mp::RemoveCvRef = typedef 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 = typedef 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 = typedef 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 = typedef ServerInvokeContext<ProxyServer<Interface>, ::capnp::CallContext<Params, Results> >

Definition at line 56 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 606 of file proxy-io.h.

◆ _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 587 of file proxy-io.h.

Here is the call 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 175 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:

◆ 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]

static 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 213 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 215 of file util.h.

◆ CharCast() [3/4]

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

Definition at line 216 of file util.h.

◆ CharCast() [4/4]

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

Definition at line 214 of file util.h.

◆ CleanupRun()

void mp::CleanupRun ( CleanupList fns)
inline

Definition at line 42 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 558 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<...>(arg0), MakeClientParam<...>(arg1), MakeClientParam<...>(result)); return result; }

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

Definition at line 583 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 563 of file proxy-io.h.

Here is the call graph for this function:

◆ CustomBuildField() [1/27]

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() [2/27]

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.

◆ CustomBuildField() [3/27]

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() [4/27]

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() [5/27]

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() [6/27]

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.

◆ CustomBuildField() [7/27]

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

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

Here is the call graph for this function:

◆ CustomBuildField() [8/27]

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() [9/27]

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() [10/27]

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 28 of file type-data.h.

◆ CustomBuildField() [11/27]

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() [12/27]

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() [13/27]

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() [14/27]

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() [15/27]

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() [16/27]

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() [17/27]

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() [18/27]

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() [19/27]

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.

◆ CustomBuildField() [20/27]

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() [21/27]

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() [22/27]

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() [23/27]

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.

◆ CustomBuildField() [24/27]

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() [25/27]

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() [26/27]

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 13 of file type-context.h.

Here is the call graph for this function:

◆ CustomBuildField() [27/27]

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/3]

void mp::CustomBuildMessage ( InvokeContext invoke_context,
const BlockValidationState src,
ipc::capnp::messages::BlockValidationState::Builder &&  builder 
)

Definition at line 11 of file mining.cpp.

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

◆ CustomBuildMessage() [2/3]

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

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

◆ CustomBuildMessage() [3/3]

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

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

◆ CustomHasValue()

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

Definition at line 169 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.

◆ 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.

◆ CustomPassField() [1/2]

template<class Accessor >
void mp::CustomPassField ( )

◆ 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 71 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.

◆ CustomReadField() [3/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() [4/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() [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 = 0 
)

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 74 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 59 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 37 of file type-data.h.

◆ CustomReadField() [9/26]

template<typename LocalType , typename Reader , typename ReadDest >
decltype(auto) mp::CustomReadField ( TypeList< LocalType >  ,
Priority< 2 >  ,
InvokeContext invoke_context,
Reader &&  reader,
ReadDest &&  read_dest,
decltype(CustomReadMessage(invoke_context, reader.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...)> >  ,
Priority< 1 >  ,
InvokeContext invoke_context,
Input &&  input,
ReadDest &&  read_dest 
)

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

◆ 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 31 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 26 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.

◆ 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.

◆ 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/3]

void mp::CustomReadMessage ( InvokeContext invoke_context,
const ipc::capnp::messages::BlockValidationState::Reader &  reader,
BlockValidationState dest 
)

Definition at line 29 of file mining.cpp.

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

◆ CustomReadMessage() [2/3]

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

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

◆ CustomReadMessage() [3/3]

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

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

◆ ExecProcess()

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

Call execvp with vector args.

Definition at line 131 of file util.cpp.

Here is the caller graph for this function:

◆ 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 628 of file proxy-io.h.

Here is the call graph for this function:

◆ LogEscape()

std::string mp::LogEscape ( const kj::StringTree &  string)

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

Definition at line 78 of file util.cpp.

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

◆ LongThreadName()

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

Definition at line 394 of file proxy.cpp.

Here is the call graph for this function:
Here is the caller 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:

◆ MakeAsyncCallable()

template<typename Callable >
AsyncCallable< std::remove_reference_t< Callable > > mp::MakeAsyncCallable ( Callable &&  callable)

Construct AsyncCallable object.

Definition at line 184 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 427 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.

◆ 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.

◆ MakeServerField()

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

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

◆ MaybeBuildField() [1/2]

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

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

◆ MaybeBuildField() [2/2]

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

Definition at line 233 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 495 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 489 of file proxy-types.h.

◆ 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.

◆ MaybeReadField() [1/2]

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

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

◆ MaybeReadField() [2/2]

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

Definition at line 242 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 >  ,
Args &&  ... 
)

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

◆ MaybeSetWant() [2/2]

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

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

Here is the caller graph for this function:

◆ 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 266 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 290 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 216 of file proxy-types.h.

◆ 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 57 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 514 of file proxy-types.h.

◆ ReadDestTemp()

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

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

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

◆ ReadField()

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

Definition at line 145 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:

◆ 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 
) -> std::enable_if_t<std::is_same_v<void, decltype(fn())>, decltype(ret())>

Invoke callable fn() that may return void.

Overload of above for non-void fn() case.

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 653 of file proxy-types.h.

Here is the caller graph for this function:

◆ serverDestroy()

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

Definition at line 568 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 678 of file proxy-types.h.

Here is the call 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 619 of file proxy-io.h.

◆ SetThread()

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

Definition at line 288 of file proxy.cpp.

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. Invokes fd_to_args callback with the remote file descriptor number which returns the command line arguments that should be used to execute the process, and which should have the remote file descriptor embedded in whatever format the child process expects.

Definition at line 103 of file util.cpp.

Here is the call graph for this function:
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 47 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 151 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 162 of file proxy-types.h.

Here is the call 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.

◆ Unlock()

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

Definition at line 143 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 145 of file util.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ FIELD_BOXED

constexpr int mp::FIELD_BOXED = 16
staticconstexpr

Definition at line 272 of file proxy.h.

◆ FIELD_IN

constexpr int mp::FIELD_IN = 1
staticconstexpr

Definition at line 268 of file proxy.h.

◆ FIELD_OPTIONAL

constexpr int mp::FIELD_OPTIONAL = 4
staticconstexpr

Definition at line 270 of file proxy.h.

◆ FIELD_OUT

constexpr int mp::FIELD_OUT = 2
staticconstexpr

Definition at line 269 of file proxy.h.

◆ FIELD_REQUESTED

constexpr int mp::FIELD_REQUESTED = 8
staticconstexpr

Definition at line 271 of file proxy.h.

◆ g_thread_context

thread_local ThreadContext mp::g_thread_context

Definition at line 43 of file proxy.cpp.

◆ server_reqs

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

Definition at line 392 of file proxy.cpp.