PLCnext API Documentation 25.0.2.69
Public Member Functions | Protected Member Functions | List of all members
Arp::Io::Commons::IoComponentBase Class Reference

This class shall be used as a base class for all IO components. More...

#include <IoComponentBase.hpp>

Inheritance diagram for Arp::Io::Commons::IoComponentBase:
Inheritance graph

Public Member Functions

 IoComponentBase (const IoComponentBase &arg)=delete
 
 IoComponentBase (IoComponentBase &&arg) noexcept
 The move constructor.
 
IoComponentBaseoperator= (const IoComponentBase &arg)=delete
 
IoComponentBaseoperator= (IoComponentBase &&arg) noexcept
 The move assignment operator.
 
 ~IoComponentBase (void) override
 THe default destructor.
 
 IoComponentBase (IoLibraryBase &library, const String &fullName, Endianness endianness=Endianness::Current, uint32 startOrderOffset=0)
 Constructs an IoComponentBase instance. More...
 
Endianness GetDefaultEndianness (void) const
 Returns the default endianness of the IO component. More...
 
void Initialize (void) final
 Initializes this component: creates singletons, makes any registrations, creates any resources not depending on settings or configuration. More...
 
void SubscribeServices (void) final
 Subscribes services required by this component. More...
 
void LoadSettings (const String &settingsPath) final
 Loads components firmware settings. More...
 
void SetupSettings (void) final
 Sets up components settings which were loaded in LoadSettings. More...
 
void PublishServices (void) final
 Publishes components services. More...
 
void LoadConfig (void) final
 Loads components project configuration. More...
 
void SetupConfig (void) final
 Sets up components configuration which was loaded in LoadConfig. More...
 
void ResetConfig (void) final
 Resets components project configuration. More...
 
void Dispose (void) final
 Disposes this component. More...
 
void PowerDown (void) final
 This operation is called on a power breakdown event and executes component specific actions when power get lost. More...
 
DcgResultInfo LoadPlc (bool isChanging) final
 Loads the PLC project configuration of this component. More...
 
DcgResultInfo SetupPlc (bool isChanging, PlcStartKind startKind) final
 
void StartPlc (PlcStartKind startKind) final
 
void StopPlc (void) final
 Stops this PLC component. More...
 
void ResetPlc (bool isChanging, bool onError) final
 Resets the PLC project configuration of this component. More...
 
void UnloadPlc (bool isChanging, bool onError) final
 Unloads the PLC project configuration of this component. More...
 
VariableRegistryGetVariableRegistry (void) final
 Returns the VariableRegistry of this component. More...
 
Impl & GetImpl (void)
 For internal use only.
 
const Impl & GetImpl (void) const
 
- Public Member Functions inherited from Arp::Base::Acf::Commons::ComponentBase
 ComponentBase (const ComponentBase &arg)=delete
 
 ComponentBase (ComponentBase &&arg) noexcept
 The default move constructor. More...
 
ComponentBaseoperator= (const ComponentBase &arg)=delete
 
ComponentBaseoperator= (ComponentBase &&arg) noexcept
 The default move-assignment operator. More...
 
 ~ComponentBase (void) override
 The default destructor.
 
ApplicationGetApplication (void) const final
 Gets the application instance of the actual process which loaded this component. More...
 
ILibraryGetLibrary (void) const final
 Gets the library instance of this component. More...
 
String GetFullName (void) const final
 Gets the full qualified name of this component More...
 
ComponentCategory GetComponentCategory (void) const final
 Gets the ComponentCategory of this component. More...
 
uint32 GetStartOrder (void) const final
 Gets the start order of this component. More...
 
bool IsRequired (void) const override
 Determines if this component is required. More...
 
String GetComponentInfoItem (ComponentInfoKind kind) const override
 Gets additional information about the component More...
 
void Initialize (void) override
 Initializes this component: creates singletons, makes any registrations, creates any resources not depending on settings or configuration. More...
 
void LoadSettings (const String &settingsPath) override
 Loads components firmware settings. More...
 
void SetupSettings (void) override
 Sets up components settings which were loaded in LoadSettings. More...
 
void SubscribeServices (void) override
 Subscribes services required by this component. More...
 
void PublishServices (void) override
 Publishes components services. More...
 
void LoadConfig (void) override
 Loads components project configuration. More...
 
void SetupConfig (void) override
 Sets up components configuration which was loaded in LoadConfig. More...
 
void ResetConfig (void) override
 Resets components project configuration. More...
 
void Dispose (void) override
 Disposes this component. More...
 
void PowerDown (void) override
 This operation is called on a power breakdown event and executes component specific actions when power get lost. More...
 
Impl & GetImpl (void)
 For internal use only. More...
 
const Impl & GetImpl (void) const
 
- Public Member Functions inherited from Arp::Base::Acf::Commons::IComponent
 IComponent (IComponent &&arg) noexcept=default
 The move constructor. More...
 
 IComponent (const IComponent &arg)=delete
 The copy constructor is deleted. More...
 
IComponentoperator= (IComponent &&arg) noexcept=default
 The move assignment operator. More...
 
IComponentoperator= (const IComponent &arg)=delete
 The copy assignment operator is deleted. More...
 
virtual ~IComponent (void)=default
 The virtual default destructor.
 
virtual ApplicationGetApplication (void) const =0
 Gets the application instance of the actual process which loaded this component. More...
 
virtual ILibraryGetLibrary (void) const =0
 Gets the library instance of this component. More...
 
virtual String GetFullName (void) const =0
 Gets the full qualified name of this component More...
 
virtual ComponentCategory GetComponentCategory (void) const =0
 Gets the ComponentCategory of this component. More...
 
virtual uint32 GetStartOrder (void) const =0
 Gets the start order of this component. More...
 
virtual bool IsRequired (void) const =0
 Determines if this component is required. More...
 
virtual String GetComponentInfoItem (ComponentInfoKind kind) const =0
 Gets additional information about the component More...
 
virtual void Initialize (void)=0
 Initializes this component: creates singletons, makes any registrations, creates any resources not depending on settings or configuration. More...
 
virtual void SubscribeServices (void)=0
 Subscribes services required by this component. More...
 
virtual void LoadSettings (const String &settingsPath)=0
 Loads components firmware settings. More...
 
virtual void SetupSettings (void)=0
 Sets up components settings which were loaded in LoadSettings. More...
 
virtual void PublishServices (void)=0
 Publishes components services. More...
 
virtual void LoadConfig (void)=0
 Loads components project configuration. More...
 
virtual void SetupConfig (void)=0
 Sets up components configuration which was loaded in LoadConfig. More...
 
virtual void ResetConfig (void)=0
 Resets components project configuration. More...
 
virtual void Dispose (void)=0
 Disposes this component. More...
 
virtual void PowerDown (void)=0
 This operation is called on a power breakdown event and executes component specific actions when power get lost. More...
 
- Public Member Functions inherited from Arp::Plc::Domain::Commons::IPlcComponent
virtual DcgResultInfo LoadPlc (bool isChanging)=0
 Loads the PLC project configuration of this component. More...
 
virtual DcgResultInfo SetupPlc (bool isChanging, PlcStartKind startKind)=0
 Sets up the PLC project configuration of this component. More...
 
virtual void StartPlc (PlcStartKind startKind)=0
 Starts this PLC component using the specified start kind. More...
 
virtual void StopPlc (void)=0
 Stops this PLC component. More...
 
virtual void ResetPlc (bool isChanging, bool onError)=0
 Resets the PLC project configuration of this component. More...
 
virtual void UnloadPlc (bool isChanging, bool onError)=0
 Unloads the PLC project configuration of this component. More...
 
- Public Member Functions inherited from Arp::Plc::Meta::Commons::IIoMetaComponent
 IIoMetaComponent (void)=default
 Constructs an IIoMetaComponent instance.
 
 IIoMetaComponent (const IIoMetaComponent &arg)=default
 Copy constructor.
 
 IIoMetaComponent (IIoMetaComponent &&arg) noexcept=default
 Move constructor.
 
IIoMetaComponentoperator= (const IIoMetaComponent &arg)=default
 Copy-assignment operator.
 
IIoMetaComponentoperator= (IIoMetaComponent &&arg) noexcept=default
 Move-assignment operator.
 
virtual ~IIoMetaComponent (void)=default
 Destructs this instance and frees all resources.
 
virtual VariableRegistryGetVariableRegistry ()=0
 Gets the VariableRegistry of this component to provide meta data of this IO component. More...
 

Protected Member Functions

DataManagerGetDataManager (void)
 Gets the data-manager of this component. More...
 
virtual void InitializeInternal (void)
 This templated method is called from within Initialize. More...
 
virtual void SubscribeServicesInternal (void)
 This templated method is called from within SubscribeServices More...
 
virtual void LoadSettingsInternal (const String &settingsPath)
 This templated method is called from within LoadSettings More...
 
virtual void SetupSettingsInternal (void)
 This templated method is called from within SetupSettings More...
 
virtual void PublishServicesInternal (void)
 This templated method is called from within PublishServices More...
 
virtual void LoadConfigInternal (void)
 This templated method is called from within LoadConfig More...
 
virtual void SetupConfigInternal (void)
 This templated method is called from within SetupConfig More...
 
virtual void ResetConfigInternal (void)
 This templated method is called from within ResetConfig More...
 
virtual void DisposeInternal (void)
 This templated method is called from within Dispose More...
 
virtual void PowerDownInternal (void)
 This templated method is called from within PowerDown More...
 
virtual DcgResultInfo LoadPlcInternal (bool isChanging)
 This templated method is called from within LoadPlc. More...
 
virtual DcgResultInfo SetupPlcInternal (bool isChanging, PlcStartKind startKind)
 This templated method is called from within SetupPlc More...
 
virtual void StartPlcInternal (PlcStartKind startKind)
 This templated method is called from within StartPlc More...
 
virtual void StopPlcInternal (void)
 This templated method is called from within StopPlc More...
 
virtual void ResetPlcInternal (bool isChanging, bool onError)
 This templated method is called from within ResetPlc More...
 
virtual void UnloadPlcInternal (bool isChanging, bool onError)
 This templated method is called from within UnloadPlc More...
 
- Protected Member Functions inherited from Arp::Base::Acf::Commons::ComponentBase
 ComponentBase (ILibrary &library, const String &fullName, ComponentCategory category, uint32 startOrder)
 Constructs an ComponentBase instance. More...
 
- Protected Member Functions inherited from Arp::Base::Acf::Commons::IComponent
 IComponent (void)=default
 The default constructor.
 
- Protected Member Functions inherited from Arp::Plc::Domain::Commons::IPlcComponent
 IPlcComponent (void)=default
 Constructs an IPlcComponent instance.
 
 IPlcComponent (const IPlcComponent &arg)=default
 The deleted copy-constructor.
 
 IPlcComponent (IPlcComponent &&arg)=default
 The move-constructor.
 
IPlcComponentoperator= (const IPlcComponent &arg)=default
 The deleted copy-assignment operator.
 
IPlcComponentoperator= (IPlcComponent &&arg)=default
 The move-assignment operator.
 
virtual ~IPlcComponent (void)=default
 The destructor.
 

Additional Inherited Members

- Public Types inherited from Arp::Base::Acf::Commons::IComponent
using Ptr = std::shared_ptr< IComponent >
 The pointer type of this interface.
 
- Public Types inherited from Arp::Plc::Domain::Commons::IPlcComponent
using Ptr = std::shared_ptr< IPlcComponent >
 
- Public Types inherited from Arp::Plc::Meta::Commons::IIoMetaComponent
using Ptr = std::shared_ptr< IIoMetaComponent >
 
using VariableRegistry = Arp::Plc::Meta::Commons::Io::VariableRegistry
 
- Static Public Member Functions inherited from Arp::Base::Acf::Commons::ComponentBase
static uint32 GetDefaultStartOrder (void)
 Gets the default start order of a component which is DomainsStartOrder::Custom. More...
 

Detailed Description

This class shall be used as a base class for all IO components.

This class implements the interfaces IComponent, IPlcComponent and IIoMetaComponent. All interface methods are implemented directly by the base class and may not be overwritten by the IO component implementation. To implement IO component specific code please use the methods of IoComponentBase and override the ...Internal methods.

To support download-changes, the Plc operations should only check if the configuration has changed and if so, the operation should be refused by returning DcgResultInfo::CreateRefused(message).

The default endianness is used for all buffer that have no specific defined Endianness (Endianness::None). This should match the endianness of the underlying IO implementation/fieldbus.

Constructor & Destructor Documentation

◆ IoComponentBase()

Arp::Io::Commons::IoComponentBase::IoComponentBase ( IoLibraryBase library,
const String fullName,
Endianness  endianness = Endianness::Current,
uint32  startOrderOffset = 0 
)

Constructs an IoComponentBase instance.

Parameters
libraryThe hosting io library instance of the component.
fullNameThe full qualified name of the component.
endiannessDefines the default Endianness of the IO component. Data buffers with no explicit defined Endianness will use this endianness.
startOrderOffsetThe relative start order of the component. This offset should usually be 0 and may not be greater or equal than 20. If several IO components have dependencies to each other, this value might be used to define an explicit start order.

The ComponentCategory is fixed to ComponentCategory::System

Member Function Documentation

◆ Dispose()

void Arp::Io::Commons::IoComponentBase::Dispose ( void  )
finalvirtual

Disposes this component.

Reimplemented from Arp::Base::Acf::Commons::ComponentBase.

◆ DisposeInternal()

void Arp::Io::Commons::IoComponentBase::DisposeInternal ( void  )
protectedvirtual

This templated method is called from within Dispose

The default implementation is just empty and might be overridden if required.

◆ GetDataManager()

DataManager & Arp::Io::Commons::IoComponentBase::GetDataManager ( void  )
protected

Gets the data-manager of this component.

Returns
The data-manager of this component

◆ GetDefaultEndianness()

Endianness Arp::Io::Commons::IoComponentBase::GetDefaultEndianness ( void  ) const

Returns the default endianness of the IO component.

Returns
The default Endianness of the IO component.

◆ GetVariableRegistry()

IoComponentBase::VariableRegistry & Arp::Io::Commons::IoComponentBase::GetVariableRegistry ( void  )
finalvirtual

Returns the VariableRegistry of this component.

Returns
VariableRegistry of this component

Implements Arp::Plc::Meta::Commons::IIoMetaComponent.

◆ Initialize()

void Arp::Io::Commons::IoComponentBase::Initialize ( void  )
finalvirtual

Initializes this component: creates singletons, makes any registrations, creates any resources not depending on settings or configuration.

Reimplemented from Arp::Base::Acf::Commons::ComponentBase.

◆ InitializeInternal()

void Arp::Io::Commons::IoComponentBase::InitializeInternal ( void  )
protectedvirtual

This templated method is called from within Initialize.

The default implementation is just empty and might be overridden if required.

◆ LoadConfig()

void Arp::Io::Commons::IoComponentBase::LoadConfig ( void  )
finalvirtual

Loads components project configuration.

Reimplemented from Arp::Base::Acf::Commons::ComponentBase.

◆ LoadConfigInternal()

void Arp::Io::Commons::IoComponentBase::LoadConfigInternal ( void  )
protectedvirtual

This templated method is called from within LoadConfig

The default implementation is just empty and might be overridden if required.

◆ LoadPlc()

DcgResultInfo Arp::Io::Commons::IoComponentBase::LoadPlc ( bool  isChanging)
finalvirtual

Loads the PLC project configuration of this component.

Implements Arp::Plc::Domain::Commons::IPlcComponent.

◆ LoadPlcInternal()

DcgResultInfo Arp::Io::Commons::IoComponentBase::LoadPlcInternal ( bool  isChanging)
protectedvirtual

This templated method is called from within LoadPlc.

Parameters
isChangingtrue, if download-changes is in process, otherwise false.
Returns
DcgResultInfo::CreateRefused("message") if isChanging is true but the change is not possible, otherwise DcgResultInfo::CreateSuccess().

The default implementation is just empty and might be overridden if required.

◆ LoadSettings()

void Arp::Io::Commons::IoComponentBase::LoadSettings ( const String settingsPath)
finalvirtual

Loads components firmware settings.

Reimplemented from Arp::Base::Acf::Commons::ComponentBase.

◆ LoadSettingsInternal()

void Arp::Io::Commons::IoComponentBase::LoadSettingsInternal ( const String settingsPath)
protectedvirtual

This templated method is called from within LoadSettings

The default implementation is just empty and might be overridden if required.

◆ PowerDown()

void Arp::Io::Commons::IoComponentBase::PowerDown ( void  )
finalvirtual

This operation is called on a power breakdown event and executes component specific actions when power get lost.

Reimplemented from Arp::Base::Acf::Commons::ComponentBase.

◆ PowerDownInternal()

void Arp::Io::Commons::IoComponentBase::PowerDownInternal ( void  )
protectedvirtual

This templated method is called from within PowerDown

The default implementation is just empty and might be overridden if required.

◆ PublishServices()

void Arp::Io::Commons::IoComponentBase::PublishServices ( void  )
finalvirtual

Publishes components services.

Reimplemented from Arp::Base::Acf::Commons::ComponentBase.

◆ PublishServicesInternal()

void Arp::Io::Commons::IoComponentBase::PublishServicesInternal ( void  )
protectedvirtual

This templated method is called from within PublishServices

The default implementation is just empty and might be overridden if required.

◆ ResetConfig()

void Arp::Io::Commons::IoComponentBase::ResetConfig ( void  )
finalvirtual

Resets components project configuration.

Reimplemented from Arp::Base::Acf::Commons::ComponentBase.

◆ ResetConfigInternal()

void Arp::Io::Commons::IoComponentBase::ResetConfigInternal ( void  )
protectedvirtual

This templated method is called from within ResetConfig

The default implementation is just empty and might be overridden if required.

◆ ResetPlc()

void Arp::Io::Commons::IoComponentBase::ResetPlc ( bool  isChanging,
bool  onError 
)
finalvirtual

Resets the PLC project configuration of this component.

Implements Arp::Plc::Domain::Commons::IPlcComponent.

◆ ResetPlcInternal()

void Arp::Io::Commons::IoComponentBase::ResetPlcInternal ( bool  isChanging,
bool  onError 
)
protectedvirtual

This templated method is called from within ResetPlc

Parameters
isChangingtrue, if download-changes is in process, otherwise false.
onErrortrue if this operation is called after an error occurs, otherwise false.

The default implementation is just empty and might be overridden if required.

◆ SetupConfig()

void Arp::Io::Commons::IoComponentBase::SetupConfig ( void  )
finalvirtual

Sets up components configuration which was loaded in LoadConfig.

Reimplemented from Arp::Base::Acf::Commons::ComponentBase.

◆ SetupConfigInternal()

void Arp::Io::Commons::IoComponentBase::SetupConfigInternal ( void  )
protectedvirtual

This templated method is called from within SetupConfig

The default implementation is just empty and might be overridden if required.

◆ SetupPlcInternal()

DcgResultInfo Arp::Io::Commons::IoComponentBase::SetupPlcInternal ( bool  isChanging,
PlcStartKind  startKind 
)
protectedvirtual

This templated method is called from within SetupPlc

Parameters
isChangingtrue, if the download-changes is in process, otherwise false.
Returns
DcgResultInfo::CreateRefused("message") if isChanging is true but the change is not possible, otherwise DcgResultInfo::CreateSuccess().

The default implementation is just empty and might be overridden if required.

◆ SetupSettings()

void Arp::Io::Commons::IoComponentBase::SetupSettings ( void  )
finalvirtual

Sets up components settings which were loaded in LoadSettings.

Reimplemented from Arp::Base::Acf::Commons::ComponentBase.

◆ SetupSettingsInternal()

void Arp::Io::Commons::IoComponentBase::SetupSettingsInternal ( void  )
protectedvirtual

This templated method is called from within SetupSettings

The default implementation is just empty and might be overridden if required.

◆ StartPlcInternal()

void Arp::Io::Commons::IoComponentBase::StartPlcInternal ( PlcStartKind  startKind)
protectedvirtual

This templated method is called from within StartPlc

Parameters
startKindThe start kind to process (cold, warm, hot).

The default implementation is just empty and might be overridden if required.

◆ StopPlc()

void Arp::Io::Commons::IoComponentBase::StopPlc ( void  )
finalvirtual

Stops this PLC component.

Implements Arp::Plc::Domain::Commons::IPlcComponent.

◆ StopPlcInternal()

void Arp::Io::Commons::IoComponentBase::StopPlcInternal ( void  )
protectedvirtual

This templated method is called from within StopPlc

The default implementation is just empty and might be overridden if required.

◆ SubscribeServices()

void Arp::Io::Commons::IoComponentBase::SubscribeServices ( void  )
finalvirtual

Subscribes services required by this component.

Reimplemented from Arp::Base::Acf::Commons::ComponentBase.

◆ SubscribeServicesInternal()

void Arp::Io::Commons::IoComponentBase::SubscribeServicesInternal ( void  )
protectedvirtual

This templated method is called from within SubscribeServices

The default implementation is just empty and might be overridden if required.

◆ UnloadPlc()

void Arp::Io::Commons::IoComponentBase::UnloadPlc ( bool  isChanging,
bool  onError 
)
finalvirtual

Unloads the PLC project configuration of this component.

Implements Arp::Plc::Domain::Commons::IPlcComponent.

◆ UnloadPlcInternal()

void Arp::Io::Commons::IoComponentBase::UnloadPlcInternal ( bool  isChanging,
bool  onError 
)
protectedvirtual

This templated method is called from within UnloadPlc

Parameters
isChangingtrue, if download-changes is in process, otherwise false.
onErrortrue if this operation is called after an error occurs, otherwise false.

The default implementation is just empty and might be overridden if required.


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