Skip to content
Start free evaluation

pdcomm::Gem300CapabilitySnapshot

Class

Immutable copy of a Gem300CapabilityCatalog at one revision.

class Gem300CapabilitySnapshot

Declared in: #include <pdcomm_gem300.hpp>

A snapshot owns its complete ordered contents. It stays valid and unchanged after the catalog is replaced, cleared or destroyed. Get one from Gem300CapabilityCatalog::snapshot().

const auto snapshot = catalog.snapshot();
for (std::size_t p = 0; p < snapshot.info().profileCount; ++p) {
    std::cout << snapshot.profileId(p) << '\n';
    for (std::size_t c = 0; c < snapshot.profileInfo(p).capabilityCount; ++c)
        std::cout << "  " << snapshot.capabilityId(p, c) << '\n';
}

Notes

  • Move-only RAII wrapper. All getters are read-only and may run concurrently on one snapshot; destruction must not race with them. A default-constructed or moved-from snapshot is empty, and its getters throw pdcomm::Error with PDCOMM_INVALID_ARGUMENT.

Members

Gem300CapabilitySnapshot

Constructor

Creates an empty snapshot that owns no native handle.

Gem300CapabilitySnapshot() noexcept = default

Declared in: #include <pdcomm_gem300.hpp>

Gem300CapabilitySnapshot

Constructor

Takes ownership of the native handle owned by other.

Gem300CapabilitySnapshot(Gem300CapabilitySnapshot &&other) noexcept

Declared in: #include <pdcomm_gem300.hpp>

Parameters

NameDescription
otherSource wrapper; it becomes empty.

Gem300CapabilitySnapshot

Constructor

Copying is disabled; the wrapper exclusively owns its native handle.

Gem300CapabilitySnapshot(const Gem300CapabilitySnapshot &) = delete

Declared in: #include <pdcomm_gem300.hpp>

capabilityId

Method

Copies the identifier of one capability.

std::string capabilityId(std::size_t profileIndex, std::size_t capabilityIndex) const

Declared in: #include <pdcomm_gem300.hpp>

Parameters

NameDescription
profileIndexZero-based profile position.
capabilityIndexZero-based capability position inside the profile.

Returns

The capability identifier.

Notes

  • Throws pdcomm::Error: PDCOMM_OUT_OF_RANGE for an invalid index; PDCOMM_INVALID_ARGUMENT when the snapshot is empty.

capabilityInfo

Method

Describes one capability of one profile.

Gem300CapabilityInfo capabilityInfo(std::size_t profileIndex, std::size_t capabilityIndex) const

Declared in: #include <pdcomm_gem300.hpp>

Parameters

NameDescription
profileIndexZero-based profile position.
capabilityIndexZero-based capability position inside the profile.

Returns

Identifier length, axis, status and verification state.

Notes

  • Throws pdcomm::Error: PDCOMM_OUT_OF_RANGE for an invalid index; PDCOMM_INVALID_ARGUMENT when the snapshot is empty.

info

Method

Returns the revision and totals captured in this snapshot.

Gem300CapabilityCatalogInfo info() const

Declared in: #include <pdcomm_gem300.hpp>

Returns

Snapshot summary.

Notes

  • Throws pdcomm::Error: PDCOMM_INVALID_ARGUMENT when the snapshot is empty.

nativeHandle

Method

Returns the owned native handle for read-only C API calls.

const PdcommGem300CapabilitySnapshot *nativeHandle() const noexcept

Declared in: #include <pdcomm_gem300.hpp>

Returns

The handle, or nullptr for an empty snapshot. Ownership stays with this wrapper.

operator bool

Method

Reports whether the wrapper owns a native snapshot.

explicit operator bool() const noexcept

Declared in: #include <pdcomm_gem300.hpp>

Returns

true when a snapshot is owned.

operator=

Method

Releases the current handle, then takes ownership of the handle owned by other.

Gem300CapabilitySnapshot &operator=(Gem300CapabilitySnapshot &&other) noexcept

Declared in: #include <pdcomm_gem300.hpp>

Parameters

NameDescription
otherSource wrapper; it becomes empty.

Returns

This wrapper.

operator=

Method

Copy assignment is disabled; the wrapper exclusively owns its native handle.

Gem300CapabilitySnapshot &operator=(const Gem300CapabilitySnapshot &) = delete

Declared in: #include <pdcomm_gem300.hpp>

profileId

Method

Copies the identifier of one profile.

std::string profileId(std::size_t profileIndex) const

Declared in: #include <pdcomm_gem300.hpp>

Parameters

NameDescription
profileIndexZero-based profile position.

Returns

The profile identifier.

Notes

  • Throws pdcomm::Error: PDCOMM_OUT_OF_RANGE for an invalid index; PDCOMM_INVALID_ARGUMENT when the snapshot is empty.

profileInfo

Method

Returns size information for one profile.

Gem300CapabilityProfileInfo profileInfo(std::size_t profileIndex) const

Declared in: #include <pdcomm_gem300.hpp>

Parameters

NameDescription
profileIndexZero-based profile position, in catalog order.

Returns

Identifier length and capability count of the profile.

Notes

  • Throws pdcomm::Error: PDCOMM_OUT_OF_RANGE when profileIndex is not less than the profile count; PDCOMM_INVALID_ARGUMENT when the snapshot is empty.

~Gem300CapabilitySnapshot

Method

Releases the native handle with pdcomm_gem300_capability_snapshot_destroy().

~Gem300CapabilitySnapshot()

Declared in: #include <pdcomm_gem300.hpp>

An empty snapshot releases nothing.