IComponentDataItem is a fundamental unit of data for a component. More...
#include <hydrocouple.h>
Public Member Functions | |
| 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. | |
IComponentDataItem is a fundamental unit of data for a component.
This interface is not to be implemented directly; implement one of its specializations (IExchangeItem, IArgument, or a domain data item).
Data access is typed and bulk-oriented: all field data moves through getValuesInto()/setValuesFrom() as BufferDescriptor hyperslabs. The item's full index space is given by shape(); dimension semantics (which axis is time, entity, layer, ...) are described by dimensions() and by the canonical orderings defined in each specialization's documentation. A hyperslab is selected by a start index and a count per dimension, exactly as in HDF5 hyperslab selections. Scalar and span-based convenience helpers are provided as non-virtual templates over the same bulk path.
Threading contract: after the owning component reaches HydroCouple::ComponentStatus::Initialized, metadata getters are safe for concurrent reads; getValuesInto() calls are safe concurrently with each other but not with setValuesFrom() or with the owning component's update(); lifecycle methods require external synchronization.
|
virtualdefault |
IComponentDataItem::~IComponentDataItem is a virtual destructor.
|
nodiscardpure virtual |
The element type of this data item's values.
|
nodiscardpure virtual |
The axes of this item's index space, in storage order.
Parallel to shape(). Each IDimension::role() names what its axis means, and the sequence must match the canonical ordering documented by this item's specialization. Non-owning observers valid for the lifetime of the item.
|
nodiscardpure virtual |
Copies a hyperslab of this item's values into a caller-described buffer.
The selection is the box [start[k], start[k] + count[k]) in each dimension k of shape(). destination.kind must equal dataKind() (no implicit conversion), destination.itemSizeBytes must be 0 or the kind's size (and, for Opaque, must match what this item stores), and destination's element count must equal the product of count. Items that cannot service the destination's memory space return false with a message (host-only items accept MemorySpace::Host; device support is advertised component-wide via Capability::DeviceBuffers). A non-null destination.queue lets a device-capable item enqueue the copy on that stream and return before it completes; the caller then synchronizes the stream. When destination is C-contiguous and the selection is contiguous in this item's storage, implementations should degenerate to memcpy. A false return also queues a Severity::Error entry on the owning component (error-channel convention).
| [in] | destination | describes the buffer receiving the values. |
| [in] | start | is the first index of the selection in each dimension; its length must equal the rank of shape(). |
| [in] | count | is the selection extent in each dimension; its length must equal the rank of shape(). |
| [out] | message | optionally receives a failure description. |
|
nodiscardpure virtual |
Gets the owner IModelComponent of this IComponentItem.
For an IOutput component item this is the component responsible for providing the content of the IOutput.
It is possible for an IComponentItem to have no owner, in this case the method will return nullptr.
|
nodiscardpure virtual |
Copies values from a caller-described buffer into a hyperslab of this item.
Selection and compatibility rules are identical to getValuesInto().
| [in] | source | describes the buffer providing the values. |
| [in] | start | is the first index of the selection in each dimension; its length must equal the rank of shape(). |
| [in] | count | is the selection extent in each dimension; its length must equal the rank of shape(). |
| [out] | message | optionally receives a failure description. |
|
nodiscardpure virtual |
The extent of each dimension of this data item's index space.
The returned vector is parallel to dimensions(). Dynamic dimensions report their current extent.
|
nodiscardpure virtual |
IValueDefinition for this IComponentDataItem defines the variable type associated with this object.