Declares the C ABI restart subscriber interface. More...
Typedefs | |
| typedef struct apo_restart_subscriber | apo_restart_subscriber |
| Represents an owned CHARMM-style restart writer in the C ABI. | |
Functions | |
| apo_status | apo_restart_subscriber_create (apo_restart_subscriber **out, const char *path) |
| Creates a restart writer with the default 1000-step interval. | |
| apo_status | apo_restart_subscriber_create_with_report_frequency (apo_restart_subscriber **out, const char *path, const int report_frequency) |
| Creates a restart writer with an explicit reporting interval. | |
| void | apo_restart_subscriber_destroy (apo_restart_subscriber *subscriber) |
| Destroys an owned restart-subscriber handle. | |
| apo_status | apo_restart_subscriber_as_subscriber (apo_subscriber **out, apo_restart_subscriber *subscriber) |
| Returns the borrowed base-subscriber view of a restart handle. | |
Declares the C ABI restart subscriber interface.
| typedef struct apo_restart_subscriber apo_restart_subscriber |
Represents an owned CHARMM-style restart writer in the C ABI.
A successful constructor returns a newly owned handle whose text output file has already been created or truncated. Release it exactly once with apo_restart_subscriber_destroy. The handle can provide a borrowed apo_subscriber view for frequency changes and integrator attachment.
Updates occur indirectly during integrator propagation and replace the file with current context and supported-integrator state. Box lengths and coordinates use angstroms, context velocities use angstroms per AKMA time unit, and average temperature uses kelvin.
Do not overlap destruction, subscription, propagation, or frequency changes involving the same handle from multiple threads.
| apo_status apo_restart_subscriber_as_subscriber | ( | apo_subscriber ** | out, |
| apo_restart_subscriber * | subscriber | ||
| ) |
Returns the borrowed base-subscriber view of a restart handle.
| [out] | out | Non-NULL output pointer. The function stores NULL before validating subscriber, then stores a borrowed pointer on success. |
| [in] | subscriber | Borrowed live restart handle. The pointer may not be NULL and is not retained by this call. |
| APO_STATUS_OK | A borrowed base view was written to *out. |
| APO_STATUS_INVALID_ARGUMENT | out is NULL, subscriber is NULL, or the handle contains no native restart object. |
| APO_STATUS_RUNTIME_ERROR | An unexpected standard or nonstandard C++ exception crossed the C ABI boundary. |
out pointer is accepted, *out == NULL. subscriber remains alive. It must not be destroyed separately. | apo_status apo_restart_subscriber_create | ( | apo_restart_subscriber ** | out, |
| const char * | path | ||
| ) |
Creates a restart writer with the default 1000-step interval.
| [out] | out | Non-NULL output pointer. The function stores NULL before validating path or constructing the writer, then stores a newly owned handle on success. |
| [in] | path | Non-NULL, null-terminated filesystem path borrowed for the call and copied by the native subscriber. The string must be nonempty. When the resulting native path has a nonempty parent path, that parent path must exist. |
| APO_STATUS_OK | A newly owned handle was written to *out and the file was created or truncated. |
| APO_STATUS_INVALID_ARGUMENT | out is NULL, path is NULL, the path is empty, or its checked parent path does not exist. |
| APO_STATUS_RUNTIME_ERROR | The file could not be opened, native handle or object allocation failed, or another unexpected C++ exception crossed the boundary. |
out pointer is accepted, *out == NULL. | apo_status apo_restart_subscriber_create_with_report_frequency | ( | apo_restart_subscriber ** | out, |
| const char * | path, | ||
| const int | report_frequency | ||
| ) |
Creates a restart writer with an explicit reporting interval.
| [out] | out | Non-NULL output pointer. The function stores NULL before validating inputs or constructing the writer, then stores a newly owned handle on success. |
| [in] | path | Non-NULL, null-terminated filesystem path borrowed for the call and copied by the native subscriber. The string must be nonempty; when it contains /, its nonempty parent path must exist. |
| [in] | report_frequency | Positive, dimensionless number of propagated steps between restart replacements. |
| APO_STATUS_OK | A newly owned handle was written to *out and the file was created or truncated. |
| APO_STATUS_INVALID_ARGUMENT | out is NULL, path is NULL, the path is empty, its checked parent path does not exist, or report_frequency is not positive. |
| APO_STATUS_RUNTIME_ERROR | The file could not be opened, native handle or object allocation failed, or another unexpected C++ exception crossed the boundary. |
out pointer is accepted, *out == NULL. | void apo_restart_subscriber_destroy | ( | apo_restart_subscriber * | subscriber | ) |
Destroys an owned restart-subscriber handle.
| [in] | subscriber | Owned handle to release. NULL is accepted and is a no-op. A non-NULL pointer and every borrowed base view obtained from it are invalid after this call returns. |