PLCnext API Documentation
22.9.0.33
|
Provides information of component root variables More...
#include <DataInfoProvider.hpp>
Public Types | |
using | Roots = std::map< String, DataInfo > |
![]() | |
using | Ptr = std::shared_ptr< IDataInfoProvider > |
std::shared_ptr to IDataInfoProvider More... | |
Public Member Functions | |
DataInfoProvider (const char *libraryNamespace, ProgramProviderBase *pProgramProvider=nullptr) | |
Constructs an DataInfoProvider instance. More... | |
DataInfoProvider (const DataInfoProvider &arg)=default | |
Copy constructor. More... | |
DataInfoProvider (DataInfoProvider &&arg)=default | |
Move constructor More... | |
DataInfoProvider & | operator= (const DataInfoProvider &arg)=default |
Copy assignment operator. More... | |
DataInfoProvider & | operator= (DataInfoProvider &&arg)=default |
Move assignment operator More... | |
~DataInfoProvider (void) override=default | |
Destructs this instance and frees all resources. More... | |
const String & | GetLibraryNamespace () const |
Returns the library namespace More... | |
IDataInfoProvider & | GetBackgroundProvider (void) |
Returns an IDataInfoProvider for the background domain More... | |
void | Reset (void) |
Removes all variable information More... | |
void | AddRootInfo (const DataInfo &rootInfo) |
Adds information about a component root More... | |
void | RemoveRootInfo (const String &name) |
Removes the information about the specified variable More... | |
template<class T > | |
void | AddRoot (const char *name, const T &value) |
Deduces the required information of a root variable and add it More... | |
IEnumerator< const DataInfo & >::Ptr | GetRoots (void) override |
Returns an IEnumerator to enumerate all root variables of the component More... | |
DataInfo | GetRoot (const String &name) override |
Returns the requested root variable of the component More... | |
Friends | |
class | Arp::Plc::Commons::Meta::ChangeDataInfoProvider |
Additional Inherited Members | |
![]() | |
IDataInfoProvider (void)=default | |
Constructs an IDataInfoProvider instance. More... | |
virtual | ~IDataInfoProvider (void)=default |
Destructs this instance and frees all resources. More... | |
Provides information of component root variables
Each component providing variables needs to provide information about the component's root variables with a IDataInfo provider. This class is typically used to by C++ components. The information about the variables is deduced by the AddRoot function.
Arp::Plc::Commons::Meta::DataInfoProvider::DataInfoProvider | ( | const char * | libraryNamespace, |
ProgramProviderBase * | pProgramProvider = nullptr |
||
) |
Constructs an DataInfoProvider instance.
Providing a ProgramProviderBase pointer is deprecated. keeping track of programs is done in ProgramComponentBase.
|
default |
Copy constructor.
|
default |
Move constructor
|
overridedefault |
Destructs this instance and frees all resources.
|
inline |
Deduces the required information of a root variable and add it
name | Name of the variable |
value | Reference of the variable to add |
All required information except the name and the address is deduced at compile time. This function is used in almost all cases to add root variables.
|
inline |
Adds information about a component root
rootInfo | DataInfo object for the root variable |
IDataInfoProvider& Arp::Plc::Commons::Meta::DataInfoProvider::GetBackgroundProvider | ( | void | ) |
Returns an IDataInfoProvider for the background domain
The property IsBackgroundDomain is set to true on all objects returned by the background provider.
const String& Arp::Plc::Commons::Meta::DataInfoProvider::GetLibraryNamespace | ( | ) | const |
Returns the library namespace
Returns the requested root variable of the component
name | Name of the root variable |
Implements Arp::Plc::Commons::Meta::IDataInfoProvider.
|
overridevirtual |
Returns an IEnumerator to enumerate all root variables of the component
Implements Arp::Plc::Commons::Meta::IDataInfoProvider.
|
default |
Copy assignment operator.
|
default |
Move assignment operator
|
inline |
Removes the information about the specified variable
name | Name of the variable to be removed |
void Arp::Plc::Commons::Meta::DataInfoProvider::Reset | ( | void | ) |
Removes all variable information