HydroCouple  2.0.0
HydroCouple Interface Definitions
hydrocouple.h
Go to the documentation of this file.
1 
24 #ifndef HYDROCOUPLE_H
25 #define HYDROCOUPLE_H
26 
27 
28 #include <any>
29 #include <functional>
30 #include <list>
31 #include <set>
32 
33 
34 using namespace std;
35 
40 {
41  BigEndian = 0,
42  LittleEndian = 1
43 };
44 
49 namespace HydroCouple
50 {
52  class IModelComponent;
54  class IArgument;
55  class IInput;
56  class IOutput;
57  class IExchangeItem;
58  class IAdaptedOutput;
61  class IUnit;
63  class IWorkflowComponent;
64 
65 
69  typedef variant<
70  bool,
71  char,
72  short,
73  int,
74  long,
75  unsigned char,
76  unsigned short,
77  unsigned int,
78  unsigned long,
79  float,
80  double,
81  long double,
82  string
84 
85 
91  {
92 
93  public:
94 
98  virtual ~IPropertyChanged() = 0;
99 
107  virtual void registerPropertyChangedListener(const function<void(const any&, const string&)>& propertyChangedListener) = 0;
108 
114  virtual void deRegisterPropertyChangedListener(const function<void(const any&, const string& propertyName)>& propertyChangedListener) = 0;
115 
116  };
117 
125  class IDescription : public virtual IPropertyChanged
126  {
127 
128  public:
129 
133  virtual ~IDescription() = 0;
134 
140  virtual string caption() const = 0;
141 
147  virtual void setCaption(const string &caption) = 0;
148 
154  virtual string description() const = 0;
155 
161  virtual void setDescription(const string &description) = 0;
162  };
163 
168  class IIdentity : public virtual IDescription
169  {
170  public:
174  virtual ~IIdentity() = 0;
175 
186  virtual string id() const = 0;
187  };
188 
197  class IComponentInfo : public virtual IIdentity
198  {
199 
200  public:
204  virtual ~IComponentInfo() = 0;
205 
211  virtual string libraryFilePath() const = 0;
212 
218  virtual void setLibraryFilePath(const string &filePath) = 0;
219 
226  virtual string iconFilePath() const = 0;
227 
232  virtual string vendor() const = 0;
233 
238  virtual list<string> documentation() const = 0;
239 
244  virtual string license() const = 0;
245 
250  virtual string copyright() const = 0;
251 
256  virtual string url() const = 0;
257 
262  virtual string email() const = 0;
263 
268  virtual string version() const = 0;
269 
275  virtual set<string> tags() const = 0;
276 
284  virtual bool validateLicense(const string &licenseInfo, string &validationMessage) = 0;
285 
291  virtual bool validateLicense(string &validationMessage) = 0;
292  };
293 
301  class IModelComponentInfo : public virtual IComponentInfo
302  {
303 
304  public:
308  virtual ~IModelComponentInfo() = 0;
309 
315 
326  virtual vector<IAdaptedOutputFactory *> adaptedOutputFactories() const = 0;
327  };
328 
332  class IModelComponent : public virtual IIdentity
333  {
334 
335  public:
341  {
347 
353 
361 
372 
379 
386 
396 
404 
413 
418 
424 
433 
440 
448  };
449 
453  virtual ~IModelComponent() = 0;
454 
459  virtual IModelComponentInfo *componentInfo() const = 0;
460 
475  virtual vector<IArgument *> arguments() const = 0;
476 
485  virtual ComponentStatus status() const = 0;
486 
501  virtual vector<IInput *> inputs() const = 0;
502 
522  virtual vector<IOutput *> outputs() const = 0;
523 
547  virtual void initialize() = 0;
548 
573  virtual vector<string> validate() = 0;
574 
596  virtual void prepare() = 0;
597 
622  virtual void update(const vector<IOutput *> &requiredOutputs = vector<IOutput *>()) = 0;
623 
636  virtual void finish() = 0;
637 
642  virtual const IWorkflowComponent *workflow() const = 0;
643 
648  virtual void setWorkflow(const IWorkflowComponent *workflow) = 0;
649 
654  virtual int mpiNumOfProcesses() const = 0;
655 
660  virtual int mpiProcessRank() const = 0;
661 
666  virtual void mpiSetProcessRank(int processRank) = 0;
667 
672  virtual set<int> mpiAllocatedProcesses() const = 0;
673 
682  virtual void mpiAllocateProcesses(const set<int> &mpiProcessesToAllocate) = 0;
683 
687  virtual void mpiClearAllocatedProcesses() = 0;
688 
697  virtual string referenceDirectory() const = 0;
698 
704  virtual void setReferenceDirectory(const string &referenceDirectory) = 0;
705 
712  virtual void registerComponentStatusChangedListener(const function<void(const shared_ptr<IComponentStatusChangeEventArgs>&)>& statusChangedEventListener) = 0;
713 
720  virtual void deRegisterComponentStatusChangedListener(const function<void(const shared_ptr<IComponentStatusChangeEventArgs>&)>& statusChangedEventListener) = 0;
721  };
722 
726  class IProxyModelComponent : public virtual IModelComponent
727  {
728 
729  public:
733  virtual ~IProxyModelComponent() = 0;
734 
739  virtual int parentMpiProcessRank() const = 0;
740 
745  virtual string parentId() const = 0;
746  };
747 
754  {
755  public:
760 
765  virtual IModelComponent *component() const = 0;
766 
772 
778 
782  virtual string message() const = 0;
783 
788  virtual bool hasProgressMonitor() const = 0;
789 
794  virtual float percentProgress() const = 0;
795  };
796 
801  {
802  public:
807 
812  virtual ICloneableModelComponent *parent() const = 0;
813 
821 
826  virtual list<ICloneableModelComponent *> clones() const = 0;
827  };
828 
836  class IValueDefinition : public virtual IDescription
837  {
838  public:
842  virtual ~IValueDefinition() = 0;
843 
850  virtual type_info type() const = 0;
851 
853  virtual hydrocouple_variant missingValue() const = 0;
854 
856  virtual hydrocouple_variant defaultValue() const = 0;
857  };
858 
862  class IDimension : public virtual IIdentity
863  {
864  public:
868  virtual ~IDimension() = 0;
869  };
870 
898  class IQuality : public virtual IValueDefinition
899  {
900  public:
904  virtual ~IQuality() = 0;
905 
911  virtual vector<hydrocouple_variant> categories() const = 0;
912 
916  virtual bool isOrdered() const = 0;
917  };
918 
922  class IUnitDimensions : public virtual IDescription
923  {
924  public:
925 
930  {
935 
940 
945 
950 
955 
960 
965 
969  Currency
970  };
971 
972 
976  virtual ~IUnitDimensions() = 0;
977 
1005  };
1006 
1010  class IUnit : public virtual IDescription
1011  {
1012  public:
1013 
1017  virtual ~IUnit() = 0;
1018 
1022  virtual IUnitDimensions *dimensions() const = 0;
1023 
1027  virtual double conversionFactorToSI() const = 0;
1028 
1032  virtual double offsetToSI() const = 0;
1033  };
1034 
1039  class IQuantity : public virtual IValueDefinition
1040  {
1041  public:
1042  virtual ~IQuantity() = 0;
1043 
1047  virtual IUnit *unit() const = 0;
1048 
1053  virtual hydrocouple_variant minValue() const = 0;
1054 
1059  virtual hydrocouple_variant maxValue() const = 0;
1060  };
1061 
1068  class IComponentDataItem : public virtual IIdentity
1069  {
1070  public:
1071 
1075  virtual ~IComponentDataItem() = 0;
1076 
1086  virtual IModelComponent *modelComponent() const = 0;
1087 
1094  virtual vector<IDimension *> dimensions() const = 0;
1095 
1105  virtual int dimensionLength(const vector<int> &dimensionIndexes) const = 0;
1106 
1111  virtual IValueDefinition *valueDefinition() const = 0;
1112 
1119  virtual void getValue(const vector<int> &dimensionIndexes, void *data) const = 0;
1120 
1126  virtual void setValue(const vector<int> &dimensionIndexes, const void *data) = 0;
1127 
1128 
1133  virtual bool hasEditor() const = 0;
1134 
1138  virtual void showEditor() = 0;
1139 
1144  virtual bool hasViewer() const = 0;
1145 
1149  virtual void showViewer() = 0;
1150 
1151  };
1152 
1159  class IArgument : public virtual IComponentDataItem
1160  {
1161 
1162  public:
1167  {
1172 
1177 
1178  /*
1179  * \brief Enumeration indicating that the argument was read from a URL.
1180  */
1182 
1187 
1191  URL
1192  };
1193 
1197  virtual ~IArgument() = 0;
1198 
1205  virtual bool isOptional() const = 0;
1206 
1214  virtual bool isReadOnly() const = 0;
1215 
1219  virtual string toString() const = 0;
1220 
1225  virtual void saveData() = 0;
1226 
1232  virtual list<string> fileFilters() const = 0;
1233 
1237  virtual bool isValidArgType(ArgumentInputType argType) const = 0;
1238 
1244 
1252  virtual bool initialize(const string &value, ArgumentInputType argType, string &message) = 0;
1253 
1261  virtual bool initialize(const IComponentDataItem *componentDataItem, string &message) = 0;
1262 
1263  };
1264 
1274  {
1275  public:
1280 
1284  virtual IExchangeItem *exchangeItem() const = 0;
1285 
1289  virtual string message() const = 0;
1290  };
1291 
1297  class IExchangeItem : public virtual IComponentDataItem
1298  {
1299 
1300  public:
1304  virtual ~IExchangeItem() = 0;
1305 
1312  virtual void registerExchangeItemStatusChangedListener(const function<void(const shared_ptr<IExchangeItemChangeEventArgs>&)>& exchangeItemChangedEventListener) = 0;
1313 
1320  virtual void deRegisterExchangeItemStatusChangedListener(const function<void(const shared_ptr<IExchangeItemChangeEventArgs>&)>& exchangeItemChangedEventListener) = 0;
1321  };
1322 
1331  class IOutput : public virtual IExchangeItem
1332  {
1333  public:
1334 
1338  virtual ~IOutput() = 0;
1339 
1351  virtual vector<IInput *> consumers() const = 0;
1352 
1366  virtual void addConsumer(IInput *consumer) = 0;
1367 
1377  virtual bool removeConsumer(IInput *consumer) = 0;
1378 
1388  virtual vector<IAdaptedOutput *> adaptedOutputs() const = 0;
1389 
1402  virtual void addAdaptedOutput(IAdaptedOutput *adaptedOutput) = 0;
1403 
1413  virtual bool removeAdaptedOutput(IAdaptedOutput *adaptedOutput) = 0;
1414 
1429  virtual void updateValues(IInput *querySpecifier) = 0;
1430  };
1431 
1445  class IAdaptedOutput : public virtual IOutput
1446  {
1447  public:
1448 
1452  virtual ~IAdaptedOutput() = 0;
1453 
1462 
1471  virtual vector<IArgument *> arguments() const = 0;
1472 
1483  virtual void initialize() = 0;
1484 
1492  virtual IOutput *adaptee() const = 0;
1493 
1505  virtual void refresh() = 0;
1506  };
1507 
1516  class IAdaptedOutputFactory : public virtual IIdentity
1517  {
1518  public:
1519 
1523  virtual ~IAdaptedOutputFactory() = 0;
1524 
1536  virtual vector<IIdentity *> getAvailableAdaptedOutputIds(const IOutput *provider, const IInput *consumer = nullptr) = 0;
1537 
1549  virtual IAdaptedOutput *createAdaptedOutput(IIdentity *adaptedProviderId, IOutput *provider, IInput *consumer = nullptr) = 0;
1550  };
1551 
1561  {
1562  public:
1563 
1568 
1573  };
1574 
1581  {
1582  public:
1583 
1588 
1595  };
1596 
1600  class IInput : public virtual IExchangeItem
1601  {
1602  public:
1603 
1607  virtual ~IInput() = 0;
1608 
1612  virtual IOutput *provider() const = 0;
1613 
1619  virtual bool setProvider(IOutput *provider) = 0;
1620 
1627  virtual bool canConsume(IOutput *provider, string &message) const = 0;
1628  };
1629 
1633  class IMultiInput : public virtual IInput
1634  {
1635  public:
1636 
1640  virtual ~IMultiInput() = 0;
1641 
1646  virtual vector<IOutput *> providers() const = 0;
1647 
1652  virtual bool addProvider(IOutput *provider) = 0;
1653 
1658  virtual bool removeProvider(IOutput *provider) = 0;
1659  };
1660 
1665  {
1666  using IComponentDataItem::getValue;
1667  using IComponentDataItem::setValue;
1668 
1669  public:
1674 
1679  virtual list<string> identifiers() const = 0;
1680 
1685  virtual IDimension *identifierDimension() const = 0;
1686 
1693  virtual void getValue(int idIndex, void *data) const = 0;
1694 
1701  virtual void getValues(int idIndex, int stride, void *data) const = 0;
1702 
1709  virtual void setValue(int idIndex, const void *data) = 0;
1710 
1718  virtual void setValues(int idIndex, int stride, const void *data) = 0;
1719  };
1720 
1725  {
1726 
1727  public:
1728 
1733 
1739  };
1740 
1744  class IWorkflowComponent : public virtual IIdentity
1745  {
1746 
1747  public:
1752  {
1761  Failed
1762  };
1763 
1767  virtual ~IWorkflowComponent() = 0;
1768 
1774 
1778  virtual void initialize() = 0;
1779 
1783  virtual void update() = 0;
1784 
1788  virtual void finish() = 0;
1789 
1794  virtual WorkflowStatus status() const = 0;
1795 
1800  virtual list<IModelComponent *> modelComponents() const = 0;
1801 
1806  virtual void addModelComponent(IModelComponent *component) = 0;
1807 
1812  virtual void removeModelComponent(IModelComponent *component) = 0;
1813 
1819  virtual void registerComponentStatusChangedListener(const function<void(const IWorkflowComponent*, WorkflowStatus, const string&)>& workflowComponentStatusChangedListener) = 0;
1820 
1827  virtual void deRegisterComponentStatusChangedListener(const function<void(const IWorkflowComponent*, WorkflowStatus, const string&)>& workflowComponentStatusChangedListener) = 0;
1828 
1829  };
1830 
1831 }
1832 
1833 #endif // HYDROCOUPLE_H
IAdaptedOutputFactoryComponent is an IAdaptedOutputFactory generated from an IAdaptedOutputFactoryCom...
Definition: hydrocouple.h:1581
virtual IAdaptedOutputFactoryComponentInfo * componentInfo() const =0
Contains the metadata about the IModelComponent.
virtual ~IAdaptedOutputFactoryComponent()=0
IAdaptedOutputFactoryComponent::~IAdaptedOutputFactoryComponent is a virtual destructor.
IAdaptedOutputFactoryComponentInfo interface class provides information about an IAdaptedOutputFactor...
Definition: hydrocouple.h:1561
virtual IAdaptedOutputFactoryComponent * createComponentInstance()=0
New IAdaptedOutputFactoryComponent instance.
virtual ~IAdaptedOutputFactoryComponentInfo()=0
IAdaptedOutputFactoryComponentInfo::~IAdaptedOutputFactoryComponentInfo is a virtual destructor.
IAdaptedOutputFactory is used to create instances of IAdaptedProducerExchangeItems.
Definition: hydrocouple.h:1517
virtual ~IAdaptedOutputFactory()=0
IAdaptedOutputFactory::~IAdaptedOutputFactory is a virtual destructor.
virtual vector< IIdentity * > getAvailableAdaptedOutputIds(const IOutput *provider, const IInput *consumer=nullptr)=0
Get a list of IIdentity objects representing the list of the available IAdaptedOutput that can make t...
virtual IAdaptedOutput * createAdaptedOutput(IIdentity *adaptedProviderId, IOutput *provider, IInput *consumer=nullptr)=0
Creates a IAdaptedOutput that adapts the producer so that it fits the consumer.
An IAdaptedOutput adds one or more data operations on top of an IOutput.
Definition: hydrocouple.h:1446
virtual ~IAdaptedOutput()=0
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 IAdaptedOutputFactory * adaptedOutputFactory() const =0
IAdaptedOutputFactory that generated this IAdaptedOutput.
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.
virtual IOutput * adaptee() const =0
IOutput that this IAdaptedOutput extracts content from. In the adapter design pattern,...
IArgument interface class used to set the arguments for components. They can be complex or simple mul...
Definition: hydrocouple.h:1160
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:1167
@ XML
Enumeration indicating that the argument was read from a file.
Definition: hydrocouple.h:1186
@ File
Enumeration indicating that the argument was read from a file.
Definition: hydrocouple.h:1176
@ JSON
Definition: hydrocouple.h:1181
@ String
Enumeration indicating that the argument was read from string.
Definition: hydrocouple.h:1171
virtual bool initialize(const IComponentDataItem *componentDataItem, string &message)=0
Reads values from an equivalent IComponentDataItem. IComponentDataItem has been used instead of IArgu...
virtual ~IArgument()=0
IArgument::~IArgument is a virtual destructor.
virtual list< string > fileFilters() const =0
File type extensions that can be read by this IArgument.
virtual bool isOptional() const =0
Specifies whether the argument is optional or not.
The ICloneableModelComponent class.
Definition: hydrocouple.h:801
virtual ICloneableModelComponent * clone()=0
Deep clones itself including cloning its Data::IArgument.
virtual list< ICloneableModelComponent * > clones() const =0
A list ICloneableModelComponent instances cloned from this IModelComponent instance.
virtual ICloneableModelComponent * parent() const =0
Parent ICloneableModelComponent object from which current component was cloned from.
virtual ~ICloneableModelComponent()=0
~ICloneableModelComponent destructor
IComponentItem is a fundamental unit of data for a component.
Definition: hydrocouple.h:1069
virtual IValueDefinition * valueDefinition() const =0
IValueDefinition for this IValueSet defines the variable type associated with this object.
virtual bool hasViewer() const =0
hasViewer indicates whether this IComponentItem has a UI viewer.
virtual int dimensionLength(const vector< int > &dimensionIndexes) const =0
dimensionLength returns the length of the dimension specified by the given dimension indexes....
virtual IModelComponent * modelComponent() const =0
Gets the owner IModelComponent of this IComponentItem. For an IOutput component item this is the comp...
virtual void showViewer()=0
showViewer
virtual void showEditor()=0
showEditor shows the editor for this IComponentItem.
virtual ~IComponentDataItem()=0
IComponentDataItem::~IComponentDataItem is a virtual destructor.
virtual void setValue(const vector< int > &dimensionIndexes, const void *data)=0
Sets a multi-dimensional array of values for given dimension indexes.
virtual bool hasEditor() const =0
hasEditor indicates whether this IComponentItem has a UI editor.
virtual void getValue(const vector< int > &dimensionIndexes, void *data) const =0
Gets a multi-dimensional array of value for given dimension indexes. IndexArray = x + y * InSizeX + z...
virtual vector< IDimension * > dimensions() const =0
provides purely descriptive information of the dimensions associated with this IComponentItem
IComponentInfo interface class is a factory that provides detailed metadata about a component and cre...
Definition: hydrocouple.h:198
virtual string url() const =0
Component developer url.
virtual void setLibraryFilePath(const string &filePath)=0
Sets file path to Component library.
virtual ~IComponentInfo()=0
IComponentInfo::~IComponentInfo is a virtual destructor.
virtual string vendor() const =0
Component developer information.
virtual string version() const =0
Component version info.
virtual set< string > tags() const =0
tags used to classify this component.
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 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.
The IComponentStatusChangeEventArgs contains the information that will be passed when the IModelCompo...
Definition: hydrocouple.h:754
virtual HydroCouple::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 * component() const =0
Gets the IModelComponent that fired the event.
virtual ~IComponentStatusChangeEventArgs()=0
~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.
virtual HydroCouple::IModelComponent::ComponentStatus previousStatus() const =0
Gets the IModelComponent's status before the status change.
IDescription interface class provides descriptive information on a HydroCouple object.
Definition: hydrocouple.h:126
virtual string description() const =0
Gets additional descriptive information for the entity.
virtual string caption() const =0
Gets caption for the entity.
virtual ~IDescription()=0
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:863
virtual ~IDimension()=0
~IDimension destructor
The IExchangeItemChangeEventArgs contains the information that will be passed when the IComponentItem...
Definition: hydrocouple.h:1274
virtual string message() const =0
Gets message associated with the event.
virtual IExchangeItem * exchangeItem() const =0
IExchangeItem which fired the signal.
virtual ~IExchangeItemChangeEventArgs()=0
Standard destructor.
IExchangeItem the base data item the can be exchanged between components at runtime.
Definition: hydrocouple.h:1298
virtual void registerExchangeItemStatusChangedListener(const function< void(const shared_ptr< IExchangeItemChangeEventArgs > &)> &exchangeItemChangedEventListener)=0
The componentItemChanged event is fired when the content of an IComponentItem has changed.
virtual void deRegisterExchangeItemStatusChangedListener(const function< void(const shared_ptr< IExchangeItemChangeEventArgs > &)> &exchangeItemChangedEventListener)=0
The deRegisterExchangeItemStatusChangedListener() method deregisters a listener that is called when t...
virtual ~IExchangeItem()=0
IExchangeItem::~IExchangeItem is a virtual destructor.
The IIdBasedComponentItem class is an idbased IComponentItem.
Definition: hydrocouple.h:1665
virtual list< string > identifiers() const =0
identifiers
virtual IDimension * identifierDimension() const =0
idDimensions
virtual void setValue(int idIndex, const void *data)=0
Sets a multi-dimensional array of values for given time dimension index and size for a hyperslab.
virtual void getValues(int idIndex, int stride, void *data) const =0
Gets a multi-dimensional array of values for given id dimension index and size for a hyperslab.
virtual void setValues(int idIndex, int stride, const void *data)=0
Sets a multi-dimensional array of values for given id dimension index and size for a hyperslab.
virtual ~IIdBasedComponentDataItem()=0
IIdBasedComponentItem::~IIdBasedComponentItem is a virtual destructor.
virtual void getValue(int idIndex, void *data) const =0
Gets 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:169
virtual string id() const =0
Gets a unique identifier for the entity.
virtual ~IIdentity()=0
IIdentity::~IIdentity is a virtual destructor.
An IInput item that can accept values for an IModelComponent.
Definition: hydrocouple.h:1601
virtual ~IInput()=0
IInput::~IInput is a virtual destructor.
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.
virtual IOutput * provider() const =0
Gets 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:333
virtual void setWorkflow(const IWorkflowComponent *workflow)=0
setWorkflow
virtual void update(const vector< IOutput * > &requiredOutputs=vector< IOutput * >())=0
This method is called to let the component update itself, thus reaching its next state.
virtual const IWorkflowComponent * workflow() const =0
workflow is the workflow that this component is part of.
virtual vector< IArgument * > arguments() const =0
Arguments needed to let the component do its work. An unmodifiable list of (modifiable) arguments mus...
virtual void setReferenceDirectory(const string &referenceDirectory)=0
setReferenceDirectory
virtual void finish()=0
The finish() must be invoked as the last of any methods in the IModelComponent interface.
virtual vector< IOutput * > outputs() const =0
The list of IOutputs for which a component can produce results.
virtual void initialize()=0
Initializes the current IModelComponent.
virtual set< int > mpiAllocatedProcesses() const =0
mpiAllocatedProcesses are the set of MPI processes/ranks allocated to this component.
virtual int mpiProcessRank() const =0
mpiProcess is the MPI process/rank of this component.
virtual IModelComponentInfo * componentInfo() const =0
Contains the metadata about this IModelComponent instance.
virtual void prepare()=0
Prepares the IModelComponent for calls to the Update method.
virtual void registerComponentStatusChangedListener(const function< void(const shared_ptr< IComponentStatusChangeEventArgs > &)> &statusChangedEventListener)=0
The registerComponentStatusChangedListener() method registers a listener to be called when the status...
virtual int mpiNumOfProcesses() const =0
mpiNumProcesses
virtual vector< IInput * > inputs() const =0
The list of consumer items for which a component can recieve values.
virtual void mpiClearAllocatedProcesses()=0
mpiClearAllocatedProcesses
virtual void mpiAllocateProcesses(const set< int > &mpiProcessesToAllocate)=0
mpiAllocateResources allocates the specified MPI processes/ranks to this component.
ComponentStatus
HydroCouple::ComponentStatus is an enumerator that describes the status of a component over the cours...
Definition: hydrocouple.h:341
@ Initialized
The IModelComponent has successfully initialized itself by calling IModelComponent::initialize()....
Definition: hydrocouple.h:360
@ Created
The IModelComponent instance has just been created. This status must and will be followed by HydroCou...
Definition: hydrocouple.h:346
@ Finishing
The IModelComponent was requested to perform the actions to be performed before it will either be dis...
Definition: hydrocouple.h:432
@ Initializing
The IModelComponent is initializing itself. This status will end in a status change to HydroCouple::I...
Definition: hydrocouple.h:352
@ Failed
The IModelComponent was requested to perform the actions to be perform before it will either be dispo...
Definition: hydrocouple.h:447
@ Updating
The IModelComponent is updating itself. It has received all required input data from other components...
Definition: hydrocouple.h:412
@ Finished
The IModelComponent has successfully performed its finalization actions. Re-initialization of the IMo...
Definition: hydrocouple.h:439
@ Valid
The IModelComponent is in a HydroCouple::Valid state. When updating itself its required input will be...
Definition: hydrocouple.h:378
@ WaitingForData
The IModelComponent wants to update itself, but is not yet able to perform the actual computation,...
Definition: hydrocouple.h:385
@ Invalid
The IModelComponent is in an HydroCouple::Invalid state. When updating itself not all required input ...
Definition: hydrocouple.h:395
@ Done
The last update process that the IModelComponent performed was the final one. A next call to the Hydr...
Definition: hydrocouple.h:423
@ Preparing
The IModelComponent is preparing itself for the first HydroCouple::IValueSet::getValue() call....
Definition: hydrocouple.h:403
@ Updated
The IModelComponent has successfully updated itself.
Definition: hydrocouple.h:417
@ Validating
After links between an IModelComponent's inputs/outputs and those of other components have been estab...
Definition: hydrocouple.h:371
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
virtual ~IModelComponent()=0
IModelComponent::~IModelComponent destructor.
virtual vector< string > validate()=0
Validates the populated instance of the IModelComponent.
virtual string referenceDirectory() const =0
referenceDirectory
virtual void deRegisterComponentStatusChangedListener(const function< void(const shared_ptr< IComponentStatusChangeEventArgs > &)> &statusChangedEventListener)=0
The deRegisterComponentStatusChangedListener() method deregisters a listener that is called when the ...
IModelComponentInfo interface inherits from the IComponentInfo interface which provides detailed meta...
Definition: hydrocouple.h:302
virtual ~IModelComponentInfo()=0
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:1634
virtual ~IMultiInput()=0
IMultiInput::~IMultiInput is a virtual destructor.
virtual bool removeProvider(IOutput *provider)=0
removeProvider
virtual vector< IOutput * > providers() const =0
providers
virtual bool addProvider(IOutput *provider)=0
addProvider
An output exchange item that can deliver values from an IModelComponent.
Definition: hydrocouple.h:1332
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 void updateValues(IInput *querySpecifier)=0
Provides the values matching the value definition specified by the . Extensions can overwrite this ba...
virtual vector< IAdaptedOutput * > adaptedOutputs() const =0
The adaptedOutputs that have this current output item as adaptee.
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 ~IOutput()=0
IOutput::~IOutput is a virtual destructor.
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:91
virtual void registerPropertyChangedListener(const function< void(const any &, const string &)> &propertyChangedListener)=0
IPropertyChanged::registerPropertyChangedListener() registers a listener to be called when a property...
virtual void deRegisterPropertyChangedListener(const function< void(const any &, const string &propertyName)> &propertyChangedListener)=0
IPropertyChanged::deRegisterPropertyChangedListener() deregisters a listener that is called when a pr...
virtual ~IPropertyChanged()=0
IPropertyChanged::~IPropertyChanged is a virtual destructor.
The IProxyModelComponent class is a class for a remote IModelComponent's proxy.
Definition: hydrocouple.h:727
virtual ~IProxyModelComponent()=0
~IProxyModelComponent
virtual int parentMpiProcessRank() const =0
parentMpiProcessRank
virtual string parentId() const =0
parentId
Qualitative data described items in terms of some quality or categorization that may be 'informal' or...
Definition: hydrocouple.h:899
virtual vector< hydrocouple_variant > categories() const =0
virtual bool isOrdered() const =0
Checks if the IQuality is defined by an ordered set of ICategory or not.
virtual ~IQuality()=0
IQuality::~IQuality is a virtual destructor.
IQuantity specifies values as an amount of some unit, usually as a floating point number.
Definition: hydrocouple.h:1040
virtual hydrocouple_variant maxValue() const =0
maxValue
virtual hydrocouple_variant minValue() const =0
minValue
virtual IUnit * unit() const =0
Unit of quantity.
Defines the order of dimension in each FundamentalDimension for a unit.
Definition: hydrocouple.h:923
virtual double getPower(HydroCouple::IUnitDimensions::FundamentalUnitDimension dimension)=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:930
@ ElectricCurrent
Fundamental dimension for electric current.
Definition: hydrocouple.h:949
@ LuminousIntensity
Fundamental dimension for luminous intensity.
Definition: hydrocouple.h:964
@ Time
Fundamental dimension for time.
Definition: hydrocouple.h:944
@ Length
Fundamental dimension for length.
Definition: hydrocouple.h:934
@ AmountOfSubstance
Fundamental dimension for amount of substance.
Definition: hydrocouple.h:959
@ Mass
Fundamental dimension for mass.
Definition: hydrocouple.h:939
@ Temperature
Fundamental dimension for temperature.
Definition: hydrocouple.h:954
virtual ~IUnitDimensions()=0
IUnitDimensions::~IUnitDimensions is a virtual destructor.
IUnit interface, describing the physical unit of a IQuantity.
Definition: hydrocouple.h:1011
virtual IUnitDimensions * dimensions() const =0
Fundamental dimensions of the unit.
virtual double offsetToSI() const =0
OffSet to SI ('B' in: SI-value = A * quant-value + B).
virtual double conversionFactorToSI() const =0
Conversion factor to SI ('A' in: SI-value = A * quant-value + B)
virtual ~IUnit()=0
IUnit::~IUnit is a virtual destructor.
IValueDefinition describes a value returned by the getValues() function of IValueSet.
Definition: hydrocouple.h:837
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()=0
~IValueDefinition destructor
The IDataExchangeWorkflowComponent class.
Definition: hydrocouple.h:1745
virtual void removeModelComponent(IModelComponent *component)=0
removeModelComponent
virtual void deRegisterComponentStatusChangedListener(const function< void(const IWorkflowComponent *, WorkflowStatus, const string &)> &workflowComponentStatusChangedListener)=0
deRegisterComponentStatusChangedListener() method deregisters a listener that is called when the stat...
virtual void update()=0
update
virtual void registerComponentStatusChangedListener(const function< void(const IWorkflowComponent *, WorkflowStatus, const string &)> &workflowComponentStatusChangedListener)=0
registerComponentStatusChanged registers a listener that is called when the status of the component c...
virtual WorkflowStatus status() const =0
status
virtual ~IWorkflowComponent()=0
~IWorkflowComponent destructor for IWorkflowComponent class.
virtual void initialize()=0
initialize
virtual void addModelComponent(IModelComponent *component)=0
addModelComponent
virtual list< IModelComponent * > modelComponents() const =0
modelComponents
WorkflowStatus
The WorkflowStatus enum.
Definition: hydrocouple.h:1752
@ Finishing
Definition: hydrocouple.h:1759
@ Updated
Definition: hydrocouple.h:1757
@ Done
Definition: hydrocouple.h:1758
@ Initializing
Definition: hydrocouple.h:1754
@ Finished
Definition: hydrocouple.h:1760
@ Created
Definition: hydrocouple.h:1753
@ Updating
Definition: hydrocouple.h:1756
@ Initialized
Definition: hydrocouple.h:1755
virtual void finish()=0
finish
virtual IWorkflowComponentInfo * componentInfo() const =0
componentInfo
The IDataExchangeWorkflowComponentInfo class.
Definition: hydrocouple.h:1725
virtual ~IWorkflowComponentInfo()=0
~IWorkflowComponentInfo
virtual IWorkflowComponent * createComponentInstance()=0
Creates a new IModelComponent instance.
ByteOrder
The ByteOrder enum of serialized data.
Definition: hydrocouple.h:40
@ LittleEndian
Definition: hydrocouple.h:42
@ BigEndian
Definition: hydrocouple.h:41
HydroCouple namespace contains the core interface specifications for the HydroCouple component-based ...
Definition: hydrocouple.h:50
variant< bool, char, short, int, long, unsigned char, unsigned short, unsigned int, unsigned long, float, double, long double, string > hydrocouple_variant
hydrocouple_variant is a variant type that can be used to store values of different types.
Definition: hydrocouple.h:63