3#include <iolink/DataType.h>
4#include <iolink/FlagSet.h>
5#include <iolink/IOLinkAPI.h>
6#include <iolink/Indexer.h>
7#include <iolink/RegionX.h>
8#include <iolink/VectorX.h>
9#include <iolink/view/View.h>
28extern template class IOLINK_API_IMPORT FlagSet<TensorCapability>;
132 template <
typename T>
138 this->read(region, &value);
169 template <
typename T>
174 this->write(region, &value);
Stores information about a data type.
Definition DataType.h:162
Template class to handle a flags system from an enum.
Definition FlagSet.h:43
bool has(FlagSet flags) const
Check if a given set of flags is true.
Definition FlagSet.h:83
This class is used to index a classic array into a multi dimensional array.
Definition Indexer.h:36
A Region using dynamic vectors.
Definition RegionX.h:14
A model of a tensor.
Definition TensorView.h:51
virtual void * buffer()
Get a mutable pointer to the underlying memory buffer.
T at(const VectorXu64 &index) const
Get data from a specific index in the tensor.
Definition TensorView.h:133
virtual TensorCapabilitySet capabilities() const =0
Get the capabilities of the tensor.
virtual size_t bufferSize() const
Get the size in bytes of the underlying buffer.
bool support(TensorCapabilitySet capabilities) const
Shortcut to check if capabilities are supported by the tensor.
Definition TensorView.h:74
std::string toString() const
Return a string representation.
void setAt(const VectorXu64 &index, T value)
Set a value at a specific index in the tensor.
Definition TensorView.h:170
virtual void read(const RegionXu64 ®ion, void *dst) const
Read data from a given region into a destination buffer.
virtual void write(const RegionXu64 ®ion, const void *src)
Write data from a source buffer into a given region of the tensor.
virtual const VectorXu64 & shape() const =0
Get the shape of the tensor.
virtual const void * buffer() const
Get an immutable pointer to the underlying memory buffer.
virtual ~TensorView()=default
Virtual destructor to support polymorphism.
virtual DataType dtype() const =0
Get the data type of the tensor.
virtual const Indexer & indexer() const
Get the indexer for the tensor underlying buffer.
size_t dimensionCount() const
Shortcut to get the number of dimensions of the tensor.
Definition TensorView.h:90
A dynamically sized arithmetic vector.
Definition VectorX.h:18
static VectorX createUniform(size_t size, ValueType value)
Creates a vector filled with one value.
Interface representing a generic view on data.
Definition View.h:16
All IOLink symbols are enclosed in this namespace.
Definition ArrayX.h:8
TensorCapability
Definition TensorView.h:15
@ MEMORY_ACCESS
Accessing internal CPU memory buffer.
@ WRITE
Data can be written.
@ RESHAPE
Ability to add or remove columns and rows.