IOLink 1.16.1
Loading...
Searching...
No Matches
iolink::ColumnRenamingExtension Class Referenceabstract

Extension to provide the way to rename a column. More...

#include <iolink/view/ColumnRenamingExtension.h>

Inheritance diagram for iolink::ColumnRenamingExtension:
iolink::Extension

Public Member Functions

virtual void setColumnName (const std::string &columnName, const std::string &newName)=0
 Set the name of a column identified with its name.
 
virtual void setColumnName (size_t index, const std::string &newName)=0
 Set the name of a column identified with its index.
 

Static Public Member Functions

static std::shared_ptr< ColumnRenamingExtensioncast (const std::shared_ptr< Extension > &extension)
 Upcast a generic extension to this specific type.
 

Static Public Attributes

static constexpr size_t EXTENSION_ID = 0x5
 Identifier used to load the extension using the View::extension method.
 

Detailed Description

Extension to provide the way to rename a column.

This extension allows to set the name of a column in a dataframe.

Member Function Documentation

◆ cast()

static std::shared_ptr< ColumnRenamingExtension > iolink::ColumnRenamingExtension::cast ( const std::shared_ptr< Extension > &  extension)
inlinestatic

Upcast a generic extension to this specific type.

Parameters
extensionThe extension to cast.
Returns
The upcasted extension. This will be null if no upcasting is possible.

◆ setColumnName() [1/2]

virtual void iolink::ColumnRenamingExtension::setColumnName ( const std::string &  columnName,
const std::string &  newName 
)
pure virtual

Set the name of a column identified with its name.

Parameters
columnNameThe name of the column to rename.
newNameThe name to assign to the column.
Exceptions
Errorif the given column name does not exist in the DataFrame.
InvalidArgumentif the given new name already exists in the DataFrame.
Errorif DataFrameView does not have the WRITE capability.

◆ setColumnName() [2/2]

virtual void iolink::ColumnRenamingExtension::setColumnName ( size_t  index,
const std::string &  newName 
)
pure virtual

Set the name of a column identified with its index.

Parameters
columnIndexThe index of the column to rename.
newNameThe name to assign to the column.
Exceptions
Errorif the given column index is out of range.
InvalidArgumentif the given new name already exists in the DataFrame.
Errorif DataFrameView does not have the WRITE capability.

The documentation for this class was generated from the following file: