C++ API
404 declarations · 404 documented
(global)
-
operator<<operatorPrints an object reference's fields, one per line.
nprpc
-
as_awaitablefunctionWraps a
Taskso it can be awaited inside a Boost.Asio coroutine: -
BidiStreamstructBoth directions of a
bidi_streammethod: read what the other side sends, write what you send. Move-only. -
DispatchExecutorstructOptional dispatch executor for servant callbacks / SHM offload.
-
EndPointclassA transport plus an address: host and port, or a shared-memory channel id. One entry of
ObjectId::urls(), parsed. -
ExceptionclassBase of every exception NPRPC raises, including those declared in IDL.
-
flat_bufferclassA flat buffer that can operate in two modes: 1. Owned mode: manages its own heap-allocated memory (like boost::beast::flat_buffer) 2. View mode: references external memory (e.g., shared memory ring buffer)
-
get_contextfunctionThe session of the call being dispatched on this thread. Only valid inside a servant method; throws
Exceptionelsewhere. -
get_io_contextfunctionReturns the io_context for the current RPC instance. Safe to call from any thread, including servant dispatch handlers. Use with
nprpc::spawn_task()to schedule async work after dispatch returns. -
invalid_object_idvariableObject id that names no object, e.g. a failed nameserver lookup.
-
IterableCollectionconceptA sized forward range; generated helpers accept any container that satisfies it.
-
kEmptyStreamFinalSequencevariableStreamComplete.final_sequenceof a stream that sent no chunks. -
make_wrapper1functionUniform
->access to a value or a pointer to one; used by generated code to accept both containers of values and containers of pointers. -
mem_prefixvariableURL scheme of shared-memory endpoints (same machine only).
-
narrowfunctionConverts a generic
Objectto the proxy typeTof its interface. -
ObjectclassClient-side proxy for a remote object. npidl generates a subclass per interface with a method for each call.
-
ObjectIdclassA reference to an object: its id, where it lives, and the URLs it can be reached at.
Objectadds a connection to it. -
ObjectPtrclassOwning handle to a proxy (
Objector a generated subclass), like ashared_ptrwhose count lives in the object: copies calladd_ref(), destruction andreset()callrelease(). -
ObjectServantclassBase of every server-side object. npidl generates
I<Interface>_Servantfrom it; implement the interface's methods in a subclass and activate an instance withPoa::activate_object. -
OperationCancelledclassThrown when an async RPC call is cancelled via std::stop_token.
-
operator<<operatorPrints the endpoint as a URL.
-
PageHandlertypealiasRenders a page in-process, on the HTTP server's own thread.
-
PageRequeststructAn HTTP request offered to the application for server-side rendering.
-
PageResponsestructThe application's answer for a PageRequest.
-
PoaclassPortable Object Adapter: holds servants and routes incoming calls to them. Create one with
Rpc::create_poa(); see the POA guide for the threading options. -
PoaBuilderclassConfigures a POA; get one from
Rpc::create_poa()and finish withbuild(). -
quic_prefixvariableURL scheme of native QUIC endpoints.
-
read_size_helperfunctionHow much Boost.Beast should read into
bufat once: at least 64 KiB, capped bymax_size. -
ReferenceListclassThe servants a session holds references to. Released together when the session ends, so a client that disconnects without releasing its references does not keep transient objects alive.
-
reload_certificatesfunctionRe-read the configured TLS certificate and key files
-
RpcclassThe runtime: listeners, sessions and POAs. Create it with
RpcBuilder. -
RpcBuilderclassEntry point for configuring and starting the runtime; see
RpcBuilderBasefor the settings and an example. -
RpcBuilderBaseclassSettings shared by every transport. Start from
RpcBuilder, callwith_tcp(),with_http()orwith_quic()for transport-specific ones, and finish withbuild(). -
RpcBuilderHttpclassHTTP, WebSocket, HTTP/3 and WebTransport settings; see
RpcBuilderBase::with_http. -
RpcBuilderQuicclassNative QUIC settings; see
RpcBuilderBase::with_quic. -
RpcBuilderTcpclassTCP settings; see
RpcBuilderBase::with_tcp. -
SessionContextstructOne client connection as seen by a servant: who is calling, and the state that lives as long as the connection. Get the current one with
get_context()inside a servant method. -
spawn_taskfunctionRuns
factory(), which returnsboost::asio::awaitable<void>, oniocwithout waiting for it: -
stream_final_sequence_for_sent_chunksfunctionStreamComplete.final_sequenceaftersent_chunk_countchunks. -
StreamReaderclassThe receiving end of a stream of
T: what a proxy'sserver_streammethod returns, and what a servant'sclient_streammethod receives. -
StreamReaderBaseclassType-erased
StreamReader, as the runtime stores it. -
StreamWriterclassThe sending end of a stream of
T. It works in two ways: -
StreamWriterBaseclassType-erased
StreamWriter, as the runtime stores it. -
TaskclassA coroutine result:
Task<T> f() { co_return value; }. -
tcp_prefixvariableURL scheme of native TCP endpoints.
-
web_prefixvariableURL scheme shared by HTTP, WebSocket and WebTransport endpoints.
nprpc::PoaPolicy
-
LifespanenumHow long a POA's objects live.
-
ObjectIdPolicyenumWho picks object ids.
-
TransportAffinityenumWhere servant dispatch may run relative to the transport I/O thread (SHM ring consumer, TCP read loop, etc.).
nprpc::flat
-
BooleanclassA
booleanas stored on the wire: one byte, 0 or 1. -
make_read_only_spanfunctionA read-only byte view of
str, e.g. to pass asvector<u8>. -
make_spanfunctionA writable view of
v's elements. -
operator<<operatorPrints the characters.
-
Optional_DirectclassAccessor for an optional (
name?: T) field.value()returnsT&for plain types and theTDaccessor for messages and strings. -
OwnedDirectclassGeneric zero-copy buffer owner for any flat Direct accessor type. Used for 'out direct struct/array/string/optional' RPC arguments. Stores the shared_ptr that keeps the receive buffer alive, plus the absolute byte offset at which the Direct object lives. The Direct accessor TD is reconstructed cheaply on every call to get().
-
OwnedSpanclassOwns a flat_buffer (via shared_ptr) and exposes a zero-copy span view. Used as the parameter type for 'out direct vector<T>' (primitive element) RPC arguments so the receive buffer is never copied.
-
SpanstructA contiguous run of
Tinside a buffer: pointersfirstandlast,begin()/end(),size(),operator[]anddata(). Does not own the memory. -
Span_refstructA vector of messages or strings inside a buffer. Iterating yields a
TDaccessor (<Message>_Direct,String_Direct1) for each element. -
StringclassA string's layout in the buffer. Public, unlike the other layout types: servants taking
vector<string>receiveSpan_ref<String, String_Direct1>. -
String_Direct1classAccessor for a
stringfield; call it for aSpan<char>. -
Vector_DirectclassAccessor for a
vector<T>field while building or reading a message.Vector_Direct1andVector_Direct2add element access. -
Vector_Direct1classVector_Directfor elements of plain types; call it for aSpan<T>. -
Vector_Direct2classVector_Directfor elements that are messages or strings; call it for aSpan_refofTDaccessors.
nprpc::http
-
clear_cookiefunctionRemove a cookie on the client side by setting Max-Age=0.
-
CookieOptionsstructOptions for a Set-Cookie header.
-
get_cookiefunctionGet a named cookie value from the current HTTP request. Returns std::nullopt when: - not inside an HTTP-dispatched servant call, or - the named cookie is absent.
-
set_cookiefunctionQueue a Set-Cookie header for the current HTTP response. No-op when called from a non-HTTP session.