Declares categorized native errors and source-capturing error macros. More...
Classes | |
| class | ApoCharmmError |
| Represents a categorized native error with source metadata. More... | |
Macros | |
| #define | APOCHARMM_THROW(errorCode, message) throw ::ApoCharmmError((errorCode), (message), __FILE__, __func__, __LINE__) |
| Throws a categorized apoCHARMM error at the current source location. | |
| #define | APOCHARMM_REQUIRE(condition, errorCode, message) |
| Throws a categorized apoCHARMM error unless a condition is true. | |
Enumerations | |
| enum class | ApoCharmmErrorCode { InvalidArgument , Runtime , Cuda , NotInitialized , NotImplemented } |
| Identifies the category of an apoCHARMM native failure. More... | |
Functions | |
| std::string_view | GetApoCharmmErrorCodeName (const ApoCharmmErrorCode code) noexcept |
| Returns the diagnostic name of an apoCHARMM error category. | |
Declares categorized native errors and source-capturing error macros.
| #define APOCHARMM_REQUIRE | ( | condition, | |
| errorCode, | |||
| message | |||
| ) |
Throws a categorized apoCHARMM error unless a condition is true.
The macro evaluates condition exactly once. It evaluates errorCode and message only when the condition is false, then delegates source capture and construction to APOCHARMM_THROW.
| [in] | condition | Expression whose contextual Boolean value must be true. |
| [in] | errorCode | Expression yielding the retained ApoCharmmErrorCode when condition is false. |
| [in] | message | Expression convertible to std::string_view; evaluated and copied only when condition is false. |
| ApoCharmmError | If condition is false and construction succeeds. |
| std::bad_alloc | If failure-path storage cannot be allocated. |
| std::length_error | If the failure diagnostic exceeds a string limit. |
__func__ is available. condition is true, execution continues and neither errorCode nor message is evaluated. noexcept cleanup path or destructor. | #define APOCHARMM_THROW | ( | errorCode, | |
| message | |||
| ) | throw ::ApoCharmmError((errorCode), (message), __FILE__, __func__, __LINE__) |
Throws a categorized apoCHARMM error at the current source location.
The macro evaluates each argument exactly once and captures __FILE__, __func__, and __LINE__ from the expansion site.
| [in] | errorCode | Expression yielding the retained ApoCharmmErrorCode. |
| [in] | message | Expression convertible to std::string_view; its text is copied by the exception constructor. |
| ApoCharmmError | Always when exception construction succeeds. |
| std::bad_alloc | If exception storage cannot be allocated. |
| std::length_error | If the diagnostic exceeds a string limit. |
__func__ is available. noexcept cleanup path or destructor.
|
strong |
Identifies the category of an apoCHARMM native failure.
The category is stored independently from the human-readable diagnostic. C ABI boundaries map each declared value to the corresponding apo_status value without relying on this enum's underlying integer representation.
|
noexcept |
Returns the diagnostic name of an apoCHARMM error category.
| [in] | code | Category to name. |
"Unknown".