|
NGen
|
#include <protocol.hpp>
Inheritance diagram for models::bmi::protocols::NgenBmiProtocol:
Collaboration diagram for models::bmi::protocols::NgenBmiProtocol:Public Member Functions | |
| virtual | ~NgenBmiProtocol ()=default |
| Abstract interface for a generic BMI protocol. | |
Protected Member Functions | |
| virtual nsel_NODISCARD auto | run (const ModelPtr &model, const Context &ctx) const -> expected< void, ProtocolError >=0 |
| Run the BMI protocol against the given model. | |
| virtual nsel_NODISCARD expected< void, ProtocolError > | check_support (const ModelPtr &model)=0 |
| Check if the BMI protocol is supported by the model. | |
| virtual auto | initialize (const ModelPtr &model, const Properties &properties) -> expected< void, ProtocolError >=0 |
| Initialize the BMI protocol from a set of key/value properties. | |
| virtual bool | is_supported () const =0 |
| Whether the protocol is supported by the model. | |
Static Protected Member Functions | |
| static auto | error_or_warning (const ProtocolError &err) -> expected< void, ProtocolError > |
| Handle a ProtocolError by either throwing it or logging it as a warning. | |
Friends | |
| class | NgenBmiProtocols |
| Friend class for managing one or more protocols. | |
|
virtualdefault |
Abstract interface for a generic BMI protocol.
|
protectedpure virtual |
Check if the BMI protocol is supported by the model.
It is the caller's responsibility to ensure that the model provided is consistent with the model provided to the object's initialize() and run() methods, hence the protected nature of this function.
| model | A shared pointer to a Bmi_Adapter object which should be initialized before being passed to this method. |
Implemented in models::bmi::protocols::NgenDeserializationProtocol, models::bmi::protocols::NgenMassBalance, and models::bmi::protocols::NgenSerializationProtocol.
|
inlinestaticprotected |
Handle a ProtocolError by either throwing it or logging it as a warning.
| err | The ProtocolError to handle |
| ProtocolError | if the error is of type PROTOCOL_ERROR |
References models::bmi::protocols::INTEGRATION_ERROR, models::bmi::protocols::PROTOCOL_ERROR, models::bmi::protocols::PROTOCOL_WARNING, models::bmi::protocols::UNITIALIZED_MODEL, and models::bmi::protocols::UNSUPPORTED_PROTOCOL.
Referenced by models::bmi::protocols::NgenBmiProtocols::run(), and models::bmi::protocols::NgenSerializationProtocol::run().
|
protectedpure virtual |
Initialize the BMI protocol from a set of key/value properties.
It is the caller's responsibility to ensure that the model provided is consistent with the model provided to the object's run() and check_support() methods, hence the protected nature of this function.
| properties | key/value pairs for initializing the protocol |
| model | A shared pointer to a Bmi_Adapter object which should be initialized before being passed to this method. |
Implemented in models::bmi::protocols::NgenDeserializationProtocol, models::bmi::protocols::NgenMassBalance, and models::bmi::protocols::NgenSerializationProtocol.
|
protectedpure virtual |
Whether the protocol is supported by the model.
Implemented in models::bmi::protocols::NgenDeserializationProtocol, models::bmi::protocols::NgenMassBalance, and models::bmi::protocols::NgenSerializationProtocol.
|
protectedpure virtual |
Run the BMI protocol against the given model.
Execute the logic of the protocol with the provided context and model. It is the caller's responsibility to ensure that the model provided is consistent with the model provided to the object's initialize() and check_support() methods, hence the protected nature of this function.
| ctx | Contextual information for the protocol run |
| model | A shared pointer to a Bmi_Adapter object which should be initialized before being passed to this method. |
Implemented in models::bmi::protocols::NgenDeserializationProtocol, models::bmi::protocols::NgenMassBalance, and models::bmi::protocols::NgenSerializationProtocol.
|
friend |
Friend class for managing one or more protocols.
This allows the NgenBmiProtocols container class to access the protected run() method. This allows the container to ensure consistent application of the protocol with a particular bmi model instance throughout the lifecycle of a given protocol.