pdcomm::Gem300CapabilitySnapshot
Class
Immutable copy of a Gem300CapabilityCatalog at one revision.
class Gem300CapabilitySnapshotA 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 = defaultGem300CapabilitySnapshot
Constructor
Takes ownership of the native handle owned by other.
Gem300CapabilitySnapshot(Gem300CapabilitySnapshot &&other) noexceptParameters
| Name | Description |
|---|---|
other | Source wrapper; it becomes empty. |
Gem300CapabilitySnapshot
Constructor
Copying is disabled; the wrapper exclusively owns its native handle.
Gem300CapabilitySnapshot(const Gem300CapabilitySnapshot &) = deletecapabilityId
Method
Copies the identifier of one capability.
std::string capabilityId(std::size_t profileIndex, std::size_t capabilityIndex) constParameters
| Name | Description |
|---|---|
profileIndex | Zero-based profile position. |
capabilityIndex | Zero-based capability position inside the profile. |
Returns
The capability identifier.
Notes
- Throws
pdcomm::Error:PDCOMM_OUT_OF_RANGEfor an invalid index;PDCOMM_INVALID_ARGUMENTwhen the snapshot is empty.
capabilityInfo
Method
Describes one capability of one profile.
Gem300CapabilityInfo capabilityInfo(std::size_t profileIndex, std::size_t capabilityIndex) constParameters
| Name | Description |
|---|---|
profileIndex | Zero-based profile position. |
capabilityIndex | Zero-based capability position inside the profile. |
Returns
Identifier length, axis, status and verification state.
Notes
- Throws
pdcomm::Error:PDCOMM_OUT_OF_RANGEfor an invalid index;PDCOMM_INVALID_ARGUMENTwhen the snapshot is empty.
info
Method
Returns the revision and totals captured in this snapshot.
Gem300CapabilityCatalogInfo info() constReturns
Snapshot summary.
Notes
- Throws
pdcomm::Error:PDCOMM_INVALID_ARGUMENTwhen the snapshot is empty.
nativeHandle
Method
Returns the owned native handle for read-only C API calls.
const PdcommGem300CapabilitySnapshot *nativeHandle() const noexceptReturns
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 noexceptReturns
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) noexceptParameters
| Name | Description |
|---|---|
other | Source wrapper; it becomes empty. |
Returns
This wrapper.
operator=
Method
Copy assignment is disabled; the wrapper exclusively owns its native handle.
Gem300CapabilitySnapshot &operator=(const Gem300CapabilitySnapshot &) = deleteprofileId
Method
Copies the identifier of one profile.
std::string profileId(std::size_t profileIndex) constParameters
| Name | Description |
|---|---|
profileIndex | Zero-based profile position. |
Returns
The profile identifier.
Notes
- Throws
pdcomm::Error:PDCOMM_OUT_OF_RANGEfor an invalid index;PDCOMM_INVALID_ARGUMENTwhen the snapshot is empty.
profileInfo
Method
Returns size information for one profile.
Gem300CapabilityProfileInfo profileInfo(std::size_t profileIndex) constParameters
| Name | Description |
|---|---|
profileIndex | Zero-based profile position, in catalog order. |
Returns
Identifier length and capability count of the profile.
Notes
- Throws
pdcomm::Error:PDCOMM_OUT_OF_RANGEwhenprofileIndexis not less than the profile count;PDCOMM_INVALID_ARGUMENTwhen the snapshot is empty.
~Gem300CapabilitySnapshot
Method
Releases the native handle with pdcomm_gem300_capability_snapshot_destroy().
~Gem300CapabilitySnapshot()An empty snapshot releases nothing.