xentara-plugin v2.0.4
The Xentara Plugin Framework
Loading...
Searching...
No Matches
xentara::io::Component Class Referenceabstract

deprecated Deprecated base class for I/O component elements More...

#include <xentara/io/Component.hpp>

+ Inheritance diagram for xentara::io::Component:

Classes

class  FallbackConfigHandler
 A helper object used to throw exceptions for unknown configuration parameters. More...
 

Public Member Functions

virtual internal auto createSubComponent (const ComponentClass &componentClass, plugin::SharedFactory< Component > &factory) -> std::shared_ptr< Component >
 Called by the framework to create a new child element of this element.
 
virtual auto createIo (const IoClass &ioClass, plugin::SharedFactory< Io > &factory) -> std::shared_ptr< Io >
 Called by the framework to create a new child element of this element.
 
virtual auto createIoBatch (const IoBatchClass &ioBatchClass, plugin::SharedFactory< IoBatch > &factory) -> std::shared_ptr< IoBatch >
 Called by the framework to create a new child element of this element.
 
virtual auto resolveAttribute (std::string_view name) -> const model::Attribute *
 Called by the framework to resolve an attribute with a specific name.
 
virtual auto resolveEvent (std::string_view name) -> std::shared_ptr< process::Event >
 Called by the framework to resolve an event with a specific name.
 
virtual auto resolveTask (std::string_view name) -> std::shared_ptr< process::Task >
 Called by the framework to resolve a task with a specific name.
 
virtual auto readHandle (const model::Attribute &attribute) const noexcept -> data::ReadHandle
 Called by the framework to get a read handle for a specific attribute.
 
virtual auto writeHandle (const model::Attribute &attribute) noexcept -> data::WriteHandle
 Called by the framework to get a write handle for a specific attribute.
 
- Public Member Functions inherited from xentara::skill::Element
virtual ~Element ()=0
 Virtual destructor.
 
auto name () const -> utils::string::StringView
 Gets the name of the element.
 
auto primaryKey () const -> utils::string::StringView
 Gets the primary key of the element.
 
auto uuid () const -> utils::core::Uuid
 Gets the UUID of the element.
 
auto elementClass () const noexcept -> const Class &
 Gets the class of this element.
 
virtual auto isAttributePending (std::string_view name) const noexcept -> bool
 Callback for determining whether an attribute is not available yet due to unresolved references.
 
virtual auto isAttributePending (const utils::core::Uuid &uuid) const noexcept -> bool
 Callback for determining whether an attribute is not available yet due to unresolved references.
 
virtual auto isEventPending (std::string_view name) const noexcept -> bool
 Callback for determining whether an event is not available yet due to unresolved references.
 
virtual auto isEventPending (const utils::core::Uuid &uuid) const noexcept -> bool
 Callback for determining whether an event is not available yet due to unresolved references.
 
virtual auto isTaskPending (std::string_view name) const noexcept -> bool
 Callback for determining whether a task is not available yet due to unresolved references.
 
virtual auto isTaskPending (const utils::core::Uuid &uuid) const noexcept -> bool
 Callback for determining whether a task is not available yet due to unresolved references.
 
virtual auto isMetadataPending () const noexcept -> bool
 Callback for determining whether meta information is not available yet due to unresolved references.
 
- Public Member Functions inherited from xentara::utils::tools::DisableCopy
constexpr DisableCopy () noexcept=default
 
 DisableCopy (const DisableCopy &)=delete
 
DisableCopyoperator= (const DisableCopy &)=delete
 

Protected Types

using ConfigIntializer = memory::Initializer< memory::Array >
 Type alias for an initializer for the configuration.
 

Protected Member Functions

virtual auto loadConfig (const ConfigIntializer &initializer, utils::json::decoder::Object &jsonObject, config::Resolver &resolver, const FallbackConfigHandler &fallbackHandler) -> void=0
 Called by the framework to load the element's configuration from a JSON object.
 
auto configBlock () const noexcept -> const memory::ArrayBlock &
 Gets the memory block that the configuration is stored in.
 
- Protected Member Functions inherited from xentara::skill::Element
auto element () const noexcept -> const model::Element &
 Gets the Xentara element for this skill element.
 
auto element () noexcept -> model::Element &
 Gets the Xentara element for this skill element.
 
auto rootElement () const -> std::shared_ptr< const model::Element >
 Returns the invisible root element of the model this element belongs to.
 
auto rootElement () -> std::shared_ptr< model::Element >
 Returns the invisible root element of the model this element belongs to.
 
auto findAttribute (std::string_view primaryKey) -> model::ElementAttribute
 Finds the attribute with a specific primary key in the model this element belongs to.
 
auto findAttributeVerbose (std::string_view primaryKey) -> utils::eh::expected< model::ElementAttribute, std::string >
 Finds the attribute with a specific primary key in the model this element belongs to, returning an error message on error.
 
auto findEvent (std::string_view primaryKey) const -> std::shared_ptr< const process::Event >
 Finds the event with a specific primary key in the model this element belongs to.
 
auto findEvent (std::string_view primaryKey) -> std::shared_ptr< process::Event >
 Finds the event with a specific primary key in the model this element belongs to.
 
auto findEventVerbose (std::string_view primaryKey) const -> utils::eh::expected< std::shared_ptr< const process::Event >, std::string >
 Finds the event with a specific primary key in the model this element belongs to, returning an error message on error.
 
auto findEventVerbose (std::string_view primaryKey) -> utils::eh::expected< std::shared_ptr< process::Event >, std::string >
 Finds the event with a specific primary key in the model this element belongs to, returning an error message on error.
 
auto findExtendedEvent (std::string_view primaryKey) const -> process::ExtendedEvent
 Finds the extended event with a specific primary key in the model this element belongs to.
 
auto findExtendedEventVerbose (std::string_view primaryKey) const -> utils::eh::expected< process::ExtendedEvent, std::string >
 Finds the extended event with a specific primary key in the model this element belongs to, returning an error message on error.
 
auto findTask (std::string_view primaryKey) const -> std::shared_ptr< const process::Task >
 Finds the task with a specific primary key in the model this element belongs to.
 
auto findTask (std::string_view primaryKey) -> std::shared_ptr< process::Task >
 Finds the task with a specific primary key in the model this element belongs to.
 
auto findTaskVerbose (std::string_view primaryKey) const -> utils::eh::expected< std::shared_ptr< const process::Task >, std::string >
 Finds the task with a specific primary key in the model this element belongs to, returning an error message on error.
 
auto findTaskVerbose (std::string_view primaryKey) -> utils::eh::expected< std::shared_ptr< process::Task >, std::string >
 Finds the task with a specific primary key in the model this element belongs to, returning an error message on error.
 
auto findElement (std::string_view primaryKey) const -> std::shared_ptr< const model::Element >
 Finds the element with a specific primary key in the model this element belongs to.
 
auto findElement (std::string_view primaryKey) -> std::shared_ptr< model::Element >
 Finds the element with a specific primary key in the model this element belongs to.
 
auto findElementVerbose (std::string_view primaryKey) const -> utils::eh::expected< std::shared_ptr< const model::Element >, std::string >
 Finds the element with a specific primary key in the model this element belongs to, returning an error message on error.
 
auto findElementVerbose (std::string_view primaryKey) -> utils::eh::expected< std::shared_ptr< model::Element >, std::string >
 Finds the element with a specific primary key in the model this element belongs to, returning an error message on error.
 
auto findElement (const utils::core::Uuid &uuid) const -> std::shared_ptr< const model::Element >
 Finds the element with a specific UUID in the model this element belongs to.
 
auto findElement (const utils::core::Uuid &uuid) -> std::shared_ptr< model::Element >
 Finds the element with a specific UUID in the model this element belongs to.
 
auto securityContext () const -> const security::Context &
 Returns the security context of the element.
 
auto checkAccess (const security::Authorization &authorization, const security::Entitlement &entitlement) const -> bool
 Checks an authorization for a certain entitlement using the ACL for this element.
 

Virtual Overrides for skill::Element


auto load (utils::json::decoder::Object &jsonObject, config::Context &context) -> void final
 Virtual overide for skill::Element::load()
 
auto createChildElement (const skill::Element::Class &elementClass, skill::ElementFactory &factory) -> std::shared_ptr< skill::Element > final
 Virtual overide for skill::Element::createChildElement()
 
auto resolveAttributeByName (std::string_view name) const -> std::shared_ptr< const model::Attribute > final
 Virtual overide for skill::Element::resolveAttributeByName()
 
auto resolveAttributeByUuid (const utils::core::Uuid &uuid) const -> std::shared_ptr< const model::Attribute > final
 Virtual overide for skill::Element::resolveAttributeByUuid()
 
auto forEachAttribute (const model::ForEachAttributeFunction &function) const -> bool final
 Virtual overide for skill::Element::forEachAttribute()
 
auto resolveEventByName (std::string_view name) -> std::shared_ptr< process::Event > final
 Virtual overide for skill::Element::resolveEventByName()
 
auto resolveEventByUuid (const utils::core::Uuid &uuid) -> std::shared_ptr< process::Event > final
 Virtual overide for skill::Element::resolveEventByUuid()
 
auto forEachEvent (const model::ForEachEventFunction &function) -> bool final
 Virtual overide for skill::Element::forEachEvent()
 
auto resolveTaskByName (std::string_view name) -> std::shared_ptr< process::Task > final
 Virtual overide for skill::Element::resolveTaskByName()
 
auto resolveTaskByUuid (const utils::core::Uuid &uuid) -> std::shared_ptr< process::Task > final
 Virtual overide for skill::Element::resolveTaskByUuid()
 
auto forEachTask (const model::ForEachTaskFunction &function) -> bool final
 Virtual overide for skill::Element::forEachTask()
 
auto makeReadHandle (const model::Attribute &attribute) const noexcept -> std::optional< data::ReadHandle > final
 Virtual overide for skill::Element::makeReadHandle()
 
auto makeWriteHandle (const model::Attribute &attribute) noexcept -> std::optional< data::WriteHandle > final
 Virtual overide for skill::Element::makeReadHandle()
 
auto category () const noexcept -> model::ElementCategory final
 Virtual overide for skill::Element::category()
 

Detailed Description

deprecated Deprecated base class for I/O component elements

Deprecated:
Replaced by skill::Element

Member Typedef Documentation

◆ ConfigIntializer

Type alias for an initializer for the configuration.

Member Function Documentation

◆ category()

auto xentara::io::Component::category ( ) const -> model::ElementCategory
finalprivatevirtualnoexcept

Virtual overide for skill::Element::category()

This function returns model::ElementCategory::Device.

Implements xentara::skill::Element.

◆ configBlock()

auto xentara::io::Component::configBlock ( ) const -> const memory::ArrayBlock &
protectednoexcept

Gets the memory block that the configuration is stored in.

◆ createChildElement()

auto xentara::io::Component::createChildElement ( const skill::Element::Class elementClass,
skill::ElementFactory factory 
) -> std::shared_ptr< skill::Element >
finalprivatevirtual

Virtual overide for skill::Element::createChildElement()

This function calls createSubComponent(), createIo(), or createIoBatch() if elementClass is derived from ComponentClass, IoClass, or IoBatchClass respectively, or returns nullptr otherwise.

Reimplemented from xentara::skill::Element.

◆ createIo()

virtual auto xentara::io::Component::createIo ( const IoClass ioClass,
plugin::SharedFactory< Io > &  factory 
) -> std::shared_ptr< Io >
virtual

Called by the framework to create a new child element of this element.

◆ createIoBatch()

virtual auto xentara::io::Component::createIoBatch ( const IoBatchClass ioBatchClass,
plugin::SharedFactory< IoBatch > &  factory 
) -> std::shared_ptr< IoBatch >
virtual

Called by the framework to create a new child element of this element.

◆ createSubComponent()

virtual internal auto xentara::io::Component::createSubComponent ( const ComponentClass componentClass,
plugin::SharedFactory< Component > &  factory 
) -> std::shared_ptr< Component >
virtual

Called by the framework to create a new child element of this element.

◆ forEachAttribute()

auto xentara::io::Component::forEachAttribute ( const model::ForEachAttributeFunction function) const -> bool
finalprivatevirtual

Virtual overide for skill::Element::forEachAttribute()

This class calls resolveAttribute() repeatedly using a list of standard attribute names.

Reimplemented from xentara::skill::Element.

◆ forEachEvent()

auto xentara::io::Component::forEachEvent ( const model::ForEachEventFunction function) -> bool
finalprivatevirtual

Virtual overide for skill::Element::forEachEvent()

This class calls resolveEvent() repeatedly using a list of standard event names.

Reimplemented from xentara::skill::Element.

◆ forEachTask()

auto xentara::io::Component::forEachTask ( const model::ForEachTaskFunction function) -> bool
finalprivatevirtual

Virtual overide for skill::Element::forEachTask()

This class calls resolveTask() repeatedly using a list of standard task names.

Reimplemented from xentara::skill::Element.

◆ load()

auto xentara::io::Component::load ( utils::json::decoder::Object jsonObject,
config::Context context 
) -> void
finalprivatevirtual

Virtual overide for skill::Element::load()

This function calls loadConfig() to load the element.

Reimplemented from xentara::skill::Element.

◆ loadConfig()

virtual auto xentara::io::Component::loadConfig ( const ConfigIntializer initializer,
utils::json::decoder::Object jsonObject,
config::Resolver resolver,
const FallbackConfigHandler fallbackHandler 
) -> void
protectedpure virtual

Called by the framework to load the element's configuration from a JSON object.

◆ makeReadHandle()

auto xentara::io::Component::makeReadHandle ( const model::Attribute attribute) const -> std::optional< data::ReadHandle >
finalprivatevirtualnoexcept

Virtual overide for skill::Element::makeReadHandle()

This function calls readHandle(), but returns std::nullopt if readHandle() returns data::ReadHandle::Error::Unknown.

Reimplemented from xentara::skill::Element.

◆ makeWriteHandle()

auto xentara::io::Component::makeWriteHandle ( const model::Attribute attribute) -> std::optional< data::WriteHandle >
finalprivatevirtualnoexcept

Virtual overide for skill::Element::makeReadHandle()

This function calls writeHandle(), but returns std::nullopt if writeHandle() returns data::WriteHandle::Error::Unknown.

Reimplemented from xentara::skill::Element.

◆ readHandle()

virtual auto xentara::io::Component::readHandle ( const model::Attribute attribute) const -> data::ReadHandle
virtualnoexcept

Called by the framework to get a read handle for a specific attribute.

◆ resolveAttribute()

virtual auto xentara::io::Component::resolveAttribute ( std::string_view  name) -> const model::Attribute *
virtual

Called by the framework to resolve an attribute with a specific name.

◆ resolveAttributeByName()

auto xentara::io::Component::resolveAttributeByName ( std::string_view  name) const -> std::shared_ptr< const model::Attribute >
finalprivatevirtual

Virtual overide for skill::Element::resolveAttributeByName()

This function just calls resolveAttribute()

Reimplemented from xentara::skill::Element.

◆ resolveAttributeByUuid()

auto xentara::io::Component::resolveAttributeByUuid ( const utils::core::Uuid uuid) const -> std::shared_ptr< const model::Attribute >
finalprivatevirtual

Virtual overide for skill::Element::resolveAttributeByUuid()

This function calls resolveAttribute(), selecting a name taken from a list of standard attribute UUIDs.

Reimplemented from xentara::skill::Element.

◆ resolveEvent()

virtual auto xentara::io::Component::resolveEvent ( std::string_view  name) -> std::shared_ptr< process::Event >
virtual

Called by the framework to resolve an event with a specific name.

◆ resolveEventByName()

auto xentara::io::Component::resolveEventByName ( std::string_view  name) -> std::shared_ptr< process::Event >
finalprivatevirtual

Virtual overide for skill::Element::resolveEventByName()

This function just calls resolveEvent()

Reimplemented from xentara::skill::Element.

◆ resolveEventByUuid()

auto xentara::io::Component::resolveEventByUuid ( const utils::core::Uuid uuid) -> std::shared_ptr< process::Event >
finalprivatevirtual

Virtual overide for skill::Element::resolveEventByUuid()

This function calls resolveEvent(), selecting a name taken from a list of standard event UUIDs.

Reimplemented from xentara::skill::Element.

◆ resolveTask()

virtual auto xentara::io::Component::resolveTask ( std::string_view  name) -> std::shared_ptr< process::Task >
virtual

Called by the framework to resolve a task with a specific name.

◆ resolveTaskByName()

auto xentara::io::Component::resolveTaskByName ( std::string_view  name) -> std::shared_ptr< process::Task >
finalprivatevirtual

Virtual overide for skill::Element::resolveTaskByName()

This function just calls resolveAttribute()

Reimplemented from xentara::skill::Element.

◆ resolveTaskByUuid()

auto xentara::io::Component::resolveTaskByUuid ( const utils::core::Uuid uuid) -> std::shared_ptr< process::Task >
finalprivatevirtual

Virtual overide for skill::Element::resolveTaskByUuid()

This function calls resolveTask(), selecting a name taken from a list of standard task UUIDs.

Reimplemented from xentara::skill::Element.

◆ writeHandle()

virtual auto xentara::io::Component::writeHandle ( const model::Attribute attribute) -> data::WriteHandle
virtualnoexcept

Called by the framework to get a write handle for a specific attribute.