Skip to navigation

holoscan::ClockKey

Beta
View as Markdown

Identify a clock declaration during cold graph and plan construction.

A key owns either a clock name or the distinct omitted/default identity. It is safe to retain after the source string is destroyed. A key does not identify a live clock generation and cannot be constructed from a ClockId or ClockRef. Resolution to a live clock is a session operation.

Thread safety: distinct values may be used concurrently. Concurrent mutation and access to the same value requires external synchronization. Creating or copying a named key may allocate to own the name; queries do not allocate.

#include <holoscan/clock_registry.hpp>

Constructors

ClockKey

noexcept
holoscan::ClockKey::ClockKey() noexcept = default

Create the omitted key that resolves to the graph or runtime default clock.


Methods

is_default

bool holoscan::ClockKey::is_default() const noexcept

Return whether this key denotes the graph or runtime default clock.

This operation does not allocate.

Returns: true for the omitted/default identity; otherwise false.

name

std::string_view holoscan::ClockKey::name() const noexcept

Return the owned declaration name.

The view remains valid until this key is modified or destroyed. This operation does not allocate.

Returns: The declaration name, or an empty view for the default key.


Static methods

default_clock

static ClockKey holoscan::ClockKey::default_clock() noexcept

Create the omitted key that resolves to the default clock.

This operation does not allocate.

Returns: The distinct default-clock key.

named

static ClockKey holoscan::ClockKey::named(
std::string_view name
)

Create a named cold clock key.

This operation may allocate to own name.

Returns: A key that owns name.

Throws: std::bad_alloc if storage for the owned name cannot be allocated.

Parameters

name
std::string_view

Clock declaration name to copy.


Member variables

NameTypeDescription
name_std::string
is_default_bool