pdcomm_gem_formatted_program_store_snapshot
Function
Copies the whole store into a new owned snapshot.
PdcommStatus pdcomm_gem_formatted_program_store_snapshot(PdcommTcpEndpoint *endpoint, PdcommGemFormattedProgramStoreSnapshot **out_snapshot)Entries appear in the order they were first added; a replaced entry keeps its position.
Parameters
| Name | Description |
|---|---|
endpoint | Equipment endpoint with the formatted program query service configured. |
out_snapshot | Receives the snapshot. Set to NULL first, so it is NULL after every failure on a valid endpoint. |
Returns
#PDCOMM_OK on success; #PDCOMM_INVALID_ARGUMENT when endpoint or out_snapshot is NULL; #PDCOMM_INVALID_STATE when the endpoint is not an Equipment or the query service is not configured; #PDCOMM_BACKPRESSURE when a staged TCP event must be drained first; #PDCOMM_ALLOCATION_FAILED when the copy cannot be allocated; #PDCOMM_POISONED when the endpoint is poisoned.
Notes
- Ownership: release the snapshot with pdcomm_gem_formatted_program_store_snapshot_destroy(). It stays valid after later store changes and after the endpoint is destroyed.
- Thread safety: serialize with every other call on
endpoint.