HydroCouple  2.0.0
HydroCouple Interface Definitions
Loading...
Searching...
No Matches
HydroCouple::ICloneableModelComponent Class Referenceabstract

The ICloneableModelComponent class is an IModelComponent that supports deep cloning of itself and its configuration. More...

#include <hydrocouple.h>

Inheritance diagram for HydroCouple::ICloneableModelComponent:
Collaboration diagram for HydroCouple::ICloneableModelComponent:

Public Member Functions

virtual ~ICloneableModelComponent ()=default
 ~ICloneableModelComponent destructor
 
virtual ICloneableModelComponentparent () const =0
 Parent ICloneableModelComponent object from which current component was cloned from.
 
virtual ICloneableModelComponentclone (const std::unordered_map< std::string, hydrocouple_variant > &clone_optional_arguments=std::unordered_map< std::string, hydrocouple_variant >())=0
 Deep clones itself including cloning its IArgument instances.
 
virtual std::vector< ICloneableModelComponent * > clones () const =0
 A vector ICloneableModelComponent instances cloned from this IModelComponent instance.
 
- Public Member Functions inherited from HydroCouple::IModelComponent
virtual ~IModelComponent ()=default
 IModelComponent::~IModelComponent destructor.
 
virtual IModelComponentInfocomponentInfo () const =0
 Contains the metadata about this IModelComponent instance.
 
virtual ComponentStatus status () const =0
 Defines current status of the IModelComponent. See IModelComponent::ComponentStatus for the possible values.
 
virtual std::vector< IArgument * > arguments () const =0
 Arguments needed to let the component do its work. An unmodifiable list of (modifiable) arguments must be returned that is to be used to get information about the arguments and to set argument values.
 
virtual std::vector< IInput * > inputs () const =0
 The list of consumer items for which a component can recieve values.
 
virtual std::vector< IOutput * > outputs () const =0
 The list of IOutputs for which a component can produce results.
 
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< std::string > validate ()=0
 Validates the populated instance of the IModelComponent.
 
virtual void prepare ()=0
 Prepares the IModelComponent for calls to the Update method.
 
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 finish ()=0
 The finish() must be invoked as the last of any methods in the IModelComponent interface.
 
virtual const IWorkflowComponentworkflow () const =0
 Gets the workflow that this component is part of.
 
virtual void setWorkflow (const IWorkflowComponent *workflow)=0
 Sets the workflow that this component is part of.
 
virtual int mpiNumOfProcesses () const =0
 Gets the number of MPI processes allocated to this component.
 
virtual int mpiProcessRank () const =0
 mpiProcess is the MPI process/rank of this component.
 
virtual void mpiSetProcessRank (int processRank)=0
 mpiSetProcess sets the rank for the mpi process associated with this instance of the model.
 
virtual std::set< int > mpiAllocatedProcesses () const =0
 Gets the set of MPI processes/ranks allocated to this component.
 
virtual void mpiAllocateProcesses (const std::set< int > &mpiProcessesToAllocate)=0
 mpiAllocateResources allocates the specified MPI processes/ranks to this component.
 
virtual void mpiClearAllocatedProcesses ()=0
 Clears all MPI processes/ranks allocated to this component.
 
virtual std::string referenceDirectory () const =0
 Gets the reference directory for this component instance.
 
virtual void setReferenceDirectory (const std::string &referenceDirectory)=0
 setReferenceDirectory Sets the reference directory for this component instance.
 
virtual bool hasEditor () const =0
 hasEditor indicates whether this IComponentItem has a UI editor.
 
virtual void showEditor (void *opaqueUIPointer=nullptr)=0
 showEditor shows the editor for this IComponentItem.
 
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.
 
- Public Member Functions inherited from HydroCouple::IIdentity
virtual ~IIdentity ()=default
 IIdentity::~IIdentity is a virtual destructor.
 
virtual const std::string & id () const =0
 Gets a unique identifier for the entity.
 
- Public Member Functions inherited from HydroCouple::IDescription
virtual ~IDescription ()=default
 IDescription::~IDescription is a virtual destructor.
 
virtual const std::string & caption () const =0
 Gets caption for the entity.
 
virtual void setCaption (const std::string &caption)=0
 Sets caption for the entity.
 
virtual const std::string & description () const =0
 Gets additional descriptive information for the entity.
 
virtual void setDescription (const std::string &description)=0
 Gets additional descriptive information for the entity.
 
- Public Member Functions inherited from HydroCouple::IPropertyChanged
virtual ~IPropertyChanged ()=default
 IPropertyChanged::~IPropertyChanged is a virtual destructor.
 
- Public Member Functions inherited from HydroCouple::ISignal< std::string >
virtual ~ISignal ()=default
 ISignal::~ISignal is a virtual destructor.
 
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.
 
- Public Member Functions inherited from HydroCouple::ISignal< const std::shared_ptr< IComponentStatusChangeEventArgs > & >
virtual ~ISignal ()=default
 ISignal::~ISignal is a virtual destructor.
 
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.
 

Additional Inherited Members

- Public Types inherited from HydroCouple::IModelComponent
enum class  ComponentStatus {
  Created ,
  Initializing ,
  Initialized ,
  Validating ,
  Valid ,
  WaitingForData ,
  Invalid ,
  Preparing ,
  Updating ,
  Updated ,
  Done ,
  Finishing ,
  Finished ,
  Failed
}
 HydroCouple::ComponentStatus is an enumerator that describes the status of a component over the course of its lifetime. More...
 
- Protected Member Functions inherited from HydroCouple::ISignal< std::string >
virtual void emit (Args... args)=0
 emit is used to emit the signal.
 
- Protected Member Functions inherited from HydroCouple::ISignal< const std::shared_ptr< IComponentStatusChangeEventArgs > & >
virtual void emit (Args... args)=0
 emit is used to emit the signal.
 

Detailed Description

The ICloneableModelComponent class is an IModelComponent that supports deep cloning of itself and its configuration.

Constructor & Destructor Documentation

◆ ~ICloneableModelComponent()

virtual HydroCouple::ICloneableModelComponent::~ICloneableModelComponent ( )
virtualdefault

~ICloneableModelComponent destructor

Member Function Documentation

◆ clone()

virtual ICloneableModelComponent * HydroCouple::ICloneableModelComponent::clone ( const std::unordered_map< std::string, hydrocouple_variant > &  clone_optional_arguments = std::unordered_map< std::string, hydrocouple_variant >())
pure virtual

Deep clones itself including cloning its IArgument instances.

Parameters
[in]clone_optional_argumentsare optional arguments that can be passed to the clone method. These arguments are used to pass additional information to the clone method. The arguments are specific to the component being cloned.
Returns
A deep clone of the current component. Configuration files and output files must be written to a different location than those of the parent. Cloning can only occur after the parent component has been initialized successfully. Cloned components must also be initialized.

◆ clones()

virtual std::vector< ICloneableModelComponent * > HydroCouple::ICloneableModelComponent::clones ( ) const
pure virtual

A vector ICloneableModelComponent instances cloned from this IModelComponent instance.

Returns
A vector of child components created from the current component.

◆ parent()

virtual ICloneableModelComponent * HydroCouple::ICloneableModelComponent::parent ( ) const
pure virtual

Parent ICloneableModelComponent object from which current component was cloned from.

Returns
The parent ICloneableModelComponent from which the current component was created.

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