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

A class of I/O component that a driver supports. More...

#include <io/ComponentClass.hpp>

Public Member Functions

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

Static Public Attributes

Standard Names
static const std::string_view kDevice
 The standard name for generic devices.
 
static const std::string_view kSubDevice
 The standard name for generic sub devices.
 
static const std::string_view kBus
 The standard name for a bus.
 
static const std::string_view kPort
 The standard name for a port.
 
static const std::string_view kPlc
 The standard name for a PLC.
 
static const std::string_view kCpu
 The standard name for a single CPU within a redundant PLC.
 
static const std::string_view kController
 The standard name for a bus controller.
 
static const std::string_view kCoupler
 The standard name for a bus coupler.
 
static const std::string_view kBoard
 The standard name for an I/O board.
 
static const std::string_view kModule
 The standard name for a module for a board, PLC, controller, coupler etc.
 
static const std::string_view kIoGroup
 The standard name for a group of generic I/O point on a board.
 
static const std::string_view kInputGroup
 The standard name for a group of generic inputs on a board.
 
static const std::string_view kOutputGroup
 The standard name for a group of generic outputs on a board.
 
static const std::string_view kChannelGroup
 The standard name for a group of channels on a board.
 
static const std::string_view kInterface
 The standard name for a generic interface.
 
static const std::string_view kTerminal
 The standard name for a terminal with multiple I/Os.
 
static const std::string_view kConnector
 The standard name for a connector with multiple I/Os.
 
static const std::string_view kRack
 The standard name for a rack of I/Os.
 
static const std::string_view kSlot
 The standard name for a slot in a module, terminal, rack, board etc.
 
static const std::string_view kServer
 The standard name for the server in a client/server architecture.
 
static const std::string_view kClient
 The standard name for the client in a client/server architecture.
 
static const std::string_view kMaster
 The standard name for the master in a master/slave architecture.
 
static const std::string_view kSlave
 The standard name for the slave in a master/slave architecture.
 
static const std::string_view kNode
 The standard name for a generic node.
 

Protected Member Functions

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

Detailed Description

A class of I/O component that a driver supports.

See also
xentara::io::Component
I/O Component Classes
Examples
LoadingElementConfig.cpp, and PublishingConfigAttributes.cpp.

Constructor & Destructor Documentation

◆ ~ComponentClass()

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

Virtual destructor.

Member Function Documentation

◆ config()

auto xentara::io::ComponentClass::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 components 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::ComponentClass::name ( ) const -> std::string_view
pure virtual

Gets the name of the component 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::ComponentClass::nameHandle ( ) const -> memory::Array::ObjectHandle< std::string >
noexcept

Gets an array handle to the name of a component.

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

◆ primaryKeyHandle()

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

Gets an array handle to the primary key of a component.

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 component’s key during loading. Specifically, the returned handle should not be used from within loadConfig().
Returns
A handle to the component’s primary key in UTF-8 encoding.

◆ uuid()

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

Gets the UUID of the component class.

◆ uuidHandle()

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

Gets an array handle to the UUID of a component.

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

Member Data Documentation

◆ kBoard

const std::string_view xentara::io::ComponentClass::kBoard
static

The standard name for an I/O board.

◆ kBus

const std::string_view xentara::io::ComponentClass::kBus
static

The standard name for a bus.

◆ kChannelGroup

const std::string_view xentara::io::ComponentClass::kChannelGroup
static

The standard name for a group of channels on a board.

◆ kClient

const std::string_view xentara::io::ComponentClass::kClient
static

The standard name for the client in a client/server architecture.

◆ kConnector

const std::string_view xentara::io::ComponentClass::kConnector
static

The standard name for a connector with multiple I/Os.

◆ kController

const std::string_view xentara::io::ComponentClass::kController
static

The standard name for a bus controller.

◆ kCoupler

const std::string_view xentara::io::ComponentClass::kCoupler
static

The standard name for a bus coupler.

◆ kCpu

const std::string_view xentara::io::ComponentClass::kCpu
static

The standard name for a single CPU within a redundant PLC.

◆ kDevice

const std::string_view xentara::io::ComponentClass::kDevice
static

The standard name for generic devices.

◆ kInputGroup

const std::string_view xentara::io::ComponentClass::kInputGroup
static

The standard name for a group of generic inputs on a board.

◆ kInterface

const std::string_view xentara::io::ComponentClass::kInterface
static

The standard name for a generic interface.

◆ kIoGroup

const std::string_view xentara::io::ComponentClass::kIoGroup
static

The standard name for a group of generic I/O point on a board.

◆ kMaster

const std::string_view xentara::io::ComponentClass::kMaster
static

The standard name for the master in a master/slave architecture.

◆ kModule

const std::string_view xentara::io::ComponentClass::kModule
static

The standard name for a module for a board, PLC, controller, coupler etc.

◆ kNode

const std::string_view xentara::io::ComponentClass::kNode
static

The standard name for a generic node.

◆ kOutputGroup

const std::string_view xentara::io::ComponentClass::kOutputGroup
static

The standard name for a group of generic outputs on a board.

◆ kPlc

const std::string_view xentara::io::ComponentClass::kPlc
static

The standard name for a PLC.

◆ kPort

const std::string_view xentara::io::ComponentClass::kPort
static

The standard name for a port.

◆ kRack

const std::string_view xentara::io::ComponentClass::kRack
static

The standard name for a rack of I/Os.

◆ kServer

const std::string_view xentara::io::ComponentClass::kServer
static

The standard name for the server in a client/server architecture.

◆ kSlave

const std::string_view xentara::io::ComponentClass::kSlave
static

The standard name for the slave in a master/slave architecture.

◆ kSlot

const std::string_view xentara::io::ComponentClass::kSlot
static

The standard name for a slot in a module, terminal, rack, board etc.

◆ kSubDevice

const std::string_view xentara::io::ComponentClass::kSubDevice
static

The standard name for generic sub devices.

◆ kTerminal

const std::string_view xentara::io::ComponentClass::kTerminal
static

The standard name for a terminal with multiple I/Os.