|
conduit 0.6.0
Modern C++23 header-only event-dispatching / event-transport library
|
Registers event cells for wire decoding. More...
#include <serialization.hpp>
Public Member Functions | |
| EventRegistry () | |
| EventRegistry (const EventRegistry &other) | |
| EventRegistry (EventRegistry &&) noexcept=delete | |
| EventRegistry & | operator= (const EventRegistry &)=delete |
| EventRegistry & | operator= (EventRegistry &&) noexcept=delete |
| ~EventRegistry ()=default | |
| template<typename T > | |
| EventRegistry & | add () |
Register the descriptor for an event type T (i.e. | |
| EventRegistry & | add_descriptor (parcel::cell_type_descriptor_t desc) |
| Register a previously-resolved cell descriptor. | |
| EventEnvelope | decode_json (parcel::json_t const &j) const |
| EventEnvelope | decode_cbor (std::span< const std::uint8_t > bytes) const |
| EventEnvelope | decode_cbor (std::span< const char > bytes) const |
| std::shared_ptr< const parcel::ParcelRegistry > | parcel_registry_snapshot () const noexcept |
| Snapshot accessor for the underlying parcel registry. | |
Registers event cells for wire decoding.
Wraps a parcel::ParcelRegistry, pre-registers the envelope cell and conduit's auxiliary cells, and exposes thin decode_json / decode_cbor helpers that always return an EventEnvelope.
add_descriptor is safe to call concurrently with decode_json / decode_cbor: a writer builds a fresh inner registry from the current snapshot under a unique lock, then swaps the active shared_ptr so readers (which take a shared lock just long enough to copy the handle) always observe a self-consistent state.
|
inline |
|
inline |
|
deletenoexcept |
|
default |
|
inline |
Register the descriptor for an event type T (i.e.
a class derived from conduit::Event<T, Name>).
|
inline |
Register a previously-resolved cell descriptor.
Safe to call from any thread; concurrent readers see a self-consistent registry throughout the swap.
|
inline |
|
inline |
|
inline |
|
delete |
|
deletenoexcept |
|
inlinenoexcept |
Snapshot accessor for the underlying parcel registry.
The returned shared_ptr pins one self-consistent registry version for its lifetime, even while add_descriptor concurrently swaps in newer versions.