Skip to content
Start free evaluation

pdcomm::Gem300CapabilityCatalog

Class

Bounded, revisioned catalog of GEM300 capability declarations.

class Gem300CapabilityCatalog

Declared in: #include <pdcomm_gem300.hpp>

The catalog records which GEM300 areas (process jobs, carriers, substrates and control jobs) each named profile declares, and with which status label. It is a declaration model and sends no messages.

Every replace() validates the complete input first and installs it atomically, so a failed call leaves the catalog unchanged. Use snapshot() to read a consistent copy.

pdcomm::Gem300CapabilityCatalog catalog(pdcomm::gem300CapabilityOptions(
    3, 4, 8, 16, 16, 96));
std::vector<pdcomm::Gem300CapabilityProfile> profiles = {
    {"PRIMARY",
     {{"PJ", pdcomm::Gem300CapabilityAxis::ProcessJob,
       pdcomm::Gem300CapabilityStatus::Experimental},
      {"CARRIER", pdcomm::Gem300CapabilityAxis::Carrier,
       pdcomm::Gem300CapabilityStatus::ModelOnly}}},
};
const auto first = catalog.replace(profiles);  // first.revision == 1, first.changed
auto snapshot = catalog.snapshot();

Notes

  • Move-only RAII wrapper. The catalog has no internal lock: serialize replace() and clear() with every other call on the same catalog. info() and snapshot() may run concurrently with each other.

Members

Gem300CapabilityCatalog

Constructor

Takes ownership of the native handle owned by other.

Gem300CapabilityCatalog(Gem300CapabilityCatalog &&other) noexcept

Declared in: #include <pdcomm_gem300.hpp>

Parameters

NameDescription
otherSource wrapper; it becomes empty.

Gem300CapabilityCatalog

Constructor

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

Gem300CapabilityCatalog(const Gem300CapabilityCatalog &) = delete

Declared in: #include <pdcomm_gem300.hpp>

Gem300CapabilityCatalog

Constructor

Creates an empty catalog with the given limits.

explicit Gem300CapabilityCatalog(const PdcommGem300CapabilityOptions &options)

Declared in: #include <pdcomm_gem300.hpp>

The options are copied. The new catalog has revision 0 and no profiles.

Parameters

NameDescription
optionsLimits built with gem300CapabilityOptions().

Notes

  • Throws pdcomm::Error: PDCOMM_INVALID_ARGUMENT for a wrong struct_size or version; PDCOMM_LIMIT_EXCEEDED when a limit is zero or max_capabilities_per_profile is larger than 4.

clear

Method

Removes all profiles.

Gem300CapabilityMutation clear()

Declared in: #include <pdcomm_gem300.hpp>

Returns

The new revision and whether anything was removed. Clearing an empty catalog reports changed == false.

Notes

  • Throws pdcomm::Error: PDCOMM_LIMIT_EXCEEDED when the revision counter is exhausted, or another native status.

info

Method

Returns the current revision and totals.

Gem300CapabilityCatalogInfo info() const

Declared in: #include <pdcomm_gem300.hpp>

Returns

Catalog summary.

Notes

  • Throws pdcomm::Error: PDCOMM_INVALID_ARGUMENT when the catalog was moved from.

nativeHandle

Method

Returns the owned native handle for direct C API calls.

PdcommGem300CapabilityCatalog *nativeHandle() noexcept

Declared in: #include <pdcomm_gem300.hpp>

Returns

The handle, or nullptr for a moved-from catalog. Ownership stays with this wrapper.

nativeHandle

Method

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

const PdcommGem300CapabilityCatalog *nativeHandle() const noexcept

Declared in: #include <pdcomm_gem300.hpp>

Returns

The handle, or nullptr for a moved-from catalog. Ownership stays with this wrapper.

operator=

Method

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

Gem300CapabilityCatalog &operator=(Gem300CapabilityCatalog &&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.

Gem300CapabilityCatalog &operator=(const Gem300CapabilityCatalog &) = delete

Declared in: #include <pdcomm_gem300.hpp>

replace

Method

Replaces the whole catalog with profiles.

Gem300CapabilityMutation replace(const std::vector<Gem300CapabilityProfile> &profiles)

Declared in: #include <pdcomm_gem300.hpp>

The input is validated and copied before the call returns. If the input equals the current contents, nothing changes and the revision stays the same. An empty vector clears the catalog. Every capability is stored with the defined verification label.

Parameters

NameDescription
profilesProfiles in order. Each needs a unique identifier and 1 to 4 capabilities with unique identifiers and distinct axes.

Returns

The new revision and whether the contents changed.

Notes

  • Throws pdcomm::Error: PDCOMM_INVALID_ARGUMENT for an empty profile, an empty or non-printable identifier, a duplicate identifier or a duplicate axis; PDCOMM_LIMIT_EXCEEDED when a catalog limit is exceeded or the revision counter is exhausted; PDCOMM_ALLOCATION_FAILED when memory runs out. On any failure the catalog is unchanged.

snapshot

Method

Copies the current contents into an independent snapshot.

Gem300CapabilitySnapshot snapshot() const

Declared in: #include <pdcomm_gem300.hpp>

Returns

A snapshot that stays valid after later changes or destruction of the catalog.

Notes

  • Throws pdcomm::Error: PDCOMM_ALLOCATION_FAILED when memory runs out; PDCOMM_INVALID_ARGUMENT when the catalog was moved from.

~Gem300CapabilityCatalog

Method

Releases the native handle with pdcomm_gem300_capability_catalog_destroy().

~Gem300CapabilityCatalog()

Declared in: #include <pdcomm_gem300.hpp>

Snapshots taken earlier stay valid. A moved-from catalog releases nothing.