| IOLink 1.11.0

Loading...
Searching...
No Matches
ColumnUnitExtension.h
1#pragma once
2
3#include <memory>
4#include <string>
5
6#include <iolink/IOLinkAPI.h>
7#include <iolink/view/Extension.h>
8
9 namespace iolink
10{
11
33 class IOLINK_API ColumnUnitExtension : public Extension
34{
35 public:
39 static constexpr size_t EXTENSION_ID = 0x4;
40
47 inline static std::shared_ptr<ColumnUnitExtension> cast(const std::shared_ptr<Extension>& extension)
48 {
49 return std::dynamic_pointer_cast<ColumnUnitExtension>(extension);
50 }
51
60 virtual const std::string& unit(size_t columnIndex) const = 0;
61
71 virtual void setUnit(size_t columnIndex, const std::string& unit) = 0;
72};
73
74} // namespace iolink
iolink::ColumnUnitExtension
Extension to handle units of columns in a dataframe.
Definition ColumnUnitExtension.h:34
iolink::ColumnUnitExtension::cast
static std::shared_ptr< ColumnUnitExtension > cast(const std::shared_ptr< Extension > &extension)
Upcast a generic extension to this specific type.
Definition ColumnUnitExtension.h:47
iolink::ColumnUnitExtension::setUnit
virtual void setUnit(size_t columnIndex, const std::string &unit)=0
Set the unit of the column.
iolink::ColumnUnitExtension::unit
virtual const std::string & unit(size_t columnIndex) const =0
Return the unit of the column.
iolink::Extension
Parent class for all views extensions.
Definition Extension.h:25
iolink
All IOLink symbols are enclosed in this namespace.
Definition ArrayX.h:8