xentara-plugin v1.2.1
The Xentara Plugin Framework
Loading...
Searching...
No Matches
xentara::io::IoClass Class Referenceabstract

A type of I/O point that a driver supports. More...

#include <io/IoClass.hpp>

Public Member Functions

virtual internal ~IoClass ()=0
 Virtual destructor.
 
virtual auto name () const -> std::string_view=0
 Gets the name of the I/O point class.
 
virtual auto uuid () const -> utils::core::Uuid=0
 Gets the UUID of the I/O type.
 
auto nameHandle () const noexcept -> memory::Array::ObjectHandle< std::string >
 Gets an array handle to the name of an I/O point.
 
auto primaryKeyHandle () const noexcept -> memory::Array::ObjectHandle< std::string >
 Gets an array handle to the primary key of an I/O point.
 
auto uuidHandle () const noexcept -> memory::Array::ObjectHandle< utils::core::Uuid >
 Gets an array handle to the UUID of an I/O point.
 

Static Public Attributes

Standard Names
static const std::string_view kIo
 The standard name for a generic I/O point.
 
static const std::string_view kInput
 The standard name for a generic input.
 
static const std::string_view kOutput
 The standard name for a generic output.
 
static const std::string_view kDigitalIo
 The standard name for a digital I/O point.
 
static const std::string_view kDigitalInput
 The standard name for a digital input.
 
static const std::string_view kDigitalOutput
 The standard name for a digital output.
 
static const std::string_view kAnalogIo
 The standard name for an analog I/O point.
 
static const std::string_view kAnalogInput
 The standard name for an analog input.
 
static const std::string_view kAnalogOutput
 The standard name for an analog output.
 
static const std::string_view kVariable
 The standard name for a variable.
 
static const std::string_view kRegister
 The standard name for a register.
 
static const std::string_view kChannel
 The standard name for a channel.
 
static const std::string_view kPin
 The standard name for a pin.
 
static const std::string_view kBit
 The standard name for a bit.
 

Protected Member Functions

auto config () -> memory::Array &
 Gets the array object used for the configuration attributes.
 

Detailed Description

A type of I/O point that a driver supports.

See also
xentara::io::Io
I/O Point Classes

Constructor & Destructor Documentation

◆ ~IoClass()

xentara::io::IoClass::~IoClass ( )
pure virtualdefault

Virtual destructor.

Member Function Documentation

◆ config()

auto xentara::io::IoClass::config ( ) -> memory::Array &
protected

Gets the array object used for the configuration attributes.

This function returns the object that the framework will be using to allocate the memory block that contains the configuration attributes. You can call this function in the constructor to add confioguration attributes of your own.

You do not need to add the entire configuration of the I/O points to this array, only the configuration parameters you intend to publish as Xentara attributes.

See also
Publishing Config Parameters as Xentara Attributes

◆ name()

virtual auto xentara::io::IoClass::name ( ) const -> std::string_view
pure virtual

Gets the name of the I/O point class.

To keep naming conventions as consistent as possible between drivers, Xentara provides a set of predefined type names. All things being equal, you should prefer using one of the predefines names. If the documentation, the specification, or common usage for your I/O method use different nomenclature, however, you should prefer that over the standard names.

Returns
The name of the class, in UTF-8 encoding.

◆ nameHandle()

auto xentara::io::IoClass::nameHandle ( ) const -> memory::Array::ObjectHandle< std::string >
noexcept

Gets an array handle to the name of an I/O point.

Note
Since the name of the I/O point is part of its configuration, the returned handle should only be used once the I/O point’s configuration has been fully loaded.
Returns
A handle to the I/O point’s name in UTF-8 encoding.

◆ primaryKeyHandle()

auto xentara::io::IoClass::primaryKeyHandle ( ) const -> memory::Array::ObjectHandle< std::string >
noexcept

Gets an array handle to the primary key of an I/O point.

Note
Since the primary key is only fully known once the configuration has been completely loaded, the returned handle should not be used to get the I/O point’s key during loading. Specifically, the returned handle should not be used from within loadConfig().
Returns
A handle to the I/O point’s primary key in UTF-8 encoding.

◆ uuid()

virtual auto xentara::io::IoClass::uuid ( ) const -> utils::core::Uuid
pure virtual

Gets the UUID of the I/O type.

◆ uuidHandle()

auto xentara::io::IoClass::uuidHandle ( ) const -> memory::Array::ObjectHandle< utils::core::Uuid >
noexcept

Gets an array handle to the UUID of an I/O point.

Note
Since the UUID of the I/O point is part of its configuration, this function should only be called once the I/O point’s configuration has been fully loaded.

Member Data Documentation

◆ kAnalogInput

const std::string_view xentara::io::IoClass::kAnalogInput
static

The standard name for an analog input.

◆ kAnalogIo

const std::string_view xentara::io::IoClass::kAnalogIo
static

The standard name for an analog I/O point.

◆ kAnalogOutput

const std::string_view xentara::io::IoClass::kAnalogOutput
static

The standard name for an analog output.

◆ kBit

const std::string_view xentara::io::IoClass::kBit
static

The standard name for a bit.

◆ kChannel

const std::string_view xentara::io::IoClass::kChannel
static

The standard name for a channel.

◆ kDigitalInput

const std::string_view xentara::io::IoClass::kDigitalInput
static

The standard name for a digital input.

◆ kDigitalIo

const std::string_view xentara::io::IoClass::kDigitalIo
static

The standard name for a digital I/O point.

◆ kDigitalOutput

const std::string_view xentara::io::IoClass::kDigitalOutput
static

The standard name for a digital output.

◆ kInput

const std::string_view xentara::io::IoClass::kInput
static

The standard name for a generic input.

◆ kIo

const std::string_view xentara::io::IoClass::kIo
static

The standard name for a generic I/O point.

◆ kOutput

const std::string_view xentara::io::IoClass::kOutput
static

The standard name for a generic output.

◆ kPin

const std::string_view xentara::io::IoClass::kPin
static

The standard name for a pin.

◆ kRegister

const std::string_view xentara::io::IoClass::kRegister
static

The standard name for a register.

◆ kVariable

const std::string_view xentara::io::IoClass::kVariable
static

The standard name for a variable.