pdcomm::Gem300CapabilityCatalog
Class
Bounded, revisioned catalog of GEM300 capability declarations.
class Gem300CapabilityCatalogThe 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) noexceptParameters
| Name | Description |
|---|---|
other | Source wrapper; it becomes empty. |
Gem300CapabilityCatalog
Constructor
Copying is disabled; the wrapper exclusively owns its native handle.
Gem300CapabilityCatalog(const Gem300CapabilityCatalog &) = deleteGem300CapabilityCatalog
Constructor
Creates an empty catalog with the given limits.
explicit Gem300CapabilityCatalog(const PdcommGem300CapabilityOptions &options)The options are copied. The new catalog has revision 0 and no profiles.
Parameters
| Name | Description |
|---|---|
options | Limits built with gem300CapabilityOptions(). |
Notes
- Throws
pdcomm::Error:PDCOMM_INVALID_ARGUMENTfor a wrongstruct_sizeorversion;PDCOMM_LIMIT_EXCEEDEDwhen a limit is zero ormax_capabilities_per_profileis larger than 4.
clear
Method
Removes all profiles.
Gem300CapabilityMutation clear()Returns
The new revision and whether anything was removed. Clearing an empty catalog reports changed == false.
Notes
- Throws
pdcomm::Error:PDCOMM_LIMIT_EXCEEDEDwhen the revision counter is exhausted, or another native status.
info
Method
Returns the current revision and totals.
Gem300CapabilityCatalogInfo info() constReturns
Catalog summary.
Notes
- Throws
pdcomm::Error:PDCOMM_INVALID_ARGUMENTwhen the catalog was moved from.
nativeHandle
Method
Returns the owned native handle for direct C API calls.
PdcommGem300CapabilityCatalog *nativeHandle() noexceptReturns
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 noexceptReturns
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) 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.
Gem300CapabilityCatalog &operator=(const Gem300CapabilityCatalog &) = deletereplace
Method
Replaces the whole catalog with profiles.
Gem300CapabilityMutation replace(const std::vector<Gem300CapabilityProfile> &profiles)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
| Name | Description |
|---|---|
profiles | Profiles 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_ARGUMENTfor an empty profile, an empty or non-printable identifier, a duplicate identifier or a duplicate axis;PDCOMM_LIMIT_EXCEEDEDwhen a catalog limit is exceeded or the revision counter is exhausted;PDCOMM_ALLOCATION_FAILEDwhen memory runs out. On any failure the catalog is unchanged.
snapshot
Method
Copies the current contents into an independent snapshot.
Gem300CapabilitySnapshot snapshot() constReturns
A snapshot that stays valid after later changes or destruction of the catalog.
Notes
- Throws
pdcomm::Error:PDCOMM_ALLOCATION_FAILEDwhen memory runs out;PDCOMM_INVALID_ARGUMENTwhen the catalog was moved from.
~Gem300CapabilityCatalog
Method
Releases the native handle with pdcomm_gem300_capability_catalog_destroy().
~Gem300CapabilityCatalog()Snapshots taken earlier stay valid. A moved-from catalog releases nothing.