|
virtual DataFrameCapabilitySet | capabilities () const =0 |
| Return the view's capabilities. More...
|
|
virtual const Vector2u64 & | shape () const =0 |
| Return the shape of the data frame. More...
|
|
virtual const std::string & | columnName (size_t index) const =0 |
| Get the name of a column from its index. More...
|
|
virtual size_t | columnIndex (const std::string &name) const =0 |
| Get the index of a column from its name. More...
|
|
virtual DataType | columnDataType (size_t index) const =0 |
| Return the data type of the column. More...
|
|
virtual void | read (size_t column, size_t offset, size_t count, void *dst) const |
| Read data from a column. More...
|
|
template<typename T > |
T | at (size_t column, size_t row) const |
| Get the value stored in a cell of the data frame. More...
|
|
template<typename T > |
T | at (const std::string &columnName, size_t row) const |
| Get the value stored in a cell of the data frame. More...
|
|
virtual void | write (size_t column, size_t offset, size_t count, const void *src) |
| Write data into a column. More...
|
|
template<typename T > |
void | setAt (size_t column, size_t row, T value) |
| Set the element value in a cell of the data frame. More...
|
|
template<typename T > |
void | setAt (const std::string &columnName, size_t row, T value) |
| Set the element value in a cell of the data frame. More...
|
|
virtual void | addColumn (const std::string &name, DataType dtype) |
| Add a column to the dataframe. More...
|
|
virtual void | addRows (size_t offset, size_t count) |
| Insert rows at the specified position. More...
|
|
virtual void | removeColumn (size_t index) |
| Remove a column. More...
|
|
virtual void | removeRows (size_t offset, size_t count) |
| Remove a continuous set of rows. More...
|
|
std::string | toString () const |
| Return a string representation.
|
|
virtual std::shared_ptr< Extension > | extension (size_t id) |
| Get an extension of the view, corresponding to the given identifier. More...
|
|
std::shared_ptr< ViewOriginExtension > | viewOrigin () |
| Shortcut to access to ViewOrigin extension.
|
|
View to model tabular data.
This view is composed of a set of columns, that have a name and a data type. A column's name is unique, and columns in a dataframe can have different data types.
Each column has the same number of elements. The aggregate of all n-th elements of columns are a row of the dataframe.
virtual void iolink::DataFrameView::read |
( |
size_t |
column, |
|
|
size_t |
offset, |
|
|
size_t |
count, |
|
|
void * |
dst |
|
) |
| const |
|
virtual |
Read data from a column.
This method requires the READ capability.
When reading numeric data, the dst buffer will be filled with continuous values. In the case of strings, it will be a continuous array of string objects.
The destination buffer must be allocated by the user. If its size is under the byte count needed to store the request number of elements, a segmentation fault will rise, as there is no boundaries check.
- Parameters
-
column | The index of the column to read from. |
offset | The index of the first element to read. |
count | The number of elements to read. |
dst | A buffer where the read data will be written. |
- Exceptions
-
NotImplemented | When the view does not support reading. |
Error | When dst is null. |
Error | When the column index is invalid. |
Error | When offset is out of bounds. |
Error | If it is impossible to read the number of elements required. |
virtual void iolink::DataFrameView::write |
( |
size_t |
column, |
|
|
size_t |
offset, |
|
|
size_t |
count, |
|
|
const void * |
src |
|
) |
| |
|
virtual |
Write data into a column.
This method requires the WRITE capability.
When writing numeric data, the src buffer must be filled with continuous values. In the case of strings, the source must use a continuous array of string objects.
The source buffer must be allocated by the user. If its size is under the byte count needed to store the request number of elements, a segmentation fault will rise, as there is no boundaries check.
- Parameters
-
column | The index of the column to write into. |
offset | The index of the first element to write. |
count | The number of element to write. |
dst | A buffer whose content will be written in the column. |
- Exceptions
-
NotImplemented | When the view does not support writing. |
Error | When src is null. |
Error | When the column index is invalid. |
Error | When offset is out of bounds. |
Error | If it is impossible to write the number of elements required. |