33#include <unordered_map>
49#if defined(__GNUC__) || defined(__clang__)
50#pragma GCC visibility push(default)
164 template <
typename... Args>
166 class IComponentDataItem;
167 class IModelComponent;
168 class IAdaptedOutputFactory;
173 class IAdaptedOutput;
174 class IAdaptedOutputFactoryComponent;
176 class IComponentDataItemValueChanged;
177 class IComponentStatusChangeEventArgs;
178 class IWorkflowComponent;
179 class IWorkflowComponentStatusChangeEventArgs;
354 template <
typename... Args>
377 template <
typename... Args>
409 virtual void emit(Args... args) = 0;
447 [[nodiscard]]
virtual const std::string &
caption()
const = 0;
493 [[nodiscard]]
virtual const std::string &
id()
const = 0;
539 [[nodiscard]]
virtual std::string
developer()
const = 0;
551 [[nodiscard]]
virtual std::string
license()
const = 0;
557 [[nodiscard]]
virtual std::string
copyright()
const = 0;
563 [[nodiscard]]
virtual std::string
url()
const = 0;
569 [[nodiscard]]
virtual std::string
email()
const = 0;
575 [[nodiscard]]
virtual std::string
version()
const = 0;
582 [[nodiscard]]
virtual std::set<std::string>
tags()
const = 0;
607 [[nodiscard]]
virtual bool validateLicense(
const std::string &licenseInfo, std::string &validationMessage) = 0;
642 virtual void showEditor(
void *opaqueUIPointer =
nullptr) = 0;
654 virtual void showViewer(
void *opaqueUIPointer =
nullptr) = 0;
861 using ISignal<
const std::shared_ptr<IComponentStatusChangeEventArgs> &>
::connect;
898 [[nodiscard]]
virtual std::vector<IArgument *>
arguments()
const = 0;
913 [[nodiscard]]
virtual std::vector<IInput *>
inputs()
const = 0;
929 [[nodiscard]]
virtual std::vector<IOutput *>
outputs()
const = 0;
935 [[nodiscard]]
virtual std::vector<IComponentDataItem *>
results()
const = 0;
951 [[nodiscard]]
virtual std::vector<IComponentDataItem *>
states()
const = 0;
996 [[nodiscard]]
virtual std::vector<std::string>
validate() = 0;
1045 virtual void update(
const std::vector<IOutput *> &requiredOutputs = {}) = 0;
1100 [[nodiscard]]
virtual std::vector<ErrorEntry>
errors(
bool clearAfterRead =
false) = 0;
1154 [[nodiscard]]
virtual std::string
message()
const = 0;
1200 [[nodiscard]]
virtual std::unique_ptr<ICloneableModelComponent>
clone(
const std::unordered_map<std::string, std::string> &clone_optional_arguments = std::unordered_map<std::string, std::string>()) = 0;
1208 [[nodiscard]]
virtual std::vector<ICloneableModelComponent *>
clones()
const = 0;
1249 [[nodiscard]]
virtual bool saveState(std::string &token, std::string &message) = 0;
1260 [[nodiscard]]
virtual bool restoreState(
const std::string &token, std::string &message) = 0;
1277 [[nodiscard]]
virtual bool releaseState(
const std::string &token, std::string &message) = 0;
1388 std::string *message =
nullptr) = 0;
1399 std::string *message =
nullptr) = 0;
1583 [[nodiscard]]
virtual std::vector<std::string>
categories()
const = 0;
1780 [[nodiscard]]
virtual std::string
symbol()
const = 0;
1787 [[nodiscard]]
virtual std::string
ucumCode()
const = 0;
1854 using ISignal<
const std::shared_ptr<IComponentDataItemValueChanged> &>
::connect;
1878 [[nodiscard]]
virtual std::vector<IDimension *>
dimensions()
const = 0;
1886 [[nodiscard]]
virtual std::vector<int64_t>
shape()
const = 0;
1922 std::span<const int64_t> start,
1923 std::span<const int64_t> count,
1924 std::string *message =
nullptr)
const = 0;
1937 std::span<const int64_t> start,
1938 std::span<const int64_t> count,
1939 std::string *message =
nullptr) = 0;
1967 [[nodiscard]]
virtual std::vector<int64_t>
start()
const = 0;
1973 [[nodiscard]]
virtual std::vector<int64_t>
count()
const = 0;
2074 [[nodiscard]]
virtual std::string
toString()
const = 0;
2087 [[nodiscard]]
virtual std::vector<std::string>
fileFilters()
const = 0;
2185 [[nodiscard]]
virtual std::vector<IInput *>
consumers()
const = 0;
2330 [[nodiscard]]
virtual std::vector<IArgument *>
arguments()
const = 0;
2383 [[nodiscard]]
virtual std::vector<IComponentDataItem *>
states()
const = 0;
2452 std::string *message =
nullptr) = 0;
2465 std::string *message =
nullptr) = 0;
2504 [[nodiscard]]
virtual bool saveState(std::string &token, std::string &message) = 0;
2514 [[nodiscard]]
virtual bool restoreState(
const std::string &token, std::string &message) = 0;
2525 [[nodiscard]]
virtual bool releaseState(
const std::string &token, std::string &message) = 0;
2696 [[nodiscard]]
virtual std::vector<IOutput *>
providers()
const = 0;
2750 [[nodiscard]]
virtual std::vector<std::string>
identifiers()
const = 0;
2851 using ISignal<
const std::shared_ptr<IWorkflowComponentStatusChangeEventArgs> &>
::connect;
2852 using ISignal<
const std::shared_ptr<IWorkflowComponentStatusChangeEventArgs> &>
::disconnect;
2900 [[nodiscard]]
virtual std::vector<std::string>
validate() = 0;
2978 [[nodiscard]]
virtual std::vector<ErrorEntry>
errors(
bool clearAfterRead =
false) = 0;
3045 [[nodiscard]]
virtual std::string
message()
const = 0;
3062#if defined(__GNUC__) || defined(__clang__)
3063#pragma GCC visibility pop
IAdaptedOutputFactoryComponent is an IAdaptedOutputFactory generated from an IAdaptedOutputFactoryCom...
Definition hydrocouple.h:2607
virtual ~IAdaptedOutputFactoryComponent()=default
IAdaptedOutputFactoryComponent::~IAdaptedOutputFactoryComponent is a virtual destructor.
virtual IAdaptedOutputFactoryComponentInfo * componentInfo() const =0
Contains the metadata about this IAdaptedOutputFactoryComponent.
IAdaptedOutputFactoryComponentInfo interface class provides information about an IAdaptedOutputFactor...
Definition hydrocouple.h:2585
virtual ~IAdaptedOutputFactoryComponentInfo()=default
IAdaptedOutputFactoryComponentInfo::~IAdaptedOutputFactoryComponentInfo is a virtual destructor.
virtual std::unique_ptr< IAdaptedOutputFactoryComponent > createComponentInstance()=0
New IAdaptedOutputFactoryComponent instance.
IAdaptedOutputFactory is used to create instances of IAdaptedOutput.
Definition hydrocouple.h:2537
virtual std::unique_ptr< IAdaptedOutput > createAdaptedOutput(IIdentity *adaptedProviderId, IOutput *provider, IInput *consumer=nullptr)=0
Creates a IAdaptedOutput that adapts the producer so that it fits the consumer.
virtual ~IAdaptedOutputFactory()=default
IAdaptedOutputFactory::~IAdaptedOutputFactory is a virtual destructor.
virtual std::vector< IIdentity * > getAvailableAdaptedOutputIds(const IOutput *provider, const IInput *consumer=nullptr)=0
Get a vector of IIdentity objects representing the vector of IAdaptedOutput instances that can be cre...
An IAdaptedOutput adds one or more data operations on top of an IOutput.
Definition hydrocouple.h:2306
virtual IOutput * adaptee() const =0
IOutput that this IAdaptedOutput extracts content from.
virtual IAdaptedOutputFactory * adaptedOutputFactory() const =0
IAdaptedOutputFactory that generated this IAdaptedOutput.
virtual ~IAdaptedOutput()=default
IAdaptedOutput::~IAdaptedOutput is a virtual destructor.
virtual void initialize()=0
Lets this IAdaptedOutput initialize() itself, based on the current values specified by the arguments.
virtual void refresh()=0
Requests the IAdaptedOutput to refresh itself and perform any necessary calculations.
virtual std::vector< IArgument * > arguments() const =0
IArgument represents input parameters needed for this IAdaptedOutput.
virtual std::vector< IComponentDataItem * > states() const =0
The data items that make up the state carried from one refresh() to the next.
IArgument interface class used to set the arguments for components.
Definition hydrocouple.h:1983
ArgumentRole
What kind of thing an argument is to the model that owns it.
Definition hydrocouple.h:2034
@ InitialCondition
The state at the start of the simulation.
Definition hydrocouple.h:2037
@ Configuration
How the model runs: paths, options, solver settings, output selection.
Definition hydrocouple.h:2035
@ Forcing
A prescribed time-varying input that is not supplied through an IInput (a boundary time series read f...
Definition hydrocouple.h:2038
@ Parameter
A coefficient of the process equations (roughness, conductivity, rate constants).
Definition hydrocouple.h:2036
@ Geometry
The spatial discretization itself (a mesh, a network, a raster grid).
Definition hydrocouple.h:2039
virtual bool isValidArgType(ArgumentInputType argType) const =0
Whether this argument can be initialized from, and serialized to, the given representation.
virtual void saveData()=0
Writes data to files associated with this argument if they exist.
virtual ArgumentRole role() const =0
What this argument is to the model.
virtual ArgumentInputType currentArgumentInputType() const =0
Gets the current input type used for this argument.
virtual bool isReadOnly() const =0
Whether the argument's values may be changed (through initialize() or setValuesFrom()).
virtual std::vector< const std::type_info * > validComponentDataItemTypes() const =0
Gets the valid IComponentDataItem instance types that can be read by this argument.
ArgumentInputType
Enumeration indicating the type of input for the argument.
Definition hydrocouple.h:1990
@ File
Enumeration indicating that the argument was read from a file.
Definition hydrocouple.h:1999
@ JSON
Enumeration indicating that the argument input is in JSON format.
Definition hydrocouple.h:2004
@ String
Enumeration indicating that the argument was read from string.
Definition hydrocouple.h:1994
@ XML
Enumeration indicating that the argument input is in XML format.
Definition hydrocouple.h:2014
@ YAML
Enumeration indicating that the argument input is in YAML format.
Definition hydrocouple.h:2009
@ URL
Enumeration indicating that the argument was read from a URL.
Definition hydrocouple.h:2019
@ MEMORY_OBJECT
Enumeration indicating that the argument was read from a memory object.
Definition hydrocouple.h:2024
virtual bool serialize(ArgumentInputType argType, std::string &value, std::string &message) const =0
Serializes this argument's current value to the requested representation.
virtual bool initialize(const std::string &value, ArgumentInputType argType, std::string &message)=0
Reads values from a string in the given representation (a JSON/YAML/XML document, a file path,...
virtual std::vector< std::string > fileFilters() const =0
File type extensions that can be read by this IArgument.
virtual bool initialize(const IComponentDataItem &componentDataItem, std::string &message)=0
Reads values from an equivalent IComponentDataItem.
virtual ~IArgument()=default
IArgument::~IArgument is a virtual destructor.
virtual std::string toString() const =0
A human-readable rendering of this argument's current value, for display and logs.
virtual bool isOptional() const =0
Specifies whether the argument is optional or not.
ICheckpointableAdaptedOutput is an adapted output that can save and restore the state it carries betw...
Definition hydrocouple.h:2491
virtual bool saveState(std::string &token, std::string &message)=0
Saves the adapter's complete state.
virtual bool restoreState(const std::string &token, std::string &message)=0
Restores state previously saved by saveState().
virtual bool releaseState(const std::string &token, std::string &message)=0
Releases a state saved by saveState() that will not be restored.
virtual ~ICheckpointableAdaptedOutput()=default
~ICheckpointableAdaptedOutput destructor.
ICheckpointableModelComponent is an IModelComponent that can save and restore its complete simulation...
Definition hydrocouple.h:1231
virtual bool releaseState(const std::string &token, std::string &message)=0
Releases a state saved by saveState() that will not be restored.
virtual bool restoreState(const std::string &token, std::string &message)=0
Restores state previously saved by saveState().
virtual bool saveState(std::string &token, std::string &message)=0
Saves the component's complete state.
virtual ~ICheckpointableModelComponent()=default
~ICheckpointableModelComponent destructor.
The ICloneableModelComponent class is an IModelComponent that supports deep cloning of itself and its...
Definition hydrocouple.h:1174
virtual std::unique_ptr< ICloneableModelComponent > clone(const std::unordered_map< std::string, std::string > &clone_optional_arguments=std::unordered_map< std::string, std::string >())=0
Deep clones itself including cloning its IArgument instances.
virtual std::vector< ICloneableModelComponent * > clones() const =0
The ICloneableModelComponent instances cloned from this instance that are still alive.
virtual ICloneableModelComponent * parent() const =0
Parent ICloneableModelComponent object from which current component was cloned from.
virtual ~ICloneableModelComponent()=default
~ICloneableModelComponent destructor
IComponentDataItem is a fundamental unit of data for a component.
Definition hydrocouple.h:1844
virtual std::vector< int64_t > shape() const =0
The extent of each dimension of this data item's index space.
virtual IModelComponent * modelComponent() const =0
Gets the owner IModelComponent of this IComponentItem.
virtual std::vector< IDimension * > dimensions() const =0
The axes of this item's index space, in storage order.
virtual ~IComponentDataItem()=default
IComponentDataItem::~IComponentDataItem is a virtual destructor.
virtual bool getValuesInto(const BufferDescriptor &destination, std::span< const int64_t > start, std::span< const int64_t > count, std::string *message=nullptr) const =0
Copies a hyperslab of this item's values into a caller-described buffer.
virtual DataKind dataKind() const =0
The element type of this data item's values.
virtual bool setValuesFrom(const BufferDescriptor &source, std::span< const int64_t > start, std::span< const int64_t > count, std::string *message=nullptr)=0
Copies values from a caller-described buffer into a hyperslab of this item.
virtual IValueDefinition * valueDefinition() const =0
IValueDefinition for this IComponentDataItem defines the variable type associated with this object.
IComponentDataItemValueChanged interface class used to notify when the values of a IComponentDataItem...
Definition hydrocouple.h:1950
virtual std::vector< int64_t > start() const =0
Gets the start index of the hyperslab that changed.
virtual ~IComponentDataItemValueChanged()=default
IComponentDataItemValueChanged::~IComponentDataItemValueChanged is a virtual destructor.
virtual IComponentDataItem * componentDataItem() const =0
Gets the IComponentDataItem that fired the event.
virtual std::vector< int64_t > count() const =0
Gets the extent of the hyperslab that changed.
IComponentInfo interface class is a factory that provides detailed metadata about a component and cre...
Definition hydrocouple.h:505
virtual std::string license() const =0
Component license info.
virtual std::string email() const =0
Component developer email.
virtual std::string developer() const =0
Component developer information.
virtual std::string url() const =0
Component developer url.
virtual std::string copyright() const =0
Component copyright info.
virtual std::vector< std::string > documentation() const =0
Documentation associated with this component.
virtual std::string iconFilePath() const =0
File path to Component icon.
virtual std::set< std::string > tags() const =0
tags used to classify this component.
virtual ~IComponentInfo()=default
IComponentInfo::~IComponentInfo is a virtual destructor.
virtual void setLibraryFilePath(const std::string &filePath)=0
Sets file path to Component library.
virtual std::string libraryFilePath() const =0
File path to Component library.
virtual std::string version() const =0
Component version info.
The IComponentStatusChangeEventArgs contains the information that will be passed when the IModelCompo...
Definition hydrocouple.h:1125
virtual IModelComponent * component() const =0
Gets the IModelComponent that fired the event.
virtual IModelComponent::ComponentStatus status() const =0
Gets the IModelComponent's status after the status change.
virtual float percentProgress() const =0
Number between 0 and 100 indicating the progress made by a component in its simulation.
virtual std::string message() const =0
Gets additional information about the status change.
virtual IModelComponent::ComponentStatus previousStatus() const =0
Gets the IModelComponent's status before the status change.
virtual ~IComponentStatusChangeEventArgs()=default
~IComponentStatusChangeEventArgs destructor
virtual bool hasProgressMonitor() const =0
Indicates whether this event has a progress monitor.
IDescription interface class provides descriptive information on a HydroCouple object.
Definition hydrocouple.h:434
virtual void setCaption(const std::string &caption)=0
Sets caption for the entity.
virtual ~IDescription()=default
IDescription::~IDescription is a virtual destructor.
virtual const std::string & caption() const =0
Gets caption for the entity.
virtual void setDescription(const std::string &description)=0
Gets additional descriptive information for the entity.
virtual const std::string & description() const =0
Gets additional descriptive information for the entity.
IDifferentiableAdaptedOutput is an adapted output that can report the derivative of its most recent r...
Definition hydrocouple.h:2421
virtual std::vector< IArgument * > differentiableArguments() const =0
The arguments of this adapter a derivative reaches (may be empty).
virtual std::vector< IComponentDataItem * > differentiableStates() const =0
The data items that carry state from one refresh() to the next and that the derivative follows; a sub...
virtual ~IDifferentiableAdaptedOutput()=default
~IDifferentiableAdaptedOutput destructor.
virtual bool jvp(DifferentialSet seeds, DifferentialSet results, std::string *message=nullptr)=0
Jacobian-vector product of the most recent refresh().
virtual bool vjp(DifferentialSet seeds, DifferentialSet results, std::string *message=nullptr)=0
Vector-Jacobian product of the most recent refresh().
IDifferentiableModelComponent is a model component that can report the derivative of its most recent ...
Definition hydrocouple.h:1351
virtual bool vjp(DifferentialSet seeds, DifferentialSet results, std::string *message=nullptr)=0
Vector-Jacobian product of the most recent step (reverse mode).
virtual std::vector< IArgument * > differentiableArguments() const =0
The arguments (parameters) a derivative reaches.
virtual std::vector< IOutput * > differentiableOutputs() const =0
The outputs whose derivative the component can report.
virtual std::vector< IComponentDataItem * > differentiableStates() const =0
The data items that make up the state carried from one step to the next.
virtual ~IDifferentiableModelComponent()=default
~IDifferentiableModelComponent destructor.
virtual std::vector< IInput * > differentiableInputs() const =0
The inputs a derivative reaches.
virtual bool jvp(DifferentialSet seeds, DifferentialSet results, std::string *message=nullptr)=0
Jacobian-vector product of the most recent step (forward mode).
IDimension provides the properties of one axis of a data item's index space.
Definition hydrocouple.h:1494
virtual ~IDimension()=default
~IDimension destructor
LengthType
IDimension::LengthType dimension length type.
Definition hydrocouple.h:1500
@ Static
Static length type.
Definition hydrocouple.h:1504
@ Dynamic
Dynamic length type.
Definition hydrocouple.h:1509
virtual DimensionRole role() const =0
What this axis means.
DimensionRole
What an axis of the index space means.
Definition hydrocouple.h:1516
@ Column
Raster columns / structured-grid x index.
Definition hydrocouple.h:1523
@ Entity
Spatial entities: geometries, mesh nodes/edges/faces, network nodes/edges, or the identifiers of an i...
Definition hydrocouple.h:1519
@ Component
Vector or tensor components (Spatial::SpatialDataType).
Definition hydrocouple.h:1525
@ Layer
Vertical layers (Spatial::ILayering), top first.
Definition hydrocouple.h:1520
@ Other
Declared but none of the above.
Definition hydrocouple.h:1527
@ Depth
Structured-grid z index (IRegularGrid3D).
Definition hydrocouple.h:1524
@ Band
Raster bands.
Definition hydrocouple.h:1521
@ Unknown
Not declared.
Definition hydrocouple.h:1517
@ Row
Raster rows / structured-grid y index.
Definition hydrocouple.h:1522
@ Time
Time steps (Temporal::ITimeSeriesComponentDataItem::times()).
Definition hydrocouple.h:1518
@ Realization
Ensemble members.
Definition hydrocouple.h:1526
virtual LengthType lengthType() const =0
Gets the length type of the dimension.
IExchangeItem the base data item the can be exchanged between components at runtime.
Definition hydrocouple.h:2151
virtual ~IExchangeItem()=default
IExchangeItem::~IExchangeItem is a virtual destructor.
IIdBasedComponentDataItem is an IComponentDataItem whose data is indexed by string identifiers.
Definition hydrocouple.h:2738
virtual std::vector< std::string > identifiers() const =0
Gets the identifiers associated with this id-based component data item.
virtual ~IIdBasedComponentDataItem()=default
IIdBasedComponentItem::~IIdBasedComponentItem is a virtual destructor.
virtual IDimension * identifierDimension() const =0
identifierDimension returns the identifier dimension of the id based component item.
IIdentity interface class defines a method to get the Id of an HydroCouple entity.
Definition hydrocouple.h:476
virtual ~IIdentity()=default
IIdentity::~IIdentity is a virtual destructor.
virtual const std::string & id() const =0
Gets a unique identifier for the entity.
ILicensedComponent is an optional side interface for components that require license validation.
Definition hydrocouple.h:593
virtual bool validateLicense(std::string &validationMessage)=0
validateLicense Checks if component is licensed and returns.
virtual bool validateLicense(const std::string &licenseInfo, std::string &validationMessage)=0
Checks if license is valid and persists license information.
virtual ~ILicensedComponent()=default
ILicensedComponent::~ILicensedComponent is a virtual destructor.
IModelComponent interface is the core interface in the HydroCouple standard defining a model componen...
Definition hydrocouple.h:696
virtual void setWorkflow(const IWorkflowComponent *workflow)=0
Sets the workflow that this component is part of.
virtual std::vector< IComponentDataItem * > states() const =0
The data items that make up the state carried from one update() to the next.
virtual void finish()=0
finish() must be invoked as the last of any methods in the IModelComponent interface.
virtual std::vector< IComponentDataItem * > results() const =0
List of the model's output results.
virtual void initialize()=0
Initializes the current IModelComponent.
virtual std::vector< ErrorEntry > errors(bool clearAfterRead=false)=0
Drains this component's diagnostic queue.
virtual std::string referenceDirectory() const =0
Gets the reference directory for this component instance.
virtual IModelComponentInfo * componentInfo() const =0
Contains the metadata about this IModelComponent instance.
virtual void setReferenceDirectory(const std::string &referenceDirectory)=0
setReferenceDirectory Sets the reference directory for this component instance.
virtual void update(const std::vector< IOutput * > &requiredOutputs={})=0
This method is called to let the component update itself, thus reaching its next state.
virtual void prepare()=0
Prepares the IModelComponent for calls to the update() method.
virtual std::vector< IArgument * > arguments() const =0
Arguments needed to let the component do its work.
ComponentStatus
HydroCouple::ComponentStatus is an enumerator that describes the status of a component over the cours...
Definition hydrocouple.h:707
@ Checkpointing
The IModelComponent is saving or restoring a checkpoint of its state (see ICheckpointableModelCompone...
Definition hydrocouple.h:792
@ Created
The IModelComponent instance has just been created.
Definition hydrocouple.h:712
@ Finishing
The IModelComponent was requested to perform the actions to be performed before it will either be dis...
Definition hydrocouple.h:807
@ WaitingForData
The IModelComponent wants to update itself, but is not yet able to perform the actual computation,...
Definition hydrocouple.h:751
@ Initializing
The IModelComponent is initializing itself.
Definition hydrocouple.h:718
@ Valid
The IModelComponent is in a HydroCouple::Valid state.
Definition hydrocouple.h:744
@ Invalid
The IModelComponent is in an HydroCouple::Invalid state.
Definition hydrocouple.h:761
@ Initialized
The IModelComponent has successfully initialized itself by calling IModelComponent::initialize().
Definition hydrocouple.h:726
@ Updating
The IModelComponent is updating itself.
Definition hydrocouple.h:779
@ Finished
The IModelComponent has successfully performed its finalization actions.
Definition hydrocouple.h:824
@ Preparing
The IModelComponent is preparing itself for the first update() and the first IComponentDataItem::getV...
Definition hydrocouple.h:770
@ Validating
After links between an IModelComponent's inputs/outputs and those of other components have been estab...
Definition hydrocouple.h:737
@ Failed
The IModelComponent has encountered an unrecoverable error.
Definition hydrocouple.h:833
@ Done
The last update process that the IModelComponent performed was the final one.
Definition hydrocouple.h:798
@ Updated
The IModelComponent has successfully updated itself.
Definition hydrocouple.h:784
virtual std::vector< std::string > validate()=0
Validates the populated instance of the IModelComponent.
virtual std::set< Capability > capabilities() const =0
The set of optional capabilities this component supports.
virtual const IWorkflowComponent * workflow() const =0
Gets the workflow that this component is part of.
virtual ComponentStatus status() const =0
Defines current status of the IModelComponent.
virtual ~IModelComponent()=default
IModelComponent::~IModelComponent destructor.
virtual std::vector< IInput * > inputs() const =0
The list of consumer items for which a component can receive values.
virtual std::vector< IOutput * > outputs() const =0
The list of IOutputs for which a component can produce results.
IModelComponentInfo interface inherits from the IComponentInfo interface which provides detailed meta...
Definition hydrocouple.h:665
virtual ~IModelComponentInfo()=default
IModelComponentInfo::~IModelComponentInfo is a virtual destructor.
virtual std::unique_ptr< IModelComponent > createComponentInstance()=0
Creates a new IModelComponent instance.
virtual std::vector< IAdaptedOutputFactory * > adaptedOutputFactories() const =0
Gets a list of IAdaptedOutputFactories, each allowing to create IAdaptedOutput item for making output...
An output exchange item that can deliver values from an IModelComponent.
Definition hydrocouple.h:2169
virtual ~IOutput()=default
IOutput::~IOutput is a virtual destructor.
virtual void updateValues(const IInput *querySpecifier)=0
Brings this output's values up to what the querySpecifier requires.
virtual std::vector< IInput * > consumers() const =0
Input items that will consume the values by calling the IOutput::updateValues() method.
virtual bool removeConsumer(IInput *consumer)=0
Disconnects a consumer.
virtual void addConsumer(IInput *consumer, const IIdentity *providerRole=nullptr)=0
Connects a consumer to this output item.
virtual bool removeAdaptedOutput(IAdaptedOutput *adaptedOutput)=0
Removes an IAdaptedOutput.
virtual std::vector< IAdaptedOutput * > adaptedOutputs() const =0
The adaptedOutputs that have this current output item as adaptee.
virtual void addAdaptedOutput(IAdaptedOutput *adaptedOutput)=0
Add a IAdaptedOutput to this output item.
IPropertyChanged interface is used to emit signal/event when a property of an object changes.
Definition hydrocouple.h:417
virtual ~IPropertyChanged()=default
IPropertyChanged::~IPropertyChanged is a virtual destructor.
IQuality describes qualitative data, where a value is specified as one category within a number of pr...
Definition hydrocouple.h:1566
virtual bool isOrdered() const =0
Whether categories() has a defined order (ordinal) or not (nominal).
virtual std::vector< std::string > categories() const =0
The possible category labels allowed for this IQuality.
virtual ~IQuality()=default
IQuality::~IQuality is a virtual destructor.
IQuantity specifies values as an amount of some unit, usually as a floating point number.
Definition hydrocouple.h:1795
virtual double minValue() const =0
Gets the minimum allowed value for this quantity.
virtual ~IQuantity()=default
IQuantity::~IQuantity is a virtual destructor.
virtual IUnit * unit() const =0
Unit of quantity.
virtual double maxValue() const =0
Gets the maximum allowed value for this quantity.
Forward declarations.
Definition hydrocouple.h:379
virtual void connect(const std::shared_ptr< ISlot< Args... > > &slot)=0
connect is used to connect a slot to the signal.
virtual void disconnect(const std::shared_ptr< ISlot< Args... > > &slot)=0
disconnect is used to disconnect a slot from the signal.
virtual void blockSignals(bool block)=0
blockSignals is used to block signals from being emitted.
virtual ~ISignal()=default
ISignal::~ISignal is a virtual destructor.
virtual void emit(Args... args)=0
emit is used to emit the signal.
ISlot interface class must be implemented by classes that want to listen to signals.
Definition hydrocouple.h:356
virtual void operator()(const ISignal< Args... > &sender, Args... args)=0
operator() is the function call operator that is called when a signal is emitted.
virtual ~ISlot()=default
ISlot::~ISlot is a virtual destructor.
IUIProvider is an optional side interface for entities that can present a graphical editor and/or vie...
Definition hydrocouple.h:625
virtual void showEditor(void *opaqueUIPointer=nullptr)=0
showEditor shows the editor for this entity.
virtual bool hasViewer() const =0
hasViewer indicates whether this entity has a UI viewer.
virtual void showViewer(void *opaqueUIPointer=nullptr)=0
showViewer shows the viewer for this entity.
virtual bool hasEditor() const =0
hasEditor indicates whether this entity has a UI editor.
virtual ~IUIProvider()=default
IUIProvider::~IUIProvider is a virtual destructor.
Defines the order of dimension in each FundamentalDimension for a unit.
Definition hydrocouple.h:1595
virtual ~IUnitDimensions()=default
IUnitDimensions::~IUnitDimensions is a virtual destructor.
virtual double power(HydroCouple::IUnitDimensions::FundamentalUnitDimension dimension) const =0
Returns the power for the requested dimension.
FundamentalUnitDimension
HydroCouple::FundamentalUnitDimension are the fundamental units that can be combined to form all type...
Definition hydrocouple.h:1601
@ Currency
Fundamental dimension for currency.
Definition hydrocouple.h:1640
@ Unitless
Fundamental dimension for unitless quantities (all powers zero).
Definition hydrocouple.h:1647
@ ElectricCurrent
Fundamental dimension for electric current.
Definition hydrocouple.h:1620
@ Time
Fundamental dimension for time.
Definition hydrocouple.h:1615
@ Length
Fundamental dimension for length.
Definition hydrocouple.h:1605
@ AmountOfSubstance
Fundamental dimension for amount of substance.
Definition hydrocouple.h:1630
@ LuminousIntensity
Fundamental dimension for luminous intensity.
Definition hydrocouple.h:1635
@ Temperature
Fundamental dimension for temperature.
Definition hydrocouple.h:1625
@ PlaneAngle
Fundamental dimension for plane angle (radian).
Definition hydrocouple.h:1655
@ Mass
Fundamental dimension for mass.
Definition hydrocouple.h:1610
IUnit interface, describing the physical unit of a IQuantity.
Definition hydrocouple.h:1690
virtual std::string symbol() const =0
The unit as a UDUNITS-2 string, e.g.
DistanceUnits
HydroCouple::DistanceUnits are the types of units that can be used to measure distance.
Definition hydrocouple.h:1696
@ Feet
Feet.
Definition hydrocouple.h:1711
@ Centimeters
Centimeters.
Definition hydrocouple.h:1736
@ Millimeters
Millimeters.
Definition hydrocouple.h:1741
@ Miles
Miles.
Definition hydrocouple.h:1726
@ Meters
Meters.
Definition hydrocouple.h:1701
@ Unknown
Unknown.
Definition hydrocouple.h:1751
@ Yards
Yards.
Definition hydrocouple.h:1721
@ Degrees
Degrees (angular; only meaningful for geographic reference systems).
Definition hydrocouple.h:1731
@ Inches
Inches.
Definition hydrocouple.h:1746
@ NauticalMiles
NauticalMiles.
Definition hydrocouple.h:1716
@ Kilometers
Kilometers.
Definition hydrocouple.h:1706
virtual double offsetToSI() const =0
OffSet to SI ('B' in: SI-value = A * quant-value + B).
virtual IUnitDimensions * dimensions() const =0
Fundamental dimensions of the unit.
virtual std::string ucumCode() const =0
The unit as a case-sensitive UCUM code, e.g.
virtual double conversionFactorToSI() const =0
Conversion factor to SI ('A' in: SI-value = A * quant-value + B)
virtual ~IUnit()=default
IUnit::~IUnit is a virtual destructor.
IValueDefinition describes the type and properties of values held by an IComponentDataItem.
Definition hydrocouple.h:1431
virtual ValueKind valueKind() const =0
How values of this definition behave under regridding and aggregation.
virtual std::string standardName() const =0
The CF standard name of the quantity these values measure.
virtual double defaultValue() const =0
Gets the default value for this value definition.
virtual std::string conceptURI() const =0
An absolute URI naming the quantity in a published vocabulary.
virtual double missingValue() const =0
The value representing that data is missing.
virtual ~IValueDefinition()=default
~IValueDefinition destructor
IWorkflowComponent manages the execution workflow for a set of coupled IModelComponent instances.
Definition hydrocouple.h:2791
virtual ~IWorkflowComponent()=default
~IWorkflowComponent destructor for IWorkflowComponent class.
virtual std::vector< IModelComponent * > modelComponents() const =0
Gets the model components managed by this workflow.
virtual void update()=0
Performs one orchestration step.
virtual bool addModelComponent(IModelComponent *component, const IIdentity *modelRoleIdentifier=nullptr, std::string *message=nullptr)=0
addModelComponent Adds model component instance to workflow
virtual WorkflowStatus status() const =0
Gets the current status of the workflow component.
virtual std::vector< IIdentity * > modelComponentLabels() const =0
requiredModelComponentIdentifiers returns the vector of IModelComponent identifiers that are required...
virtual void resume()=0
Resumes a paused workflow.
virtual void initialize()=0
Initializes the workflow component.
virtual void requestPause()=0
Requests a cooperative pause of the workflow.
virtual std::vector< ErrorEntry > errors(bool clearAfterRead=false)=0
Drains this workflow's diagnostic queue.
virtual IWorkflowComponentInfo * componentInfo() const =0
Gets the metadata information about this workflow component.
virtual void prepare()=0
Prepares the composition for computation.
virtual bool removeModelComponent(IModelComponent *component)=0
removeModelComponent Removes model component instance from workflow
WorkflowStatus
The WorkflowStatus enum describes the status of a workflow component over the course of its lifetime.
Definition hydrocouple.h:2801
@ Created
The workflow component has just been created.
Definition hydrocouple.h:2803
@ Finishing
The workflow component is finalizing and releasing resources.
Definition hydrocouple.h:2825
@ Initializing
The workflow component is initializing itself.
Definition hydrocouple.h:2805
@ Invalid
The workflow component found problems in the composition; fix the composition and validate() again.
Definition hydrocouple.h:2831
@ Prepared
The workflow component has prepared the composition and can begin updating.
Definition hydrocouple.h:2815
@ Validated
The workflow component found the composition valid and ready to prepare.
Definition hydrocouple.h:2811
@ Initialized
The workflow component has successfully initialized.
Definition hydrocouple.h:2807
@ Updating
The workflow component is performing an update step.
Definition hydrocouple.h:2817
@ Finished
The workflow component has finished and cannot be restarted.
Definition hydrocouple.h:2827
@ Preparing
The workflow component is preparing the composition for computation (e.g., driving IModelComponent::p...
Definition hydrocouple.h:2813
@ Validating
The workflow component is validating the composition (cross-component links, required roles).
Definition hydrocouple.h:2809
@ Failed
The workflow component encountered an unrecoverable error.
Definition hydrocouple.h:2829
@ Paused
The workflow component is paused at a synchronization point (see requestPause()) and can be resumed.
Definition hydrocouple.h:2821
@ Done
The workflow component has completed all update steps.
Definition hydrocouple.h:2823
@ Updated
The workflow component has successfully updated.
Definition hydrocouple.h:2819
virtual void finish()=0
Finalizes the workflow component and releases resources.
virtual void requestStop()=0
Requests a cooperative stop of the workflow.
virtual bool isRequiredModelComponent(const IIdentity *modelComponentLabel) const =0
isRequiredModelComponent checks if the model component is required by this component.
virtual std::vector< std::string > validate()=0
Validates the composition as a whole before computation begins.
IWorkflowComponentInfo provides metadata about an IWorkflowComponent and creates new instances of it.
Definition hydrocouple.h:2767
virtual std::unique_ptr< IWorkflowComponent > createComponentInstance()=0
Creates a new IWorkflowComponent instance.
virtual ~IWorkflowComponentInfo()=default
~IWorkflowComponentInfo
The IWorkflowComponentStatusChangeEventArgs contains the information that will be passed when the IWo...
Definition hydrocouple.h:3016
virtual IWorkflowComponent::WorkflowStatus status() const =0
Gets the IWorkflowComponent's status after the status change.
virtual IWorkflowComponent * workflowComponent() const =0
Gets the IWorkflowComponent that fired the event.
virtual ~IWorkflowComponentStatusChangeEventArgs()=default
~IWorkflowComponentStatusChangeEventArgs destructor
virtual IWorkflowComponent::WorkflowStatus previousStatus() const =0
Gets the IWorkflowComponent's status before the status change.
virtual float percentProgress() const =0
Number between 0 and 100 indicating the progress made by the workflow component.
virtual bool hasProgressMonitor() const =0
Indicates whether this event has a progress monitor.
virtual std::string message() const =0
Gets additional information about the status change.
HydroCouple namespace contains the core interface specifications for the HydroCouple component-based ...
Definition hydrocouple.h:54
constexpr int HYDROCOUPLE_ABI_VERSION
ABI version for the HydroCouple interface.
Definition hydrocouple.h:71
DataKind
DataKind identifies the element type of a typed data buffer.
Definition hydrocouple.h:199
@ Float32
float
Definition hydrocouple.h:209
@ String
std::string (host memory only)
Definition hydrocouple.h:212
@ Boolean
bool (stored one element per byte)
Definition hydrocouple.h:211
@ Int16
int16_t
Definition hydrocouple.h:203
@ Int8
int8_t
Definition hydrocouple.h:201
@ Unknown
No/unknown element type.
Definition hydrocouple.h:200
@ UInt16
uint16_t
Definition hydrocouple.h:204
@ UInt64
uint64_t
Definition hydrocouple.h:208
@ UInt8
uint8_t
Definition hydrocouple.h:202
@ Int32
int32_t
Definition hydrocouple.h:205
@ Float64
double
Definition hydrocouple.h:210
@ UInt32
uint32_t
Definition hydrocouple.h:206
@ Opaque
Implementation-defined bytes; meaning agreed out of band, size in BufferDescriptor::itemSizeBytes.
Definition hydrocouple.h:213
@ Int64
int64_t
Definition hydrocouple.h:207
std::span< const DifferentialEntry > DifferentialSet
DifferentialSet is a non-owning view of DifferentialEntry records.
Definition hydrocouple.h:1315
MemorySpace
MemorySpace identifies where a buffer's bytes physically live.
Definition hydrocouple.h:223
@ Unified
Unified/managed memory accessible from host and device.
Definition hydrocouple.h:227
@ HostPinned
Page-locked host memory (fast staging to/from devices).
Definition hydrocouple.h:225
@ Host
Ordinary pageable host memory.
Definition hydrocouple.h:224
@ Device
Accelerator-resident memory addressed by (backend, deviceId).
Definition hydrocouple.h:226
ValueKind
How a value behaves when it is regridded or aggregated.
Definition hydrocouple.h:1413
@ Flux
Per unit area and time.
Definition hydrocouple.h:1417
@ Extensive
Proportional to extent — mass, volume, heat content.
Definition hydrocouple.h:1416
@ Density
Per unit volume.
Definition hydrocouple.h:1418
@ Intensive
Independent of extent — temperature, concentration, elevation.
Definition hydrocouple.h:1415
ByteOrder
The ByteOrder enum class indicates the byte order of serialized data.
Definition hydrocouple.h:77
@ BigEndian
BigEndian serialized data byte order (most significant byte first).
Definition hydrocouple.h:82
@ LittleEndian
LittleEndian serialized data byte order (least significant byte first).
Definition hydrocouple.h:87
DifferentialRole
DifferentialRole says which side of a component's step a derivative buffer belongs to.
Definition hydrocouple.h:1288
@ Argument
An IArgument of the component (a parameter of the step).
Definition hydrocouple.h:1290
@ Output
An IOutput of the component, as produced by the step.
Definition hydrocouple.h:1291
@ Input
An IInput of the component, as consumed by the step.
Definition hydrocouple.h:1289
@ StateAfter
The same state item's value at the end of the step.
Definition hydrocouple.h:1293
@ StateBefore
A state item's value at the start of the step.
Definition hydrocouple.h:1292
DeviceBackend
DeviceBackend identifies the runtime that owns a device-resident buffer.
Definition hydrocouple.h:238
@ SYCL
SYCL (any implementation).
Definition hydrocouple.h:242
@ HIP
AMD HIP/ROCm runtime.
Definition hydrocouple.h:241
@ Other
An implementation-defined runtime both endpoints agree on.
Definition hydrocouple.h:245
@ None
Host memory; no device runtime involved.
Definition hydrocouple.h:239
@ OpenCL
OpenCL.
Definition hydrocouple.h:244
@ CUDA
NVIDIA CUDA runtime.
Definition hydrocouple.h:240
@ LevelZero
Intel oneAPI Level Zero.
Definition hydrocouple.h:243
Capability
Capability identifies an optional behavior a component may support.
Definition hydrocouple.h:310
@ Checkpointing
Component implements ICheckpointableModelComponent.
Definition hydrocouple.h:314
@ Licensing
Component implements ILicensedComponent.
Definition hydrocouple.h:317
@ DeviceBuffers
Data items can produce/accept Device/Unified BufferDescriptors.
Definition hydrocouple.h:311
@ PartitionedData
Component exposes IPartitionedComponentDataItem items (see hydrocoupledistributed....
Definition hydrocouple.h:312
@ Cloneable
Component implements ICloneableModelComponent.
Definition hydrocouple.h:315
@ LayeredData
Component exposes data items implementing Spatial::ILayering.
Definition hydrocouple.h:319
@ DistributedExecution
Component implements IDistributedModelComponent.
Definition hydrocouple.h:313
@ UserInterface
Component implements IUIProvider.
Definition hydrocouple.h:316
@ Differentiable
Component implements IDifferentiableModelComponent.
Definition hydrocouple.h:318
@ VendorBase
First value of the vendor-reserved range (0x80000000).
Definition hydrocouple.h:320
BufferDescriptor describes a typed, possibly strided, possibly device-resident multi-dimensional arra...
Definition hydrocouple.h:279
void * queue
Opaque backend stream/queue for asynchronous transfers; nullptr => default stream,...
Definition hydrocouple.h:289
MemorySpace space
Memory space holding the bytes.
Definition hydrocouple.h:286
int32_t deviceId
Device ordinal within the backend when space is Device/Unified.
Definition hydrocouple.h:288
DataKind kind
Element type.
Definition hydrocouple.h:281
const int64_t * stridesBytes
Byte step per dimension; nullptr => C-contiguous.
Definition hydrocouple.h:284
int64_t itemSizeBytes
Size of one element; 0 => the kind's natural size (illegal for Opaque).
Definition hydrocouple.h:285
int32_t rank
Number of dimensions; 0 denotes a scalar.
Definition hydrocouple.h:282
const int64_t * shape
Extent per dimension; length == rank.
Definition hydrocouple.h:283
DeviceBackend backend
Runtime owning the device memory when space is Device/Unified.
Definition hydrocouple.h:287
void * data
Base address of element (0, 0, ..., 0).
Definition hydrocouple.h:280
DifferentialEntry pairs one data item, in one role, with a buffer holding its tangent (forward mode) ...
Definition hydrocouple.h:1306
DifferentialRole role
Which side of the step.
Definition hydrocouple.h:1308
BufferDescriptor value
The tangent or cotangent buffer.
Definition hydrocouple.h:1309
const IComponentDataItem * item
The item this derivative belongs to.
Definition hydrocouple.h:1307
ErrorEntry is one diagnostic record in a component's error queue.
Definition hydrocouple.h:330
std::string message
Human-readable description.
Definition hydrocouple.h:345
Severity severity
Severity of this record.
Definition hydrocouple.h:342
std::string source
Id of the originating entity.
Definition hydrocouple.h:344
Severity
Severity of an ErrorEntry.
Definition hydrocouple.h:335
@ Warning
Recoverable anomaly.
Definition hydrocouple.h:337
@ Fatal
Component is in the Failed state.
Definition hydrocouple.h:339
@ Error
Operation failed; component may continue.
Definition hydrocouple.h:338
@ Information
Informational message.
Definition hydrocouple.h:336
int32_t code
Implementation-defined error code.
Definition hydrocouple.h:343