![]() |
HydroCouple
2.0.0-alpha.1
HydroCouple Interface Definitions
|
Non-normative convenience helpers for the HydroCouple interface standard. More...
Classes | |
| struct | DataKindOf |
| DataKindOf maps a C++ type to its DataKind at compile time. More... | |
| struct | DataKindOf< bool > |
| struct | DataKindOf< double > |
| struct | DataKindOf< float > |
| struct | DataKindOf< int16_t > |
| struct | DataKindOf< int32_t > |
| struct | DataKindOf< int64_t > |
| struct | DataKindOf< int8_t > |
| struct | DataKindOf< std::string > |
| struct | DataKindOf< uint16_t > |
| struct | DataKindOf< uint32_t > |
| struct | DataKindOf< uint64_t > |
| struct | DataKindOf< uint8_t > |
Functions | |
| constexpr int64_t | dataKindSize (DataKind kind) |
| Size in bytes of one element of the given DataKind. | |
| constexpr int64_t | elementCount (const BufferDescriptor &d) |
| Number of elements a BufferDescriptor describes (product of shape; 1 for rank 0). | |
| constexpr bool | isContiguous (const BufferDescriptor &d) |
| Checks whether a BufferDescriptor's layout is C-contiguous (row-major, packed). | |
| constexpr int64_t | byteOffset (const BufferDescriptor &d, std::span< const int64_t > index) |
| Byte offset from a descriptor's base address of the element at the given index. | |
| constexpr int64_t | contiguousByteSize (const BufferDescriptor &d) |
| Total byte extent of a C-contiguous buffer of the descriptor's shape and kind. | |
| constexpr BufferDescriptor | makeContiguous (void *data, DataKind kind, std::span< const int64_t > shape) |
| Builds a C-contiguous host BufferDescriptor. | |
| constexpr bool | isValidComponentStatusTransition (IModelComponent::ComponentStatus from, IModelComponent::ComponentStatus to) |
| Encodes the normative component lifecycle state machine. | |
| template<typename T> | |
| bool | getValue (const IComponentDataItem &item, T &value, std::span< const int64_t > index) |
| Typed convenience: reads the single element at the given index of a data item. | |
| template<typename T> | |
| bool | setValue (IComponentDataItem &item, const T &value, std::span< const int64_t > index) |
| Typed convenience: writes the single element at the given index of a data item. | |
| template<typename T> | |
| bool | getValues (const IComponentDataItem &item, std::span< T > destination, std::span< const int64_t > start, std::span< const int64_t > count) |
| Typed convenience: reads a hyperslab into a flat contiguous span in C order. | |
| template<typename T> | |
| bool | setValues (IComponentDataItem &item, std::span< const T > source, std::span< const int64_t > start, std::span< const int64_t > count) |
| Typed convenience: writes a hyperslab from a flat contiguous span in C order. | |
Non-normative convenience helpers for the HydroCouple interface standard.
|
nodiscardconstexpr |
Byte offset from a descriptor's base address of the element at the given index.
| [in] | d | is the descriptor to query. |
| [in] | index | is the multi-dimensional element index; its length must equal d.rank. |
|
nodiscardconstexpr |
Total byte extent of a C-contiguous buffer of the descriptor's shape and kind.
| [in] | d | is the descriptor to query. |
|
constexpr |
Size in bytes of one element of the given DataKind.
| [in] | kind | is the element kind to query. |
|
nodiscardconstexpr |
Number of elements a BufferDescriptor describes (product of shape; 1 for rank 0).
| [in] | d | is the descriptor to query. |
|
nodiscard |
Typed convenience: reads the single element at the given index of a data item.
| T | is the C++ element type; DataKindOf<T>::kind must equal item.dataKind(). |
| [in] | item | is the data item to read from. |
| [out] | value | receives the element. |
| [in] | index | is the full multi-dimensional element index. |
|
nodiscard |
Typed convenience: reads a hyperslab into a flat contiguous span in C order.
| T | is the C++ element type; DataKindOf<T>::kind must equal item.dataKind(). |
| [in] | item | is the data item to read from. |
| [out] | destination | receives the selection; its size must equal the product of count. |
| [in] | start | is the first index of the selection in each dimension. |
| [in] | count | is the selection extent in each dimension. |
|
nodiscardconstexpr |
Checks whether a BufferDescriptor's layout is C-contiguous (row-major, packed).
| [in] | d | is the descriptor to query. |
|
nodiscardconstexpr |
Encodes the normative component lifecycle state machine.
Implementations must not perform status transitions for which this function returns false.
| [in] | from | is the current status. |
| [in] | to | is the proposed next status. |
|
nodiscardconstexpr |
Builds a C-contiguous host BufferDescriptor.
| [in] | data | is the base address of the buffer. |
| [in] | kind | is the element type. |
| [in] | shape | is the extent per dimension; the pointed-to array must outlive the descriptor. |
|
nodiscard |
Typed convenience: writes the single element at the given index of a data item.
| T | is the C++ element type; DataKindOf<T>::kind must equal item.dataKind(). |
| [in] | item | is the data item to write to. |
| [in] | value | is the element to write. |
| [in] | index | is the full multi-dimensional element index. |
|
nodiscard |
Typed convenience: writes a hyperslab from a flat contiguous span in C order.
| T | is the C++ element type; DataKindOf<T>::kind must equal item.dataKind(). |
| [in] | item | is the data item to write to. |
| [in] | source | provides the selection; its size must equal the product of count. |
| [in] | start | is the first index of the selection in each dimension. |
| [in] | count | is the selection extent in each dimension. |