![]() |
Bitcoin Core 29.99.0
P2P Digital Currency
|
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 |
Functions to serialize / deserialize common bitcoin types.
using mp::CleanupIt = typedef typename CleanupList::iterator |
using mp::CleanupList = typedef std::list<std::function<void()> > |
using mp::ConnThread = typedef ConnThreads::iterator |
Definition at line 521 of file proxy-io.h.
using mp::ConnThreads = typedef std::map<Connection*, ProxyClient<Thread> > |
Definition at line 520 of file proxy-io.h.
using mp::Decay = typedef std::decay_t<T> |
using mp::FdToArgsFn = typedef std::function<std::vector<std::string>(int fd)> |
using mp::LogFn = typedef std::function<void(bool raise, std::string message)> |
Definition at line 98 of file proxy-io.h.
using mp::RemoveCvRef = typedef std::remove_cv_t<std::remove_reference_t<T> > |
using mp::Require = typedef typename _Require<SfinaeExpr, Result>::Result |
using mp::ResultOf = typedef decltype(std::declval<Callable>()()) |
using mp::ServerContext = typedef ServerInvokeContext<ProxyServer<Interface>, ::capnp::CallContext<Params, Results> > |
Definition at line 56 of file proxy-io.h.
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.
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.
void mp::BuildField | ( | TypeList< LocalTypes... > | , |
Context & | context, | ||
Output && | output, | ||
Values &&... | values | ||
) |
Definition at line 175 of file proxy-types.h.
void mp::BuildOne | ( | TypeList< LocalType > | param, |
InvokeContext & | invoke_context, | ||
Output && | output, | ||
Value && | value | ||
) |
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.
LocalType mp::BuildPrimitive | ( | InvokeContext & | invoke_context, |
const Value & | value, | ||
TypeList< LocalType > | , | ||
typename std::enable_if< std::is_enum< Value >::value >::type * | enable = nullptr |
||
) |
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.
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.
|
inlinestatic |
Definition at line 27 of file type-vector.h.
::capnp::Void mp::BuildPrimitive | ( | InvokeContext & | invoke_context, |
Value && | , | ||
TypeList<::capnp::Void > | |||
) |
Definition at line 12 of file type-void.h.
|
inline |
|
inline |
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.
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.
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.
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.
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.
void mp::CustomBuildField | ( | TypeList< LocalType & > | , |
Priority< 0 > | , | ||
InvokeContext & | invoke_context, | ||
Value && | value, | ||
Output && | output | ||
) |
void mp::CustomBuildField | ( | TypeList< LocalType && > | , |
Priority< 0 > | , | ||
InvokeContext & | invoke_context, | ||
Value && | value, | ||
Output && | output | ||
) |
void mp::CustomBuildField | ( | TypeList< LocalType * > | , |
Priority< 3 > | , | ||
InvokeContext & | invoke_context, | ||
Value && | value, | ||
Output && | 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.
void mp::CustomBuildField | ( | TypeList< LocalType > | , |
Priority< 0 > | , | ||
InvokeContext & | invoke_context, | ||
Value && | value, | ||
Output && | output | ||
) |
void mp::CustomBuildField | ( | TypeList< LocalType > | , |
Priority< 1 > | , | ||
InvokeContext & | invoke_context, | ||
::capnp::Void | , | ||
Output && | output | ||
) |
Definition at line 18 of file type-void.h.
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.
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.
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.
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.
void mp::CustomBuildField | ( | TypeList< std::exception > | , |
Priority< 1 > | , | ||
InvokeContext & | invoke_context, | ||
const std::exception & | value, | ||
Output && | 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.
void mp::CustomBuildField | ( | TypeList< std::map< KeyLocalType, ValueLocalType > > | , |
Priority< 1 > | , | ||
InvokeContext & | invoke_context, | ||
Value && | value, | ||
Output && | output | ||
) |
void mp::CustomBuildField | ( | TypeList< std::optional< LocalType > > | , |
Priority< 1 > | , | ||
InvokeContext & | invoke_context, | ||
Value && | value, | ||
Output && | output | ||
) |
void mp::CustomBuildField | ( | TypeList< std::pair< KeyLocalType, ValueLocalType > > | , |
Priority< 1 > | , | ||
InvokeContext & | invoke_context, | ||
Value && | value, | ||
Output && | output | ||
) |
void mp::CustomBuildField | ( | TypeList< std::set< LocalType > > | , |
Priority< 1 > | , | ||
InvokeContext & | invoke_context, | ||
Value && | value, | ||
Output && | 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.
void mp::CustomBuildField | ( | TypeList< std::shared_ptr< LocalType > > | , |
Priority< 1 > | , | ||
InvokeContext & | invoke_context, | ||
Value && | value, | ||
Output && | 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.
void mp::CustomBuildField | ( | TypeList< std::tuple< KeyLocalType, ValueLocalType > > | , |
Priority< 1 > | , | ||
InvokeContext & | invoke_context, | ||
Value && | value, | ||
Output && | 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.
void mp::CustomBuildField | ( | TypeList< std::vector< LocalType > > | , |
Priority< 1 > | , | ||
InvokeContext & | invoke_context, | ||
Value && | value, | ||
Output && | 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.
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 |
||
) |
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.
void mp::CustomBuildMessage | ( | InvokeContext & | invoke_context, |
const BlockValidationState & | src, | ||
ipc::capnp::messages::BlockValidationState::Builder && | builder | ||
) |
Definition at line 11 of file mining.cpp.
|
inline |
Definition at line 43 of file foo-types.h.
|
inline |
Definition at line 57 of file foo-types.h.
bool mp::CustomHasValue | ( | InvokeContext & | invoke_context, |
Values &&... | value | ||
) |
std::unique_ptr< Impl > mp::CustomMakeProxyClient | ( | InvokeContext & | context, |
typename Interface::Client && | client | ||
) |
Definition at line 74 of file type-interface.h.
kj::Own< typename Interface::Server > mp::CustomMakeProxyServer | ( | InvokeContext & | context, |
std::shared_ptr< Impl > && | impl | ||
) |
Definition at line 18 of file type-interface.h.
void mp::CustomPassField | ( | ) |
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.
|
inline |
decltype(auto) mp::CustomReadField | ( | TypeList< LocalType * > | , |
Priority< 1 > | , | ||
InvokeContext & | invoke_context, | ||
Input && | input, | ||
ReadDest && | read_dest | ||
) |
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
decltype(auto) mp::CustomReadField | ( | TypeList< std::map< KeyLocalType, ValueLocalType > > | , |
Priority< 1 > | , | ||
InvokeContext & | invoke_context, | ||
Input && | input, | ||
ReadDest && | read_dest | ||
) |
decltype(auto) mp::CustomReadField | ( | TypeList< std::optional< LocalType > > | , |
Priority< 1 > | , | ||
InvokeContext & | invoke_context, | ||
Input && | input, | ||
ReadDest && | read_dest | ||
) |
decltype(auto) mp::CustomReadField | ( | TypeList< std::pair< KeyLocalType, ValueLocalType > > | , |
Priority< 1 > | , | ||
InvokeContext & | invoke_context, | ||
Input && | input, | ||
ReadDest && | read_dest | ||
) |
decltype(auto) mp::CustomReadField | ( | TypeList< std::set< LocalType > > | , |
Priority< 1 > | , | ||
InvokeContext & | invoke_context, | ||
Input && | input, | ||
ReadDest && | read_dest | ||
) |
decltype(auto) mp::CustomReadField | ( | TypeList< std::shared_ptr< const LocalType > > | , |
Priority< 1 > | , | ||
InvokeContext & | invoke_context, | ||
Input && | input, | ||
ReadDest && | read_dest | ||
) |
decltype(auto) mp::CustomReadField | ( | TypeList< std::shared_ptr< LocalType > > | , |
Priority< 0 > | , | ||
InvokeContext & | invoke_context, | ||
Input && | input, | ||
ReadDest && | read_dest | ||
) |
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.
decltype(auto) mp::CustomReadField | ( | TypeList< std::string > | , |
Priority< 1 > | , | ||
InvokeContext & | invoke_context, | ||
Input && | input, | ||
ReadDest && | read_dest | ||
) |
decltype(auto) mp::CustomReadField | ( | TypeList< std::tuple< KeyLocalType, ValueLocalType > > | , |
Priority< 1 > | , | ||
InvokeContext & | invoke_context, | ||
Input && | input, | ||
ReadDest && | read_dest | ||
) |
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.
decltype(auto) mp::CustomReadField | ( | TypeList< std::vector< bool > > | , |
Priority< 1 > | , | ||
InvokeContext & | invoke_context, | ||
Input && | input, | ||
ReadDest && | read_dest | ||
) |
decltype(auto) mp::CustomReadField | ( | TypeList< std::vector< LocalType > > | , |
Priority< 1 > | , | ||
InvokeContext & | invoke_context, | ||
Input && | input, | ||
ReadDest && | read_dest | ||
) |
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.
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.
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.
void mp::CustomReadMessage | ( | InvokeContext & | invoke_context, |
const ipc::capnp::messages::BlockValidationState::Reader & | reader, | ||
BlockValidationState & | dest | ||
) |
Definition at line 29 of file mining.cpp.
|
inline |
Definition at line 50 of file foo-types.h.
|
inline |
Definition at line 64 of file foo-types.h.
void mp::ExecProcess | ( | const std::vector< std::string > & | args | ) |
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.
std::string mp::LogEscape | ( | const kj::StringTree & | string | ) |
std::string mp::LongThreadName | ( | const char * | exe_name | ) |
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.
AsyncCallable< std::remove_reference_t< Callable > > mp::MakeAsyncCallable | ( | Callable && | callable | ) |
Construct AsyncCallable object.
Definition at line 184 of file util.h.
ClientParam< Accessor, Types... > mp::MakeClientParam | ( | Types &&... | values | ) |
Definition at line 427 of file proxy-types.h.
std::unique_ptr< Impl > mp::MakeProxyClient | ( | InvokeContext & | context, |
typename Interface::Client && | client | ||
) |
Definition at line 67 of file type-interface.h.
kj::Own< typename Interface::Server > mp::MakeProxyServer | ( | InvokeContext & | context, |
std::shared_ptr< Impl > | impl | ||
) |
Definition at line 12 of file type-interface.h.
ServerField< argc, Accessor, Parent > mp::MakeServerField | ( | Parent | parent | ) |
Definition at line 539 of file proxy-types.h.
void mp::MaybeBuildField | ( | std::false_type | , |
Args && | ... | ||
) |
Definition at line 238 of file proxy-types.h.
void mp::MaybeBuildField | ( | std::true_type | , |
Args &&... | args | ||
) |
Definition at line 233 of file proxy-types.h.
::capnp::Void mp::MaybeGet | ( | ... | ) |
Definition at line 495 of file proxy-types.h.
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.
::capnp::Void mp::MaybeInit | ( | ... | ) |
Definition at line 44 of file type-message.h.
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.
void mp::MaybeReadField | ( | std::false_type | , |
Args && | ... | ||
) |
Definition at line 247 of file proxy-types.h.
void mp::MaybeReadField | ( | std::true_type | , |
Args &&... | args | ||
) |
Definition at line 242 of file proxy-types.h.
void mp::MaybeSetWant | ( | LocalTypes | , |
Priority< 0 > | , | ||
Args && | ... | ||
) |
Definition at line 260 of file proxy-types.h.
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.
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.
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.
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.
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.
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.
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.
decltype(auto) mp::ReadField | ( | TypeList< LocalTypes... > | , |
Args &&... | args | ||
) |
Definition at line 145 of file proxy-types.h.
void mp::ReadOne | ( | TypeList< LocalType > | param, |
InvokeContext & | invoke_context, | ||
Input && | input, | ||
Value && | value, | ||
typename std::enable_if< index !=ProxyType< LocalType >::fields >::type * | enable = nullptr |
||
) |
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.
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.
void mp::serverDestroy | ( | Server & | server | ) |
Definition at line 568 of file proxy-types.h.
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.
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.
std::tuple< ConnThread, bool > mp::SetThread | ( | ConnThreads & | threads, |
std::mutex & | mutex, | ||
Connection * | connection, | ||
const std::function< Thread::Client()> & | make_thread | ||
) |
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.
std::string mp::ThreadName | ( | const char * | exe_name | ) |
void mp::ThrowField | ( | TypeList< LocalType > | , |
InvokeContext & | invoke_context, | ||
Input && | input | ||
) |
Definition at line 151 of file proxy-types.h.
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.
const char * mp::TypeName | ( | ) |
void mp::Unlock | ( | Lock & | lock, |
Callback && | callback | ||
) |
int mp::WaitProcess | ( | int | pid | ) |
thread_local ThreadContext mp::g_thread_context |