HydroCouple  2.0.0
HydroCouple Interface Definitions
HydroCouple::IArgument Class Referenceabstract

IArgument interface class used to set the arguments for components. They can be complex or simple multi-dimensional datasets. More...

#include <hydrocouple.h>

Inheritance diagram for HydroCouple::IArgument:
Collaboration diagram for HydroCouple::IArgument:

Public Types

enum  ArgumentInputType {
  String ,
  File ,
  JSON ,
  XML ,
  URL
}
 Enumeration indicating the type of input for the argument. More...
 

Public Member Functions

virtual ~IArgument ()=0
 IArgument::~IArgument is a virtual destructor. More...
 
virtual bool isOptional () const =0
 Specifies whether the argument is optional or not. More...
 
virtual bool isReadOnly () const =0
 Defines whether the Values property may be edited. More...
 
virtual string toString () const =0
 String/XML representation for this IArgument. More...
 
virtual void saveData ()=0
 Writes data to files associated with this argument if they exist. More...
 
virtual list< string > fileFilters () const =0
 File type extensions that can be read by this IArgument. More...
 
virtual bool isValidArgType (ArgumentInputType argType) const =0
 Boolean indicating whether this IArgument copy its values from a string. More...
 
virtual ArgumentInputType currentArgumentInputType () const =0
 argumentIOType More...
 
virtual bool initialize (const string &value, ArgumentInputType argType, string &message)=0
 Reads values from a JSON string. More...
 
virtual bool initialize (const IComponentDataItem *componentDataItem, string &message)=0
 Reads values from an equivalent IComponentDataItem. IComponentDataItem has been used instead of IArgument so that outputs from one model can be used as initialization arguments for another. More...
 
- Public Member Functions inherited from HydroCouple::IComponentDataItem
virtual ~IComponentDataItem ()=0
 IComponentDataItem::~IComponentDataItem is a virtual destructor. More...
 
virtual IModelComponentmodelComponent () const =0
 Gets the owner IModelComponent of this IComponentItem. For an IOutput component item this is the component responsible for providing the content of the IOutput. More...
 
virtual vector< IDimension * > dimensions () const =0
 provides purely descriptive information of the dimensions associated with this IComponentItem More...
 
virtual int dimensionLength (const vector< int > &dimensionIndexes) const =0
 dimensionLength returns the length of the dimension specified by the given dimension indexes. To get the size of the first dimension, use a null integer array as input argument. Length of indices must be a least one smaller than the numDimensions() More...
 
virtual IValueDefinitionvalueDefinition () const =0
 IValueDefinition for this IValueSet defines the variable type associated with this object. More...
 
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 * InSizeX * InSizeY etc;. More...
 
virtual void setValue (const vector< int > &dimensionIndexes, const void *data)=0
 Sets a multi-dimensional array of values for given dimension indexes. More...
 
virtual bool hasEditor () const =0
 hasEditor indicates whether this IComponentItem has a UI editor. More...
 
virtual void showEditor ()=0
 showEditor shows the editor for this IComponentItem. More...
 
virtual bool hasViewer () const =0
 hasViewer indicates whether this IComponentItem has a UI viewer. More...
 
virtual void showViewer ()=0
 showViewer More...
 
- Public Member Functions inherited from HydroCouple::IIdentity
virtual ~IIdentity ()=0
 IIdentity::~IIdentity is a virtual destructor. More...
 
virtual string id () const =0
 Gets a unique identifier for the entity. More...
 
- Public Member Functions inherited from HydroCouple::IDescription
virtual ~IDescription ()=0
 IDescription::~IDescription is a virtual destructor. More...
 
virtual string caption () const =0
 Gets caption for the entity. More...
 
virtual void setCaption (const string &caption)=0
 Sets caption for the entity. More...
 
virtual string description () const =0
 Gets additional descriptive information for the entity. More...
 
virtual void setDescription (const string &description)=0
 Gets additional descriptive information for the entity. More...
 
- Public Member Functions inherited from HydroCouple::IPropertyChanged
virtual ~IPropertyChanged ()=0
 IPropertyChanged::~IPropertyChanged is a virtual destructor. More...
 
virtual void registerPropertyChangedListener (const function< void(const any &, const string &)> &propertyChangedListener)=0
 IPropertyChanged::registerPropertyChangedListener() registers a listener to be called when a property of an object changes. More...
 
virtual void deRegisterPropertyChangedListener (const function< void(const any &, const string &propertyName)> &propertyChangedListener)=0
 IPropertyChanged::deRegisterPropertyChangedListener() deregisters a listener that is called when a property of an object changes. More...
 

Detailed Description

IArgument interface class used to set the arguments for components. They can be complex or simple multi-dimensional datasets.

IArgument is primarily used to set arguments of IModelComponent and IAdaptedOutput

Member Enumeration Documentation

◆ ArgumentInputType

Enumeration indicating the type of input for the argument.

Enumerator
String 

Enumeration indicating that the argument was read from string.

File 

Enumeration indicating that the argument was read from a file.

JSON 
XML 

Enumeration indicating that the argument was read from a file.

URL 

Enumeration indicating that the argument was read from a URL.

Constructor & Destructor Documentation

◆ ~IArgument()

virtual HydroCouple::IArgument::~IArgument ( )
pure virtual

IArgument::~IArgument is a virtual destructor.

Member Function Documentation

◆ currentArgumentInputType()

virtual ArgumentInputType HydroCouple::IArgument::currentArgumentInputType ( ) const
pure virtual

argumentIOType

Returns

◆ fileFilters()

virtual list<string> HydroCouple::IArgument::fileFilters ( ) const
pure virtual

File type extensions that can be read by this IArgument.

File extensions must be specified using the Qt format e.g. "Images (*.png *.xpm *.jpg) "

Returns
a list of strings for compatible file extensions.

◆ initialize() [1/2]

virtual bool HydroCouple::IArgument::initialize ( const IComponentDataItem componentDataItem,
string &  message 
)
pure virtual

Reads values from an equivalent IComponentDataItem. IComponentDataItem has been used instead of IArgument so that outputs from one model can be used as initialization arguments for another.

Parameters
componentDataItemis the IArgument from which to copy values from.
messagemessage returned from file read operation.
Returns
boolean indicating whether file reading was successful.

◆ initialize() [2/2]

virtual bool HydroCouple::IArgument::initialize ( const string &  value,
ArgumentInputType  argType,
string &  message 
)
pure virtual

Reads values from a JSON string.

Parameters
valueis a string representing values in JSON format.
argTypeis the type of input to be read.
messagemessage returned from file read operation.
Returns
boolean indicating whether file/string reading was successful

◆ isOptional()

virtual bool HydroCouple::IArgument::isOptional ( ) const
pure virtual

Specifies whether the argument is optional or not.

If the getValue property returns null and isOptional == false, a value has to be set before the argument can be used

◆ isReadOnly()

virtual bool HydroCouple::IArgument::isReadOnly ( ) const
pure virtual

Defines whether the Values property may be edited.

This is used to let a IModelComponent or an IAdaptedOutput present the actual value of an argument that can not be changed by the user, but is needed to determine the values of other arguments or is informative in any other way.

◆ isValidArgType()

virtual bool HydroCouple::IArgument::isValidArgType ( ArgumentInputType  argType) const
pure virtual

Boolean indicating whether this IArgument copy its values from a string.

◆ saveData()

virtual void HydroCouple::IArgument::saveData ( )
pure virtual

Writes data to files associated with this argument if they exist.

Returns

◆ toString()

virtual string HydroCouple::IArgument::toString ( ) const
pure virtual

String/XML representation for this IArgument.


The documentation for this class was generated from the following file: