PLCnext API Documentation 23.3.0.32
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Types | Public Member Functions | Friends | List of all members
Arp::Plc::Commons::Meta::DataInfoProvider Class Reference

Provides information of component root variables More...

#include <DataInfoProvider.hpp>

Inheritance diagram for Arp::Plc::Commons::Meta::DataInfoProvider:
Inheritance graph

Public Types

using Roots = std::map< String, DataInfo >
 
- Public Types inherited from Arp::Plc::Commons::Meta::IDataInfoProvider
using Ptr = std::shared_ptr< IDataInfoProvider >
 std::shared_ptr to IDataInfoProvider
 

Public Member Functions

 DataInfoProvider (const char *libraryNamespace, ProgramProviderBase *pProgramProvider=nullptr)
 Constructs an DataInfoProvider instance. More...
 
 DataInfoProvider (const DataInfoProvider &arg)=default
 Copy constructor.
 
 DataInfoProvider (DataInfoProvider &&arg)=default
 Move constructor
 
DataInfoProvideroperator= (const DataInfoProvider &arg)=default
 Copy assignment operator.
 
DataInfoProvideroperator= (DataInfoProvider &&arg)=default
 Move assignment operator
 
 ~DataInfoProvider (void) override=default
 Destructs this instance and frees all resources.
 
const StringGetLibraryNamespace () const
 Returns the library namespace
 
IDataInfoProviderGetBackgroundProvider (void)
 Returns an IDataInfoProvider for the background domain More...
 
void Reset (void)
 Removes all variable information
 
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< constDataInfo & >::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...
 
virtual IEnumerator< constDataInfo & >::Ptr GetRoots (void)=0
 Returns an IEnumerator to enumerate all root variables of the component More...
 
virtual DataInfo GetRoot (const String &name)=0
 Returns the requested root variable of the component More...
 

Friends

class Arp::Plc::Commons::Meta::ChangeDataInfoProvider
 

Additional Inherited Members

- Protected Member Functions inherited from Arp::Plc::Commons::Meta::IDataInfoProvider
 IDataInfoProvider (void)=default
 Constructs an IDataInfoProvider instance.
 
virtual ~IDataInfoProvider (void)=default
 Destructs this instance and frees all resources.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DataInfoProvider()

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.

Member Function Documentation

◆ AddRoot()

template<class T >
void Arp::Plc::Commons::Meta::DataInfoProvider::AddRoot ( const char *  name,
const T &  value 
)
inline

Deduces the required information of a root variable and add it

Parameters
nameName of the variable
valueReference 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.

◆ AddRootInfo()

void Arp::Plc::Commons::Meta::DataInfoProvider::AddRootInfo ( const DataInfo rootInfo)
inline

Adds information about a component root

Parameters
rootInfoDataInfo object for the root variable

◆ GetBackgroundProvider()

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.

◆ GetRoot()

DataInfo Arp::Plc::Commons::Meta::DataInfoProvider::GetRoot ( const String name)
overridevirtual

Returns the requested root variable of the component

Parameters
nameName of the root variable
Returns
DataInfo object for the variable or an empty DataInfo if name is not found

Implements Arp::Plc::Commons::Meta::IDataInfoProvider.

◆ GetRoots()

IEnumerator< constDataInfo & >::Ptr Arp::Plc::Commons::Meta::DataInfoProvider::GetRoots ( void  )
overridevirtual

Returns an IEnumerator to enumerate all root variables of the component

Implements Arp::Plc::Commons::Meta::IDataInfoProvider.

◆ RemoveRootInfo()

void Arp::Plc::Commons::Meta::DataInfoProvider::RemoveRootInfo ( const String name)
inline

Removes the information about the specified variable

Parameters
nameName of the variable to be removed

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