#include <protocol.hpp>
|
| virtual | ~NgenBmiProtocol ()=default |
| | Abstract interface for a generic BMI protocol.
|
| |
◆ ~NgenBmiProtocol()
| virtual models::bmi::protocols::NgenBmiProtocol::~NgenBmiProtocol |
( |
| ) |
|
|
virtualdefault |
Abstract interface for a generic BMI protocol.
◆ check_support()
| virtual nsel_NODISCARD expected< void, ProtocolError > models::bmi::protocols::NgenBmiProtocol::check_support |
( |
const ModelPtr & | model | ) |
|
|
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.
- Parameters
-
| model | A shared pointer to a Bmi_Adapter object which should be initialized before being passed to this method. |
- Returns
- expected<void, ProtocolError> May contain a ProtocolError if the protocol is not supported by the model.
Implemented in models::bmi::protocols::NgenMassBalance.
◆ error_or_warning()
| static auto models::bmi::protocols::NgenBmiProtocol::error_or_warning |
( |
const ProtocolError & | err | ) |
-> expected<void, ProtocolError> |
|
inlinestaticprotected |
◆ initialize()
| virtual auto models::bmi::protocols::NgenBmiProtocol::initialize |
( |
const ModelPtr & | model, |
|
|
const Properties & | properties ) -> expected< void, ProtocolError > |
|
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.
- Parameters
-
| 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. |
- Returns
- expected<void, ProtocolError> May contain a ProtocolError if initialization fails for any reason, since the protocol must be effectively "optional", failed initialization results in the protocol being disabled for the duration of the simulation.
Implemented in models::bmi::protocols::NgenMassBalance.
◆ is_supported()
| virtual bool models::bmi::protocols::NgenBmiProtocol::is_supported |
( |
| ) |
const |
|
protectedpure virtual |
◆ run()
| virtual nsel_NODISCARD auto models::bmi::protocols::NgenBmiProtocol::run |
( |
const ModelPtr & | model, |
|
|
const Context & | ctx ) const -> expected< void, ProtocolError > |
|
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.
- Parameters
-
| 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. |
- Returns
- expected<void, ProtocolError> May contain a ProtocolError if the protocol fails for any reason. Errors of ProtocolError::PROTOCOL_WARNING severity should be logged as warnings, but not cause the simulation to fail.
Implemented in models::bmi::protocols::NgenMassBalance.
◆ NgenBmiProtocols
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.
The documentation for this class was generated from the following file: