Bitcoin Core  29.1.0
P2P Digital Currency
Functions | Variables
mp Namespace Reference

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

Functions

template<typename LocalType , typename Value , typename Output >
void CustomBuildField (TypeList< LocalType >, Priority< 1 >, InvokeContext &invoke_context, Value &&value, Output &&output) requires Serializable< LocalType
 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...
 
value Serialize (wrapper)
 
 memcpy (result.begin(), stream.data(), stream.size())
 
template<typename LocalType , typename Input , typename ReadDest >
decltype(auto) CustomReadField (TypeList< LocalType >, Priority< 1 >, InvokeContext &invoke_context, Input &&input, ReadDest &&read_dest) requires Unserializable< LocalType
 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 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)
 

Variables

auto wrapper {ipc::capnp::Wrap(stream)}
 
auto result = output.init(stream.size())
 

Detailed Description

Functions to serialize / deserialize common bitcoin types.

Function Documentation

◆ CustomBuildField()

template<typename LocalType , typename Value , typename Output >
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.

◆ CustomBuildMessage()

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:

◆ CustomReadField() [1/2]

template<typename LocalType , typename Input , typename ReadDest >
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.

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.

Use Priority<1> so this hook has medium priority, and higher priority hooks could take precedence over this one. Overload CustomBuildField and CustomReadField to serialize UniValue parameters and return values as JSON strings.

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

Here is the call graph for this function:

◆ CustomReadField() [2/2]

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.

◆ CustomReadMessage()

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:

◆ memcpy()

mp::memcpy ( result.  begin(),
stream.  data(),
stream.  size() 
)

◆ Serialize()

value mp::Serialize ( wrapper  )
Here is the caller graph for this function:

Variable Documentation

◆ result

auto mp::result = output.init(stream.size())

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

◆ wrapper

auto mp::wrapper {ipc::capnp::Wrap(stream)}

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