HydroCouple  2.0.0
HydroCouple Interface Definitions
Loading...
Searching...
No Matches
hydrocouple.h
Go to the documentation of this file.
1
23#ifndef HYDROCOUPLE_H
24#define HYDROCOUPLE_H
25
26#include <variant>
27#include <string>
28#include <array>
29#include <vector>
30#include <any>
31#include <functional>
32#include <list>
33#include <set>
34#include <memory>
35
36using namespace std;
37
42{
43
48
52 LittleEndian = 1
53};
54
59namespace HydroCouple
60{
62 template <typename... Args>
63 class ISignal;
64 class IModelComponent;
66 class IArgument;
67 class IInput;
68 class IOutput;
69 class IExchangeItem;
70 class IAdaptedOutput;
73 class IUnit;
77
81 typedef variant<
82 bool,
83 char,
84 short,
85 int,
86 long,
87 unsigned char,
88 unsigned short,
89 unsigned int,
90 unsigned long,
91 float,
92 double,
93 long double,
94 string,
95 void *>
97
104 template <typename... Args>
105 class ISlot
106 {
107 public:
111 virtual ~ISlot() = default;
112
118 virtual void operator()(const ISignal<Args...> &sender, Args... args) = 0;
119 };
120
127 template <typename... Args>
129 {
130 public:
134 virtual ~ISignal() = default;
135
140 virtual void connect(const shared_ptr<ISlot<Args...>> &slot) = 0;
141
146 virtual void disconnect(const shared_ptr<ISlot<Args...>> &slot) = 0;
147
152 virtual void blockSignals(bool block) = 0;
153
154 protected:
159 virtual void emit(Args... args) = 0;
160 };
161
166 class IPropertyChanged : public virtual ISignal<string>
167 {
168
169 public:
173 virtual ~IPropertyChanged() = default;
174 };
175
183 class IDescription : public virtual IPropertyChanged
184 {
185
186 public:
190 virtual ~IDescription() = default;
191
197 virtual string caption() const = 0;
198
204 virtual void setCaption(const string &caption) = 0;
205
211 virtual string description() const = 0;
212
218 virtual void setDescription(const string &description) = 0;
219 };
220
225 class IIdentity : public virtual IDescription
226 {
227 public:
231 virtual ~IIdentity() = default;
232
243 virtual string id() const = 0;
244 };
245
254 class IComponentInfo : public virtual IIdentity
255 {
256
257 public:
261 virtual ~IComponentInfo() = default;
262
268 virtual string libraryFilePath() const = 0;
269
275 virtual void setLibraryFilePath(const string &filePath) = 0;
276
283 virtual string iconFilePath() const = 0;
284
289 virtual string developer() const = 0;
290
295 virtual list<string> documentation() const = 0;
296
301 virtual string license() const = 0;
302
307 virtual string copyright() const = 0;
308
313 virtual string url() const = 0;
314
319 virtual string email() const = 0;
320
325 virtual string version() const = 0;
326
332 virtual set<string> tags() const = 0;
333
341 virtual bool validateLicense(const string &licenseInfo, string &validationMessage) = 0;
342
348 virtual bool validateLicense(string &validationMessage) = 0;
349 };
350
358 class IModelComponentInfo : public virtual IComponentInfo
359 {
360
361 public:
365 virtual ~IModelComponentInfo() = default;
366
372
383 virtual vector<IAdaptedOutputFactory *> adaptedOutputFactories() const = 0;
384 };
385
389 class IModelComponent : public virtual IIdentity, public virtual ISignal<const shared_ptr<IComponentStatusChangeEventArgs> &>
390 {
391
392 public:
506
510 virtual ~IModelComponent() = default;
511
516 virtual IModelComponentInfo *componentInfo() const = 0;
517
526 virtual ComponentStatus status() const = 0;
527
542 virtual vector<IArgument *> arguments() const = 0;
543
558 virtual vector<IInput *> inputs() const = 0;
559
579 virtual vector<IOutput *> outputs() const = 0;
580
585 virtual vector<IComponentDataItem *> results() const = 0;
586
610 virtual void initialize() = 0;
611
636 virtual vector<string> validate() = 0;
637
659 virtual void prepare() = 0;
660
685 virtual void update(const initializer_list<IOutput *> &requiredOutputs = {}) = 0;
686
699 virtual void finish() = 0;
700
705 virtual const IWorkflowComponent *workflow() const = 0;
706
711 virtual void setWorkflow(const IWorkflowComponent *workflow) = 0;
712
717 virtual int mpiNumOfProcesses() const = 0;
718
723 virtual int mpiProcessRank() const = 0;
724
729 virtual void mpiSetProcessRank(int processRank) = 0;
730
735 virtual set<int> mpiAllocatedProcesses() const = 0;
736
745 virtual void mpiAllocateProcesses(const set<int> &mpiProcessesToAllocate) = 0;
746
750 virtual void mpiClearAllocatedProcesses() = 0;
751
760 virtual string referenceDirectory() const = 0;
761
766 virtual void setReferenceDirectory(const string &referenceDirectory) = 0;
767
772 virtual bool hasEditor() const = 0;
773
778 virtual void showEditor(void *opaqueUIPointer = nullptr) = 0;
779
784 virtual bool hasViewer() const = 0;
785
790 virtual void showViewer(void *opaqueUIPointer = nullptr) = 0;
791 };
792
797 {
798
799 public:
803 virtual ~IProxyModelComponent() = default;
804
809 virtual int parentMpiProcessRank() const = 0;
810
815 virtual string parentProcessAddress() const = 0;
816
821 virtual string parentId() const = 0;
822 };
823
830 {
831 public:
836
841 virtual IModelComponent *component() const = 0;
842
848
854
858 virtual string message() const = 0;
859
864 virtual bool hasProgressMonitor() const = 0;
865
870 virtual float percentProgress() const = 0;
871 };
872
877 {
878 public:
882 virtual ~ICloneableModelComponent() = default;
883
888 virtual ICloneableModelComponent *parent() const = 0;
889
898 virtual ICloneableModelComponent *clone(const unordered_map<string, hydrocouple_variant> &clone_optional_arguments = unordered_map<string, hydrocouple_variant>()) = 0;
899
904 virtual vector<ICloneableModelComponent *> clones() const = 0;
905 };
906
914 class IValueDefinition : public virtual IDescription
915 {
916 public:
920 virtual ~IValueDefinition() = default;
921
928 virtual type_info type() const = 0;
929
932
935 };
936
940 class IDimension : public virtual IIdentity
941 {
942 public:
947 {
952
956 Dynamic = 1
957 };
958
962 virtual ~IDimension() = default;
963
967 virtual LengthType lengthType() const = 0;
968 };
969
997 class IQuality : public virtual IValueDefinition
998 {
999 public:
1003 virtual ~IQuality() = default;
1004
1010 virtual set<hydrocouple_variant> categories() const = 0;
1011
1015 virtual bool isOrdered() const = 0;
1016 };
1017
1021 class IUnitDimensions : public virtual IDescription
1022 {
1023 public:
1074
1078 virtual ~IUnitDimensions() = default;
1079
1106 };
1107
1111 class IUnit : public virtual IDescription
1112 {
1113 public:
1118 {
1119 Standard,
1120 Geographic,
1121 Unknown
1122 };
1123
1127 enum class DistanceUnits
1128 {
1129
1133 Meters,
1134
1138 Kilometers,
1139
1143 Feet,
1144
1149
1153 Yards,
1154
1158 Miles,
1159
1163 Degrees,
1164
1169
1174
1178 Inches,
1179
1183 Unknown
1184 };
1185
1257
1261 virtual ~IUnit() = default;
1262
1266 virtual IUnitDimensions *dimensions() const = 0;
1267
1271 virtual double conversionFactorToSI() const = 0;
1272
1276 virtual double offsetToSI() const = 0;
1277 };
1278
1283 class IQuantity : public virtual IValueDefinition
1284 {
1285 public:
1289 virtual ~IQuantity() = default;
1290
1294 virtual IUnit *unit() const = 0;
1295
1300 virtual hydrocouple_variant minValue() const = 0;
1301
1306 virtual hydrocouple_variant maxValue() const = 0;
1307 };
1308
1315 class IComponentDataItem : public virtual IIdentity, public virtual ISignal<const shared_ptr<IComponentDataItemValueChanged> &>
1316 {
1317 public:
1321 virtual ~IComponentDataItem() = default;
1322
1332 virtual IModelComponent *modelComponent() const = 0;
1333
1340 virtual vector<IDimension *> dimensions() const = 0;
1341
1351 virtual int dimensionLength(const initializer_list<int> &dimensionIndexes = {}) const = 0;
1352
1357 virtual IValueDefinition *valueDefinition() const = 0;
1358
1365 virtual void getValue(
1366 hydrocouple_variant &data,
1367 const initializer_list<int> &dimensionIndexes) const = 0;
1368
1376 virtual void getValues(
1377 hydrocouple_variant *data,
1378 const initializer_list<int> &dimensionIndexes,
1379 const initializer_list<int> &dimensionLengths = {}) const = 0;
1380
1386 virtual void setValue(
1387 const hydrocouple_variant &data,
1388 const initializer_list<int> &dimensionIndexes) = 0;
1389
1397 virtual void setValues(
1398 const hydrocouple_variant *data,
1399 const initializer_list<int> &dimensionIndexes,
1400 const initializer_list<int> &dimensionLengths = {}) = 0;
1401
1406 virtual bool hasEditor() const = 0;
1407
1412 virtual void showEditor(void *opaqueUIPointer = nullptr) = 0;
1413
1418 virtual bool hasViewer() const = 0;
1419
1424 virtual void showViewer(void *opaqueUIPointer = nullptr) = 0;
1425 };
1426
1431 {
1432 public:
1437
1443
1448 virtual initializer_list<int> dimensionIndexes() const = 0;
1449
1454 virtual initializer_list<int> dimensionLengths() const = 0;
1455 };
1456
1463 class IArgument : public virtual IComponentDataItem
1464 {
1465
1466 public:
1471 {
1476
1481
1482 /*
1483 * \brief Enumeration indicating that the argument was read from a URL.
1484 */
1486
1491
1496
1502
1506 virtual ~IArgument() = default;
1507
1514 virtual bool isOptional() const = 0;
1515
1523 virtual bool isReadOnly() const = 0;
1524
1528 virtual string toString() const = 0;
1529
1534 virtual void saveData() = 0;
1535
1541 virtual list<string> fileFilters() const = 0;
1542
1546 virtual list<type_info> validComponentDataItemTypes() const = 0;
1547
1553 virtual bool isValidArgType(ArgumentInputType argType) const = 0;
1554
1560
1568 virtual bool initialize(const string &value, ArgumentInputType argType, string &message) = 0;
1569
1577 virtual bool initialize(const IComponentDataItem &componentDataItem, string &message) = 0;
1578 };
1579
1589 {
1590 public:
1595
1599 virtual IExchangeItem *exchangeItem() const = 0;
1600
1604 virtual string message() const = 0;
1605 };
1606
1612 class IExchangeItem : public virtual IComponentDataItem
1613 {
1614
1615 public:
1619 virtual ~IExchangeItem() = default;
1620 };
1621
1630 class IOutput : public virtual IExchangeItem
1631 {
1632 public:
1636 virtual ~IOutput() = default;
1637
1649 virtual vector<IInput *> consumers() const = 0;
1650
1664 virtual void addConsumer(IInput *consumer) = 0;
1665
1675 virtual bool removeConsumer(IInput *consumer) = 0;
1676
1686 virtual vector<IAdaptedOutput *> adaptedOutputs() const = 0;
1687
1700 virtual void addAdaptedOutput(IAdaptedOutput *adaptedOutput) = 0;
1701
1711 virtual bool removeAdaptedOutput(IAdaptedOutput *adaptedOutput) = 0;
1712
1727 virtual void updateValues(const IInput *querySpecifier) = 0;
1728 };
1729
1743 class IAdaptedOutput : public virtual IOutput
1744 {
1745 public:
1749 virtual ~IAdaptedOutput() = default;
1750
1759
1768 virtual vector<IArgument *> arguments() const = 0;
1769
1780 virtual void initialize() = 0;
1781
1789 virtual IOutput *adaptee() const = 0;
1790
1802 virtual void refresh() = 0;
1803 };
1804
1813 class IAdaptedOutputFactory : public virtual IIdentity
1814 {
1815 public:
1819 virtual ~IAdaptedOutputFactory() = default;
1820
1832 virtual vector<IIdentity *> getAvailableAdaptedOutputIds(const IOutput *provider, const IInput *consumer = nullptr) = 0;
1833
1845 virtual IAdaptedOutput *createAdaptedOutput(IIdentity *adaptedProviderId, IOutput *provider, IInput *consumer = nullptr) = 0;
1846 };
1847
1869
1876 {
1877 public:
1882
1889 };
1890
1894 class IInput : public virtual IExchangeItem
1895 {
1896 public:
1900 virtual ~IInput() = default;
1901
1905 virtual IOutput *provider() const = 0;
1906
1912 virtual bool setProvider(IOutput *provider) = 0;
1913
1920 virtual bool canConsume(IOutput *provider, string &message) const = 0;
1921 };
1922
1926 class IMultiInput : public virtual IInput
1927 {
1928 public:
1932 virtual ~IMultiInput() = default;
1933
1937 virtual vector<IIdentity *> providerLabels() const = 0;
1938
1944 virtual bool isRequiredProvider(const IIdentity *providerLabel) const = 0;
1945
1950 virtual vector<IOutput *> providers() const = 0;
1951
1959 virtual void canConsume(IOutput *provider, string &message, const IIdentity *providerRoleIdentifier = nullptr) const = 0;
1960
1966 virtual bool addProvider(IOutput *provider, const IIdentity *providerRoleIdentifier = nullptr) = 0;
1967
1972 virtual bool removeProvider(IOutput *provider) = 0;
1973 };
1974
1979 {
1980
1981 public:
1986
1990 virtual ~IIdBasedComponentDataItem() = default;
1991
1996 virtual vector<string> identifiers() const = 0;
1997
2003 virtual IDimension *identifierDimension() const = 0;
2004
2012 virtual void getValue(
2013 hydrocouple_variant &data,
2014 int idIndex,
2015 const initializer_list<int> &dimensionIndexes = {}) const = 0;
2016
2025 virtual void getValues(
2026 hydrocouple_variant *data,
2027 const initializer_list<int> &idIndexes,
2028 const initializer_list<int> &dimensionIndexes = {},
2029 const initializer_list<int> &dimensionLengths = {}) const = 0;
2030
2040 virtual void getValues(
2041 hydrocouple_variant *data,
2042 int idIndex,
2043 const initializer_list<int> &dimensionIndexes = {},
2044 int idIndexLength = 1,
2045 const initializer_list<int> &dimensionLengths = {}) const = 0;
2046
2054 virtual void setValue(
2055 const hydrocouple_variant &data,
2056 int idIndex,
2057 const initializer_list<int> &dimensionIndexes = {}) = 0;
2058
2068 virtual void setValues(
2069 const hydrocouple_variant *data,
2070 const initializer_list<int> &idIndexes,
2071 const initializer_list<int> &dimensionIndexes = {},
2072 const initializer_list<int> &dimensionLengths = {}) = 0;
2073
2083 virtual void setValues(
2084 const hydrocouple_variant *data,
2085 int idIndex,
2086 const initializer_list<int> &dimensionIndexes = {},
2087 int idIndexLength = 1,
2088 const initializer_list<int> &dimensionLengths = {}) = 0;
2089 };
2090
2095 {
2096
2097 public:
2101 virtual ~IWorkflowComponentInfo() = default;
2102
2108 };
2109
2113 class IWorkflowComponent : public virtual IIdentity, public virtual ISignal<const shared_ptr<IWorkflowComponentStatusChangeEventArgs> &>
2114 {
2115
2116 public:
2132
2136 virtual ~IWorkflowComponent() = default;
2137
2143
2148 virtual vector<IIdentity *> modelComponentLabels() const = 0;
2149
2155 virtual bool isRequiredModelComponent(const IIdentity *modelComponentLabel) const = 0;
2156
2160 virtual void initialize() = 0;
2161
2165 virtual void update() = 0;
2166
2170 virtual void finish() = 0;
2171
2176 virtual WorkflowStatus status() const = 0;
2177
2182 virtual vector<IModelComponent *> modelComponents() const = 0;
2183
2191 virtual bool addModelComponent(IModelComponent *component, const IIdentity *modelRoleIdentifier = nullptr) = 0;
2192
2198 virtual bool removeModelComponent(IModelComponent *component) = 0;
2199 };
2200
2206 {
2207 public:
2212
2218
2224
2230
2234 virtual string message() const = 0;
2235
2240 virtual bool hasProgressMonitor() const = 0;
2241
2246 virtual float percentProgress() const = 0;
2247 };
2248
2249}
2250
2251#endif // HYDROCOUPLE_H
IAdaptedOutputFactoryComponent is an IAdaptedOutputFactory generated from an IAdaptedOutputFactoryCom...
Definition hydrocouple.h:1876
virtual ~IAdaptedOutputFactoryComponent()=default
IAdaptedOutputFactoryComponent::~IAdaptedOutputFactoryComponent is a virtual destructor.
virtual IAdaptedOutputFactoryComponentInfo * componentInfo() const =0
Contains the metadata about the IModelComponent.
IAdaptedOutputFactoryComponentInfo interface class provides information about an IAdaptedOutputFactor...
Definition hydrocouple.h:1857
virtual ~IAdaptedOutputFactoryComponentInfo()=default
IAdaptedOutputFactoryComponentInfo::~IAdaptedOutputFactoryComponentInfo is a virtual destructor.
virtual IAdaptedOutputFactoryComponent * createComponentInstance()=0
New IAdaptedOutputFactoryComponent instance.
IAdaptedOutputFactory is used to create instances of IAdaptedProducerExchangeItems.
Definition hydrocouple.h:1814
virtual 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 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:1744
virtual IOutput * adaptee() const =0
IOutput that this IAdaptedOutput extracts content from. In the adapter design pattern,...
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 vector< IArgument * > arguments() const =0
IArgument represents input parameters needed for this IAdaptedOutput.
virtual void refresh()=0
Requests the IAdaptedOutput to refresh itself and perform any necessary calculations.
IArgument interface class used to set the arguments for components. They can be complex or simple mul...
Definition hydrocouple.h:1464
virtual list< type_info > validComponentDataItemTypes() const =0
Valid IComponentDataItem instance types that can be read by this argument.
virtual list< string > fileFilters() const =0
File type extensions that can be read by this IArgument.
virtual bool isValidArgType(ArgumentInputType argType) const =0
Boolean indicating whether this IArgument copy its values from a string.
virtual void saveData()=0
Writes data to files associated with this argument if they exist.
virtual bool initialize(const string &value, ArgumentInputType argType, string &message)=0
Reads values from a JSON string.
virtual ArgumentInputType currentArgumentInputType() const =0
argumentIOType
virtual bool isReadOnly() const =0
Defines whether the Values property may be edited.
virtual string toString() const =0
String/XML representation for this IArgument.
ArgumentInputType
Enumeration indicating the type of input for the argument.
Definition hydrocouple.h:1471
@ XML
Enumeration indicating that the argument was read from a file.
Definition hydrocouple.h:1490
@ URL
Enumeration indicating that the argument was read from a URL.
Definition hydrocouple.h:1495
@ File
Enumeration indicating that the argument was read from a file.
Definition hydrocouple.h:1480
@ MEMORY_OBJECT
Enumeration indicating that the argument was read from a memory object.
Definition hydrocouple.h:1500
@ JSON
Definition hydrocouple.h:1485
@ String
Enumeration indicating that the argument was read from string.
Definition hydrocouple.h:1475
virtual bool initialize(const IComponentDataItem &componentDataItem, string &message)=0
Reads values from an equivalent IComponentDataItem. IComponentDataItem has been used instead of IArgu...
virtual ~IArgument()=default
IArgument::~IArgument is a virtual destructor.
virtual bool isOptional() const =0
Specifies whether the argument is optional or not.
The ICloneableModelComponent class.
Definition hydrocouple.h:877
virtual ICloneableModelComponent * clone(const unordered_map< string, hydrocouple_variant > &clone_optional_arguments=unordered_map< string, hydrocouple_variant >())=0
Deep clones itself including cloning its Data::IArgument.
virtual ICloneableModelComponent * parent() const =0
Parent ICloneableModelComponent object from which current component was cloned from.
virtual vector< ICloneableModelComponent * > clones() const =0
A vector ICloneableModelComponent instances cloned from this IModelComponent instance.
virtual ~ICloneableModelComponent()=default
~ICloneableModelComponent destructor
IComponentItem is a fundamental unit of data for a component.
Definition hydrocouple.h:1316
virtual void setValue(const hydrocouple_variant &data, const initializer_list< int > &dimensionIndexes)=0
Sets a multi-dimensional array of values for given dimension indexes.
virtual bool hasViewer() const =0
hasViewer indicates whether this IComponentItem has a UI viewer.
virtual void showViewer(void *opaqueUIPointer=nullptr)=0
showViewer shows the viewer for this IComponentItem.
virtual void getValue(hydrocouple_variant &data, const initializer_list< int > &dimensionIndexes) const =0
Gets a multi-dimensional array of values for given dimension indexes and strides along each dimension...
virtual IModelComponent * modelComponent() const =0
Gets the owner IModelComponent of this IComponentItem. For an IOutput component item this is the comp...
virtual void showEditor(void *opaqueUIPointer=nullptr)=0
showEditor shows the editor for this IComponentItem.
virtual void getValues(hydrocouple_variant *data, const initializer_list< int > &dimensionIndexes, const initializer_list< int > &dimensionLengths={}) const =0
Gets a multi-dimensional array of values for given dimension indexes and strides along each dimension...
virtual bool hasEditor() const =0
hasEditor indicates whether this IComponentItem has a UI editor.
virtual vector< IDimension * > dimensions() const =0
provides purely descriptive information of the dimensions associated with this IComponentItem
virtual ~IComponentDataItem()=default
IComponentDataItem::~IComponentDataItem is a virtual destructor.
virtual void setValues(const hydrocouple_variant *data, const initializer_list< int > &dimensionIndexes, const initializer_list< int > &dimensionLengths={})=0
Sets a multi-dimensional array of values for given dimension indexes and strides along each dimension...
virtual int dimensionLength(const initializer_list< int > &dimensionIndexes={}) const =0
dimensionLength returns the length of the dimension specified by the given dimension indexes....
virtual IValueDefinition * valueDefinition() const =0
IValueDefinition for this IValueSet defines the variable type associated with this object.
IComponentDataItemValueChanged interface class used to notify when the values of a IComponentDataItem...
Definition hydrocouple.h:1431
virtual ~IComponentDataItemValueChanged()=default
IComponentDataItemValueChanged::~IComponentDataItemValueChanged is a virtual destructor.
virtual initializer_list< int > dimensionLengths() const =0
Gets the strides of the data that changed.
virtual initializer_list< int > dimensionIndexes() const =0
Gets the dimension indexes of the data that changed.
virtual IComponentDataItem * componentDataItem() const =0
Gets the IComponentDataItem that fired the event.
IComponentInfo interface class is a factory that provides detailed metadata about a component and cre...
Definition hydrocouple.h:255
virtual string url() const =0
Component developer url.
virtual set< string > tags() const =0
tags used to classify this component.
virtual void setLibraryFilePath(const string &filePath)=0
Sets file path to Component library.
virtual string version() const =0
Component version info.
virtual list< string > documentation() const =0
Documentation associated with this component.
virtual string iconFilePath() const =0
File path to Component icon. Must be specified relative to the component library.
virtual string email() const =0
Component developer email.
virtual string libraryFilePath() const =0
File path to Component library.
virtual ~IComponentInfo()=default
IComponentInfo::~IComponentInfo is a virtual destructor.
virtual bool validateLicense(const string &licenseInfo, string &validationMessage)=0
Checks if license is valid and persists license information.
virtual bool validateLicense(string &validationMessage)=0
validateLicense Checks if component is licensed and returns.
virtual string copyright() const =0
Component copyright info.
virtual string license() const =0
Component license info.
virtual string developer() const =0
Component developer information.
The IComponentStatusChangeEventArgs contains the information that will be passed when the IModelCompo...
Definition hydrocouple.h:830
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 IModelComponent::ComponentStatus previousStatus() const =0
Gets the IModelComponent's status before the status change.
virtual ~IComponentStatusChangeEventArgs()=default
~IComponentStatusChangeEventArgs destructor
virtual bool hasProgressMonitor() const =0
A bool indicating whether this event has a progresss monitor.
virtual string message() const =0
Gets additional information about the status change.
IDescription interface class provides descriptive information on a HydroCouple object.
Definition hydrocouple.h:184
virtual string description() const =0
Gets additional descriptive information for the entity.
virtual string caption() const =0
Gets caption for the entity.
virtual ~IDescription()=default
IDescription::~IDescription is a virtual destructor.
virtual void setCaption(const string &caption)=0
Sets caption for the entity.
virtual void setDescription(const string &description)=0
Gets additional descriptive information for the entity.
IDimension provides the properties of the dimensions of a variable.
Definition hydrocouple.h:941
virtual ~IDimension()=default
~IDimension destructor
LengthType
IDimension::LengthType dimension length type.
Definition hydrocouple.h:947
@ Static
Static length type.
Definition hydrocouple.h:951
@ Dynamic
Dynamic length type.
Definition hydrocouple.h:956
virtual LengthType lengthType() const =0
Gets the length type of the dimension.
The IExchangeItemChangeEventArgs contains the information that will be passed when the IComponentItem...
Definition hydrocouple.h:1589
virtual string message() const =0
Gets message associated with the event.
virtual ~IExchangeItemChangeEventArgs()=default
Standard destructor.
virtual IExchangeItem * exchangeItem() const =0
IExchangeItem which fired the signal.
IExchangeItem the base data item the can be exchanged between components at runtime.
Definition hydrocouple.h:1613
virtual ~IExchangeItem()=default
IExchangeItem::~IExchangeItem is a virtual destructor.
The IIdBasedComponentItem class is an idbased IComponentItem.
Definition hydrocouple.h:1979
virtual void setValue(const hydrocouple_variant &data, int idIndex, const initializer_list< int > &dimensionIndexes={})=0
Sets a multi-dimensional array of values for given time dimension index and size for a hyperslab.
virtual ~IIdBasedComponentDataItem()=default
IIdBasedComponentItem::~IIdBasedComponentItem is a virtual destructor.
virtual IDimension * identifierDimension() const =0
idDimensions returns the dimensions of the id based component item.
virtual void setValues(const hydrocouple_variant *data, int idIndex, const initializer_list< int > &dimensionIndexes={}, int idIndexLength=1, const initializer_list< int > &dimensionLengths={})=0
Sets a multi-dimensional array of values for given id dimension index and size for a hyperslab.
virtual void getValues(hydrocouple_variant *data, int idIndex, const initializer_list< int > &dimensionIndexes={}, int idIndexLength=1, const initializer_list< int > &dimensionLengths={}) const =0
Sets a multi-dimensional array of values for given id dimension index and size for a hyperslab.
virtual void getValue(hydrocouple_variant &data, int idIndex, const initializer_list< int > &dimensionIndexes={}) const =0
Gets a multi-dimensional array of values for given id dimension index and size for a hyperslab.
virtual vector< string > identifiers() const =0
identifiers
virtual void getValues(hydrocouple_variant *data, const initializer_list< int > &idIndexes, const initializer_list< int > &dimensionIndexes={}, const initializer_list< int > &dimensionLengths={}) const =0
Gets a multi-dimensional array of values for given id dimension index and size for a hyperslab.
virtual void setValues(const hydrocouple_variant *data, const initializer_list< int > &idIndexes, const initializer_list< int > &dimensionIndexes={}, const initializer_list< int > &dimensionLengths={})=0
Sets a multi-dimensional array of values for given id dimension index and size for a hyperslab.
IIdentity interface class defines a method to get the Id of an HydroCouple entity.
Definition hydrocouple.h:226
virtual string id() const =0
Gets a unique identifier for the entity.
virtual ~IIdentity()=default
IIdentity::~IIdentity is a virtual destructor.
An IInput item that can accept values for an IModelComponent.
Definition hydrocouple.h:1895
virtual ~IInput()=default
IInput::~IInput is a virtual destructor.
virtual IOutput * provider() const =0
Gets the producer this consumer should get its values from.
virtual bool canConsume(IOutput *provider, string &message) const =0
Returns true if this IInput can consume this producer.
virtual bool setProvider(IOutput *provider)=0
Sets the producer this consumer should get its values from.
IModelComponent interface is the core interface in the HydroCouple standard defining a model componen...
Definition hydrocouple.h:390
virtual void setWorkflow(const IWorkflowComponent *workflow)=0
setWorkflow
virtual set< int > mpiAllocatedProcesses() const =0
mpiAllocatedProcesses are the set of MPI processes/ranks allocated to this component.
virtual vector< IOutput * > outputs() const =0
The list of IOutputs for which a component can produce results.
virtual bool hasEditor() const =0
hasEditor indicates whether this IComponentItem has a UI editor.
virtual void setReferenceDirectory(const string &referenceDirectory)=0
setReferenceDirectory Sets the reference directory for this component instance.
virtual void finish()=0
The finish() must be invoked as the last of any methods in the IModelComponent interface.
virtual void initialize()=0
Initializes the current IModelComponent.
virtual void showViewer(void *opaqueUIPointer=nullptr)=0
showViewer shows the viewer for this IComponentItem.
virtual IModelComponentInfo * componentInfo() const =0
Contains the metadata about this IModelComponent instance.
virtual bool hasViewer() const =0
hasViewer indicates whether this IComponentItem has a UI viewer.
virtual int mpiProcessRank() const =0
mpiProcess is the MPI process/rank of this component.
virtual vector< IInput * > inputs() const =0
The list of consumer items for which a component can recieve values.
virtual void prepare()=0
Prepares the IModelComponent for calls to the Update method.
virtual int mpiNumOfProcesses() const =0
mpiNumProcesses
virtual void showEditor(void *opaqueUIPointer=nullptr)=0
showEditor shows the editor for this IComponentItem.
virtual void mpiClearAllocatedProcesses()=0
mpiClearAllocatedProcesses
virtual void mpiAllocateProcesses(const set< int > &mpiProcessesToAllocate)=0
mpiAllocateResources allocates the specified MPI processes/ranks to this component.
virtual vector< IComponentDataItem * > results() const =0
List of the model's output results.
virtual const IWorkflowComponent * workflow() const =0
workflow is the workflow that this component is part of.
ComponentStatus
HydroCouple::ComponentStatus is an enumerator that describes the status of a component over the cours...
Definition hydrocouple.h:398
@ Initialized
The IModelComponent has successfully initialized itself by calling IModelComponent::initialize()....
Definition hydrocouple.h:417
@ Created
The IModelComponent instance has just been created. This status must and will be followed by HydroCou...
Definition hydrocouple.h:403
@ Finishing
The IModelComponent was requested to perform the actions to be performed before it will either be dis...
Definition hydrocouple.h:489
@ Initializing
The IModelComponent is initializing itself. This status will end in a status change to HydroCouple::I...
Definition hydrocouple.h:409
@ Failed
The IModelComponent was requested to perform the actions to be perform before it will either be dispo...
Definition hydrocouple.h:504
@ Updating
The IModelComponent is updating itself. It has received all required input data from other components...
Definition hydrocouple.h:469
@ Finished
The IModelComponent has successfully performed its finalization actions. Re-initialization of the IMo...
Definition hydrocouple.h:496
@ Valid
The IModelComponent is in a HydroCouple::Valid state. When updating itself its required input will be...
Definition hydrocouple.h:435
@ WaitingForData
The IModelComponent wants to update itself, but is not yet able to perform the actual computation,...
Definition hydrocouple.h:442
@ Invalid
The IModelComponent is in an HydroCouple::Invalid state. When updating itself not all required input ...
Definition hydrocouple.h:452
@ Done
The last update process that the IModelComponent performed was the final one. A next call to the Hydr...
Definition hydrocouple.h:480
@ Preparing
The IModelComponent is preparing itself for the first HydroCouple::IValueSet::getValue() call....
Definition hydrocouple.h:460
@ Updated
The IModelComponent has successfully updated itself.
Definition hydrocouple.h:474
@ Validating
After links between an IModelComponent's inputs/outputs and those of other components have been estab...
Definition hydrocouple.h:428
virtual ComponentStatus status() const =0
Defines current status of the IModelComponent. See HydroCouple::Componentstatus for the possible valu...
virtual void mpiSetProcessRank(int processRank)=0
mpiSetProcess sets the rank for the mpi process associated with this instance of the model.
virtual vector< string > validate()=0
Validates the populated instance of the IModelComponent.
virtual ~IModelComponent()=default
IModelComponent::~IModelComponent destructor.
virtual vector< IArgument * > arguments() const =0
Arguments needed to let the component do its work. An unmodifiable list of (modifiable) arguments mus...
virtual void update(const initializer_list< IOutput * > &requiredOutputs={})=0
This method is called to let the component update itself, thus reaching its next state.
virtual string referenceDirectory() const =0
referenceDirectory
IModelComponentInfo interface inherits from the IComponentInfo interface which provides detailed meta...
Definition hydrocouple.h:359
virtual ~IModelComponentInfo()=default
IModelComponentInfo::~IModelComponentInfo is a virtual destructor.
virtual IModelComponent * createComponentInstance()=0
Creates a new IModelComponent instance.
virtual vector< IAdaptedOutputFactory * > adaptedOutputFactories() const =0
Gets a list of IAdaptedOutputFactories, each allowing to create IAdaptedOutput item for making output...
The IMultiInput class is an IInput class that has multiple outputs supplying data to it.
Definition hydrocouple.h:1927
virtual void canConsume(IOutput *provider, string &message, const IIdentity *providerRoleIdentifier=nullptr) const =0
canConsume checks if the provider can supply data to this consumer.
virtual bool isRequiredProvider(const IIdentity *providerLabel) const =0
isRequiredProvider checks if the provider is required by the consumer.
virtual bool addProvider(IOutput *provider, const IIdentity *providerRoleIdentifier=nullptr)=0
addProvider adds a provider to the list of providers.
virtual bool removeProvider(IOutput *provider)=0
removeProvider
virtual ~IMultiInput()=default
IMultiInput::~IMultiInput is a virtual destructor.
virtual vector< IIdentity * > providerLabels() const =0
virtual vector< IOutput * > providers() const =0
providers
An output exchange item that can deliver values from an IModelComponent.
Definition hydrocouple.h:1631
virtual vector< IAdaptedOutput * > adaptedOutputs() const =0
The adaptedOutputs that have this current output item as adaptee.
virtual ~IOutput()=default
IOutput::~IOutput is a virtual destructor.
virtual void updateValues(const IInput *querySpecifier)=0
Provides the values matching the value definition specified by the . Extensions can overwrite this ba...
virtual bool removeConsumer(IInput *consumer)=0
Remove a consumer.
virtual vector< IInput * > consumers() const =0
Input items that will consume the values, by calling the GetValues() method.
virtual bool removeAdaptedOutput(IAdaptedOutput *adaptedOutput)=0
Removes an IAdaptedOutput.
virtual void addConsumer(IInput *consumer)=0
Add a consumer to this output item. Every input item that wants to call the IValueSet::getValue() met...
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:167
virtual ~IPropertyChanged()=default
IPropertyChanged::~IPropertyChanged is a virtual destructor.
The IProxyModelComponent class is a class for a remote IModelComponent's proxy.
Definition hydrocouple.h:797
virtual int parentMpiProcessRank() const =0
parentMpiProcessRank
virtual string parentProcessAddress() const =0
parentProcessAddress
virtual string parentId() const =0
parentId
virtual ~IProxyModelComponent()=default
~IProxyModelComponent
Qualitative data described items in terms of some quality or categorization that may be 'informal' or...
Definition hydrocouple.h:998
virtual bool isOrdered() const =0
Checks if the IQuality is defined by an ordered set of ICategory or not.
virtual set< hydrocouple_variant > categories() const =0
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:1284
virtual hydrocouple_variant maxValue() const =0
maxValue
virtual ~IQuantity()=default
IQuantity::~IQuantity is a virtual destructor.
virtual hydrocouple_variant minValue() const =0
minValue
virtual IUnit * unit() const =0
Unit of quantity.
Forward declarations.
Definition hydrocouple.h:129
virtual void disconnect(const shared_ptr< ISlot< Args... > > &slot)=0
disconnect is used to disconnect a slot from the signal.
virtual void connect(const shared_ptr< ISlot< Args... > > &slot)=0
connect is used to connect a slot to 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:106
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.
Defines the order of dimension in each FundamentalDimension for a unit.
Definition hydrocouple.h:1022
virtual double power(HydroCouple::IUnitDimensions::FundamentalUnitDimension dimension)=0
Returns the power for the requested dimension.
virtual ~IUnitDimensions()=default
IUnitDimensions::~IUnitDimensions is a virtual destructor.
FundamentalUnitDimension
HydroCouple::FundamentalUnitDimension are the fundamental units that can be combined to form all type...
Definition hydrocouple.h:1028
@ Unitless
Fundamental dimension for unitless quantities.
Definition hydrocouple.h:1072
@ ElectricCurrent
Fundamental dimension for electric current.
Definition hydrocouple.h:1047
@ LuminousIntensity
Fundamental dimension for luminous intensity.
Definition hydrocouple.h:1062
@ Time
Fundamental dimension for time.
Definition hydrocouple.h:1042
@ Length
Fundamental dimension for length.
Definition hydrocouple.h:1032
@ AmountOfSubstance
Fundamental dimension for amount of substance.
Definition hydrocouple.h:1057
@ Mass
Fundamental dimension for mass.
Definition hydrocouple.h:1037
@ Temperature
Fundamental dimension for temperature.
Definition hydrocouple.h:1052
@ Currency
Fundamental dimension for currency.
Definition hydrocouple.h:1067
IUnit interface, describing the physical unit of a IQuantity.
Definition hydrocouple.h:1112
DistanceUnits
HydroCouple::DistanceUnits are the types of units that can be used to measure distance.
Definition hydrocouple.h:1128
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 double conversionFactorToSI() const =0
Conversion factor to SI ('A' in: SI-value = A * quant-value + B)
AreaUnits
HydroCouple::AreaUnits are the types of units that can be used to measure area.
Definition hydrocouple.h:1190
@ SquareCentimeters
Square Centimeters.
Definition hydrocouple.h:1240
@ SquareMiles
Square Miles.
Definition hydrocouple.h:1215
@ Acres
Acres.
Definition hydrocouple.h:1225
@ SquareYards
Square Yards.
Definition hydrocouple.h:1210
@ Unknown
Unknown.
Definition hydrocouple.h:1255
@ SquareMeters
SquareMeters.
Definition hydrocouple.h:1195
@ SquareFeet
Square Feet.
Definition hydrocouple.h:1205
@ Hectares
Hectares.
Definition hydrocouple.h:1220
@ SquareNauticalMiles
Square Nautical Miles.
Definition hydrocouple.h:1230
@ SquareDegrees
Square Degrees.
Definition hydrocouple.h:1235
@ SquareMillimeters
Square Millimeters.
Definition hydrocouple.h:1245
@ SquareInches
Square Inches.
Definition hydrocouple.h:1250
@ SquareKilometers
SquareKilometers.
Definition hydrocouple.h:1200
virtual ~IUnit()=default
IUnit::~IUnit is a virtual destructor.
DistanceUnitType
HydroCouple::DistanceUnitType are the types of units that can be used to measure distance.
Definition hydrocouple.h:1118
IValueDefinition describes a value returned by the getValues() function of IValueSet.
Definition hydrocouple.h:915
virtual hydrocouple_variant missingValue() const =0
The value representing that data is missing.
virtual type_info type() const =0
The object types of value that will be available and is returned by the GetValues function....
virtual hydrocouple_variant defaultValue() const =0
Gets the default value of the argument.
virtual ~IValueDefinition()=default
~IValueDefinition destructor
The IDataExchangeWorkflowComponent class.
Definition hydrocouple.h:2114
virtual ~IWorkflowComponent()=default
~IWorkflowComponent destructor for IWorkflowComponent class.
virtual bool addModelComponent(IModelComponent *component, const IIdentity *modelRoleIdentifier=nullptr)=0
addModelComponent Adds model component instance to workflow
virtual void update()=0
update
virtual WorkflowStatus status() const =0
status
virtual void initialize()=0
initialize
virtual vector< IIdentity * > modelComponentLabels() const =0
requiredModelComponentIdentifiers returns the vector of IModelComponent identifiers that are required...
virtual IWorkflowComponentInfo * componentInfo() const =0
componentInfo
virtual bool removeModelComponent(IModelComponent *component)=0
removeModelComponent Removes model component instance from workflow
virtual vector< IModelComponent * > modelComponents() const =0
modelComponents
WorkflowStatus
The WorkflowStatus enum.
Definition hydrocouple.h:2121
@ Finishing
Definition hydrocouple.h:2128
@ Updated
Definition hydrocouple.h:2126
@ Done
Definition hydrocouple.h:2127
@ Initializing
Definition hydrocouple.h:2123
@ Failed
Definition hydrocouple.h:2130
@ Finished
Definition hydrocouple.h:2129
@ Created
Definition hydrocouple.h:2122
@ Updating
Definition hydrocouple.h:2125
@ Initialized
Definition hydrocouple.h:2124
virtual void finish()=0
finish
virtual bool isRequiredModelComponent(const IIdentity *modelComponentLabel) const =0
isRequiredModelComponent checks if the model component is required by this component.
The IDataExchangeWorkflowComponentInfo class.
Definition hydrocouple.h:2095
virtual IWorkflowComponent * createComponentInstance()=0
Creates a new IModelComponent instance.
virtual ~IWorkflowComponentInfo()=default
~IWorkflowComponentInfo
The IWorkflowComponentStatusChangeEventArgs contains the information that will be passed when the IWo...
Definition hydrocouple.h:2206
virtual IWorkflowComponent::WorkflowStatus status() const =0
Gets the IWorkflowComponent's status after the status change.
virtual IWorkflowComponent * workflowComponent() const =0
Gets the IModelComponent that fired the event.
virtual ~IWorkflowComponentStatusChangeEventArgs()=default
~IComponentStatusChangeEventArgs 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 a component in its simulation.
virtual string message() const =0
Gets additional information about the status change.
virtual bool hasProgressMonitor() const =0
A bool indicating whether this event has a progresss monitor.
ByteOrder
The ByteOrder enum of serialized data.
Definition hydrocouple.h:42
@ LittleEndian
LittleEndian serialized data byte order (least significant byte first).
Definition hydrocouple.h:52
@ BigEndian
BigEndian serialized data byte order (most significant byte first).
Definition hydrocouple.h:47
HydroCouple namespace contains the core interface specifications for the HydroCouple component-based ...
Definition hydrocouple.h:60
variant< bool, char, short, int, long, unsigned char, unsigned short, unsigned int, unsigned long, float, double, long double, string, void * > hydrocouple_variant
hydrocouple_variant is a variant type that can be used to store the core value types values of differ...
Definition hydrocouple.h:96