PDComm.Gem300CapabilityCatalog
Class
A local, revisioned catalog of GEM300 capability profiles.
public sealed class Gem300CapabilityCatalog : GemOwnedSnapshotThe catalog is application metadata held in native memory; it is not bound to an endpoint and sends no messages. It starts empty at revision 0, and every change that alters the contents increases the revision by one.
Calls on one catalog are serialized by an internal lock. Dispose the catalog when you are done; snapshots taken from it stay valid after it is changed or disposed.
Members
Gem300CapabilityCatalog
Constructor
Creates an empty catalog with the given limits.
public Gem300CapabilityCatalog(Gem300CapabilityOptions options)Parameters
| Name | Description |
|---|---|
options | The catalog limits. Every limit must be nonzero, and Gem300CapabilityOptions.MaxCapabilitiesPerProfile must not exceed 4. |
Notes
- Throws
ArgumentNullException:optionsisnull. - Throws
NotSupportedException: The loaded native library does not export the GEM300 capability catalog functions. - Throws
PdcommException:PdcommStatus.LimitExceededwhen a limit is zero orGem300CapabilityOptions.MaxCapabilitiesPerProfileexceeds 4.
Clear
Method
Removes every profile from the catalog.
public Gem300CatalogChange Clear()Returns
The revision after the call and whether anything was removed; clearing an empty catalog changes nothing.
Notes
- Throws
ObjectDisposedException: The catalog was disposed. - Throws
PdcommException: The native library rejected the call.
GetInfo
Method
Gets the revision and size of the catalog.
public Gem300CapabilityCatalogInfo GetInfo()Returns
The revision, the profile and capability counts, and the total identifier bytes.
Notes
- Throws
ObjectDisposedException: The catalog was disposed. - Throws
PdcommException: The native library rejected the call.
Replace
Method
Replaces the whole catalog with the given profiles.
public Gem300CatalogChange Replace(IReadOnlyList<Gem300CapabilityProfile> profiles)The input is validated and copied as a whole; a failed call leaves the catalog unchanged.
Parameters
| Name | Description |
|---|---|
profiles | The profiles in order; an empty list clears the catalog. |
Returns
The new revision and whether the contents changed. Replacing the catalog with equal contents changes nothing.
Notes
- Throws
ArgumentNullException:profiles, a profile, a capability, or an identifier isnull. - Throws
ArgumentException: An identifier contains an invalid UTF-16 surrogate sequence. - Throws
ObjectDisposedException: The catalog was disposed. - Throws
PdcommException:PdcommStatus.InvalidArgumentwhen a profile has no capabilities, an identifier is empty or has a byte outside 0x21 through 0x7E, a profile identifier repeats, a capability identifier or axis repeats within a profile, or an enumeration value is undefined;PdcommStatus.LimitExceededwhen the profiles exceed the catalog limits.
Snapshot
Method
Takes an immutable copy of the catalog.
public Gem300CapabilitySnapshot Snapshot()The snapshot stays valid after the catalog is replaced, cleared or disposed.
Returns
A snapshot of the current contents and revision. The caller owns it and must dispose it.
Notes
- Throws
ObjectDisposedException: The catalog was disposed. - Throws
PdcommException: The native library failed to copy the catalog.