Skip to navigation

holoscan::ChannelEndpointCatalog

Beta
View as Markdown

Own an immutable canonical catalog of external Graph endpoints.

Copies share immutable state. Views and spans remain valid while any catalog sharing that state remains alive. The catalog contains no live attachment or execution authority and is safe for concurrent reads.

#include <holoscan/endpoint_catalog.hpp>

Constructors

ChannelEndpointCatalog

holoscan::ChannelEndpointCatalog::ChannelEndpointCatalog() noexcept = default

Create an empty immutable catalog.


Methods

save_json

expected<void, Error> holoscan::ChannelEndpointCatalog::save_json(
const std::filesystem::path &path
) const

Save canonical normalized JSON without mutating this value.

Existing and staged files are compared with fixed-size reads capped at the canonical catalog size plus one byte. Oversized existing content is replaced; an oversized staged file fails verification and is removed.

Returns: Success or a typed filesystem error.

Parameters

path
const std::filesystem::path &

Destination replaced only when canonical bytes differ.

json

std::string holoscan::ChannelEndpointCatalog::json() const

Return canonical normalized catalog JSON.

Returns: Owned canonical bytes; an empty catalog returns an empty string.

digest

std::string_view holoscan::ChannelEndpointCatalog::digest() const noexcept

Return the normalized catalog digest.

Returns: Catalog-owned sha256: spelling, or an empty view for an empty catalog.

raw_source_sha256

std::optional<std::string_view> holoscan::ChannelEndpointCatalog::raw_source_sha256() const noexcept

Return the SHA-256 of exact parsed source bytes when available.

Returns: Catalog-owned sha256: spelling, or no value for program-built catalogs.

raw_source_size_bytes

std::optional<std::uint64_t> holoscan::ChannelEndpointCatalog::raw_source_size_bytes() const noexcept

Return the exact parsed source byte count when available.

Returns: Raw byte count, or no value for program-built catalogs.

scope

std::string_view holoscan::ChannelEndpointCatalog::scope() const noexcept

Return the exact deployment scope carried by this catalog.

Returns: Catalog-owned scope, or an empty view for an empty catalog.

endpoint

std::string_view endpoint_name
) const noexcept

Find one endpoint by its exact stable name.

Failure returns a code-only error so lookup remains nonthrowing.

Returns: Immutable catalog-owned view, or ErrorCode::kNotFound.

Parameters

endpoint_name
std::string_view

Exact case-sensitive endpoint identity.

compatibility_with

const ChannelEndpointCatalog &candidate
) const

Compare this required catalog with one candidate catalog.

Returns: Deterministically ordered compatibility diagnostics.

Parameters

candidate
const ChannelEndpointCatalog &

Candidate/provided immutable catalog.

edit

Builder holoscan::ChannelEndpointCatalog::edit() const

Create an advanced builder initialized from this catalog.

Returns: Independent builder; this immutable catalog is unchanged.


Static methods

parse_json

std::string_view source
)

Parse and normalize one strict schema-v2 JSON catalog.

Returns: Immutable normalized catalog with nonsemantic raw-source provenance.

Parameters

source
std::string_view

Exact source bytes; duplicate keys and invalid UTF-8 reject.

load_json

const std::filesystem::path &path
)

Load and normalize one strict schema-v2 JSON catalog.

Returns: Immutable normalized catalog with nonsemantic raw-source provenance.

Parameters

path
const std::filesystem::path &

File whose exact bytes are read before parsing.

builder

static Builder holoscan::ChannelEndpointCatalog::builder(
std::string_view deployment_scope
)

Create an empty advanced builder for one deployment scope.

Returns: Independent builder defined by endpoint_catalog_builder.hpp.

Parameters

deployment_scope
std::string_view

Nonempty scope copied by the builder.


Member variables

NameTypeDescription
state_std::shared_ptr< const detail::ChannelEndpointCatalogState >

Inner classes

EndpointView

Inspect one immutable endpoint owned by a ChannelEndpointCatalog.

The view borrows catalog state and becomes invalid when the final catalog sharing that state is destroyed. It exposes no attachment or mutation authority and is safe for concurrent reads while its catalog remains alive.

NameTypeDescription
state_const detail::ChannelEndpointCatalogState *
index_std::size_t

Builder

Build or edit one immutable external endpoint catalog.

The builder owns all copied authoring state. It creates no transport service, performs no attachment, and cannot mutate a catalog that has already been built. Build-time validation is identical for graph-derived, parsed, and independently authored catalogs.

NameTypeDescription
state_std::unique_ptr< State >