Loading...
Searching...
No Matches
HydroCouple::IInput Class Referenceabstract

An IInput item that can accept values for an IModelComponent. More...

#include <hydrocouple.h>

Inheritance diagram for HydroCouple::IInput:
Collaboration diagram for HydroCouple::IInput:

Public Member Functions

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 setProvider (IOutput *provider)=0
 Records the producer this consumer gets its values from.
 
virtual bool canConsume (IOutput *provider, std::string &message) const =0
 Returns true if this IInput can consume this producer.
 
- Public Member Functions inherited from HydroCouple::IExchangeItem
virtual ~IExchangeItem ()=default
 IExchangeItem::~IExchangeItem is a virtual destructor.
 
- Public Member Functions inherited from HydroCouple::IComponentDataItem
virtual ~IComponentDataItem ()=default
 IComponentDataItem::~IComponentDataItem is a virtual destructor.
 
virtual IModelComponent * modelComponent () const =0
 Gets the owner IModelComponent of this IComponentItem.
 
virtual std::vector< IDimension * > dimensions () const =0
 The axes of this item's index space, in storage order.
 
virtual std::vector< int64_t > shape () const =0
 The extent of each dimension of this data item's index space.
 
virtual DataKind dataKind () const =0
 The element type of this data item's values.
 
virtual IValueDefinition * valueDefinition () const =0
 IValueDefinition for this IComponentDataItem defines the variable type associated with this object.
 
virtual bool getValuesInto (const BufferDescriptor &destination, std::span< const int64_t > start, std::span< const int64_t > count, std::string *message=nullptr) const =0
 Copies a hyperslab of this item's values into a caller-described buffer.
 
virtual bool setValuesFrom (const BufferDescriptor &source, std::span< const int64_t > start, std::span< const int64_t > count, std::string *message=nullptr)=0
 Copies values from a caller-described buffer into a hyperslab of this item.
 
- 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< IComponentDataItemValueChanged > & >
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

- 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< IComponentDataItemValueChanged > & >
virtual void emit (Args... args)=0
 emit is used to emit the signal.
 

Detailed Description

An IInput item that can accept values for an IModelComponent.

Constructor & Destructor Documentation

◆ ~IInput()

virtual HydroCouple::IInput::~IInput ( )
virtualdefault

IInput::~IInput is a virtual destructor.

Member Function Documentation

◆ canConsume()

virtual bool HydroCouple::IInput::canConsume ( IOutput * provider,
std::string & message ) const
nodiscardpure virtual

Returns true if this IInput can consume this producer.

Parameters
provideris the IOutput that can supply the data to this IInput.
messageThe error message from the canConsume function.

Implemented in HydroCouple::IMultiInput.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ provider()

virtual IOutput * HydroCouple::IInput::provider ( ) const
nodiscardpure virtual

Gets the producer this consumer should get its values from.

An IMultiInput returns nullptr: its providers are read through IMultiInput::providers(), so code that walks connections checks for a multi-input first.

Here is the caller graph for this function:

◆ setProvider()

virtual bool HydroCouple::IInput::setProvider ( IOutput * provider)
nodiscardpure virtual

Records the producer this consumer gets its values from.

Called by IOutput::addConsumer() (with the output) and IOutput::removeConsumer() (with nullptr) — the output is the single entry point for wiring, and orchestrators must not call this directly. An implementation may still refuse (returning false) if it holds a different provider; the output then treats the wiring as failed. A conforming output never calls this on an IMultiInput; it calls IMultiInput::addProvider()/removeProvider() instead.

Parameters
provideris the IOutput that supplies the data to this IInput, or nullptr.
Returns
True if the provider was recorded.
Here is the call graph for this function:

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