5#include <iolink/DataType.h>
6#include <iolink/FlagSet.h>
7#include <iolink/IOLinkAPI.h>
8#include <iolink/VectorX.h>
9#include <iolink/view/View.h>
26extern template class IOLINK_API_IMPORT FlagSet<DataFrameCapability>;
72 virtual const std::string&
columnName(
size_t index)
const = 0;
81 virtual size_t columnIndex(
const std::string& name)
const = 0;
120 virtual void read(
size_t column,
size_t offset,
size_t count,
void* dst)
const;
134 template <
typename T>
135 inline T
at(
size_t column,
size_t row)
const
138 this->read(column, row, 1, &value);
155 template <
typename T>
156 inline T
at(
const std::string& columnName,
size_t row)
const
158 return this->at<T>(this->columnIndex(columnName), row);
189 virtual void write(
size_t column,
size_t offset,
size_t count,
const void* src);
203 template <
typename T>
204 inline void setAt(
size_t column,
size_t row, T value)
206 this->write(column, row, 1, &value);
221 template <
typename T>
222 inline void setAt(
const std::string& columnName,
size_t row, T value)
224 this->setAt<T>(this->columnIndex(columnName), row, value);
263 virtual void addRows(
size_t offset,
size_t count);
View to model tabular data.
Definition: DataFrameView.h:47
T at(size_t column, size_t row) const
Get the value stored in a cell of the data frame.
Definition: DataFrameView.h:135
virtual void addRows(size_t offset, size_t count)
Insert rows at the specified position.
virtual const Vector2u64 & shape() const =0
Return the shape of the data frame.
virtual DataFrameCapabilitySet capabilities() const =0
Return the view's capabilities.
virtual DataType columnDataType(size_t index) const =0
Return the data type of the column.
virtual size_t columnIndex(const std::string &name) const =0
Get the index of a column from its name.
virtual void removeRows(size_t offset, size_t count)
Remove a continuous set of rows.
void setAt(size_t column, size_t row, T value)
Set the element value in a cell of the data frame.
Definition: DataFrameView.h:204
virtual const std::string & columnName(size_t index) const =0
Get the name of a column from its index.
virtual void removeColumn(size_t index)
Remove a column.
virtual void write(size_t column, size_t offset, size_t count, const void *src)
Write data into a column.
T at(const std::string &columnName, size_t row) const
Get the value stored in a cell of the data frame.
Definition: DataFrameView.h:156
std::string toString() const
Return a string representation.
virtual void addColumn(const std::string &name, DataType dtype)
Add a column to the dataframe.
virtual void read(size_t column, size_t offset, size_t count, void *dst) const
Read data from a column.
void setAt(const std::string &columnName, size_t row, T value)
Set the element value in a cell of the data frame.
Definition: DataFrameView.h:222
Stores information about a data type.
Definition: DataType.h:162
Template class to handle a flags system from an enum.
Definition: FlagSet.h:43
An arithmetic vector.
Definition: Vector.h:37
Interface representing a generic view on data.
Definition: View.h:16
All IOLink symbols are enclosed in this namespace.
Definition: ArrayX.h:8
@ WRITE
Data can be written.
DataFrameCapability
Capabilities of dataframes instances.
Definition: DataFrameView.h:20
@ RESHAPE
Ability to add or remove columns and rows.