PLCnext API Documentation 25.0.2.69
|
This class shall be used as a base class for all IO components. More...
#include <IoComponentBase.hpp>
Public Member Functions | |
IoComponentBase (const IoComponentBase &arg)=delete | |
IoComponentBase (IoComponentBase &&arg) noexcept | |
The move constructor. | |
IoComponentBase & | operator= (const IoComponentBase &arg)=delete |
IoComponentBase & | operator= (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... | |
VariableRegistry & | GetVariableRegistry (void) final |
Returns the VariableRegistry of this component. More... | |
Impl & | GetImpl (void) |
For internal use only. | |
const Impl & | GetImpl (void) const |
![]() | |
ComponentBase (const ComponentBase &arg)=delete | |
ComponentBase (ComponentBase &&arg) noexcept | |
The default move constructor. More... | |
ComponentBase & | operator= (const ComponentBase &arg)=delete |
ComponentBase & | operator= (ComponentBase &&arg) noexcept |
The default move-assignment operator. More... | |
~ComponentBase (void) override | |
The default destructor. | |
Application & | GetApplication (void) const final |
Gets the application instance of the actual process which loaded this component. More... | |
ILibrary & | GetLibrary (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 |
![]() | |
IComponent (IComponent &&arg) noexcept=default | |
The move constructor. More... | |
IComponent (const IComponent &arg)=delete | |
The copy constructor is deleted. More... | |
IComponent & | operator= (IComponent &&arg) noexcept=default |
The move assignment operator. More... | |
IComponent & | operator= (const IComponent &arg)=delete |
The copy assignment operator is deleted. More... | |
virtual | ~IComponent (void)=default |
The virtual default destructor. | |
virtual Application & | GetApplication (void) const =0 |
Gets the application instance of the actual process which loaded this component. More... | |
virtual ILibrary & | GetLibrary (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... | |
![]() | |
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... | |
![]() | |
IIoMetaComponent (void)=default | |
Constructs an IIoMetaComponent instance. | |
IIoMetaComponent (const IIoMetaComponent &arg)=default | |
Copy constructor. | |
IIoMetaComponent (IIoMetaComponent &&arg) noexcept=default | |
Move constructor. | |
IIoMetaComponent & | operator= (const IIoMetaComponent &arg)=default |
Copy-assignment operator. | |
IIoMetaComponent & | operator= (IIoMetaComponent &&arg) noexcept=default |
Move-assignment operator. | |
virtual | ~IIoMetaComponent (void)=default |
Destructs this instance and frees all resources. | |
virtual VariableRegistry & | GetVariableRegistry ()=0 |
Gets the VariableRegistry of this component to provide meta data of this IO component. More... | |
Protected Member Functions | |
DataManager & | GetDataManager (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... | |
![]() | |
ComponentBase (ILibrary &library, const String &fullName, ComponentCategory category, uint32 startOrder) | |
Constructs an ComponentBase instance. More... | |
![]() | |
IComponent (void)=default | |
The default constructor. | |
![]() | |
IPlcComponent (void)=default | |
Constructs an IPlcComponent instance. | |
IPlcComponent (const IPlcComponent &arg)=default | |
The deleted copy-constructor. | |
IPlcComponent (IPlcComponent &&arg)=default | |
The move-constructor. | |
IPlcComponent & | operator= (const IPlcComponent &arg)=default |
The deleted copy-assignment operator. | |
IPlcComponent & | operator= (IPlcComponent &&arg)=default |
The move-assignment operator. | |
virtual | ~IPlcComponent (void)=default |
The destructor. | |
Additional Inherited Members | |
![]() | |
using | Ptr = std::shared_ptr< IComponent > |
The pointer type of this interface. | |
![]() | |
using | Ptr = std::shared_ptr< IPlcComponent > |
![]() | |
using | Ptr = std::shared_ptr< IIoMetaComponent > |
using | VariableRegistry = Arp::Plc::Meta::Commons::Io::VariableRegistry |
![]() | |
static uint32 | GetDefaultStartOrder (void) |
Gets the default start order of a component which is DomainsStartOrder::Custom. More... | |
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.
Arp::Io::Commons::IoComponentBase::IoComponentBase | ( | IoLibraryBase & | library, |
const String & | fullName, | ||
Endianness | endianness = Endianness::Current , |
||
uint32 | startOrderOffset = 0 |
||
) |
Constructs an IoComponentBase instance.
library | The hosting io library instance of the component. |
fullName | The full qualified name of the component. |
endianness | Defines the default Endianness of the IO component. Data buffers with no explicit defined Endianness will use this endianness. |
startOrderOffset | The 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
|
finalvirtual |
Disposes this component.
Reimplemented from Arp::Base::Acf::Commons::ComponentBase.
|
protectedvirtual |
This templated method is called from within Dispose
The default implementation is just empty and might be overridden if required.
|
protected |
Gets the data-manager of this component.
Endianness Arp::Io::Commons::IoComponentBase::GetDefaultEndianness | ( | void | ) | const |
Returns the default endianness of the IO component.
|
finalvirtual |
Returns the VariableRegistry of this component.
Implements Arp::Plc::Meta::Commons::IIoMetaComponent.
|
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.
|
protectedvirtual |
This templated method is called from within Initialize.
The default implementation is just empty and might be overridden if required.
|
finalvirtual |
Loads components project configuration.
Reimplemented from Arp::Base::Acf::Commons::ComponentBase.
|
protectedvirtual |
This templated method is called from within LoadConfig
The default implementation is just empty and might be overridden if required.
|
finalvirtual |
Loads the PLC project configuration of this component.
Implements Arp::Plc::Domain::Commons::IPlcComponent.
|
protectedvirtual |
This templated method is called from within LoadPlc.
isChanging | true , if download-changes is in process, otherwise false . |
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.
|
finalvirtual |
Loads components firmware settings.
Reimplemented from Arp::Base::Acf::Commons::ComponentBase.
|
protectedvirtual |
This templated method is called from within LoadSettings
The default implementation is just empty and might be overridden if required.
|
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.
|
protectedvirtual |
This templated method is called from within PowerDown
The default implementation is just empty and might be overridden if required.
|
finalvirtual |
Publishes components services.
Reimplemented from Arp::Base::Acf::Commons::ComponentBase.
|
protectedvirtual |
This templated method is called from within PublishServices
The default implementation is just empty and might be overridden if required.
|
finalvirtual |
Resets components project configuration.
Reimplemented from Arp::Base::Acf::Commons::ComponentBase.
|
protectedvirtual |
This templated method is called from within ResetConfig
The default implementation is just empty and might be overridden if required.
|
finalvirtual |
Resets the PLC project configuration of this component.
Implements Arp::Plc::Domain::Commons::IPlcComponent.
|
protectedvirtual |
This templated method is called from within ResetPlc
isChanging | true , if download-changes is in process, otherwise false . |
onError | true if this operation is called after an error occurs, otherwise false . |
The default implementation is just empty and might be overridden if required.
|
finalvirtual |
Sets up components configuration which was loaded in LoadConfig.
Reimplemented from Arp::Base::Acf::Commons::ComponentBase.
|
protectedvirtual |
This templated method is called from within SetupConfig
The default implementation is just empty and might be overridden if required.
|
protectedvirtual |
This templated method is called from within SetupPlc
isChanging | true , if the download-changes is in process, otherwise false . |
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.
|
finalvirtual |
Sets up components settings which were loaded in LoadSettings.
Reimplemented from Arp::Base::Acf::Commons::ComponentBase.
|
protectedvirtual |
This templated method is called from within SetupSettings
The default implementation is just empty and might be overridden if required.
|
protectedvirtual |
This templated method is called from within StartPlc
startKind | The start kind to process (cold, warm, hot). |
The default implementation is just empty and might be overridden if required.
|
finalvirtual |
Stops this PLC component.
Implements Arp::Plc::Domain::Commons::IPlcComponent.
|
protectedvirtual |
This templated method is called from within StopPlc
The default implementation is just empty and might be overridden if required.
|
finalvirtual |
Subscribes services required by this component.
Reimplemented from Arp::Base::Acf::Commons::ComponentBase.
|
protectedvirtual |
This templated method is called from within SubscribeServices
The default implementation is just empty and might be overridden if required.
|
finalvirtual |
Unloads the PLC project configuration of this component.
Implements Arp::Plc::Domain::Commons::IPlcComponent.
|
protectedvirtual |
This templated method is called from within UnloadPlc
isChanging | true , if download-changes is in process, otherwise false . |
onError | true if this operation is called after an error occurs, otherwise false . |
The default implementation is just empty and might be overridden if required.