PLCnext API Documentation  22.9.0.33
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 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...
 
DataInfoProvideroperator= (const DataInfoProvider &arg)=default
 Copy assignment operator. More...
 
DataInfoProvideroperator= (DataInfoProvider &&arg)=default
 Move assignment operator More...
 
 ~DataInfoProvider (void) override=default
 Destructs this instance and frees all resources. More...
 
const StringGetLibraryNamespace () const
 Returns the library namespace More...
 
IDataInfoProviderGetBackgroundProvider (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

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

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() [1/3]

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.

◆ DataInfoProvider() [2/3]

Arp::Plc::Commons::Meta::DataInfoProvider::DataInfoProvider ( const DataInfoProvider arg)
default

Copy constructor.

◆ DataInfoProvider() [3/3]

Arp::Plc::Commons::Meta::DataInfoProvider::DataInfoProvider ( DataInfoProvider &&  arg)
default

Move constructor

◆ ~DataInfoProvider()

Arp::Plc::Commons::Meta::DataInfoProvider::~DataInfoProvider ( void  )
overridedefault

Destructs this instance and frees all resources.

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.

◆ GetLibraryNamespace()

const String& Arp::Plc::Commons::Meta::DataInfoProvider::GetLibraryNamespace ( ) const

Returns the library namespace

◆ 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<const DataInfo&>::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.

◆ operator=() [1/2]

DataInfoProvider& Arp::Plc::Commons::Meta::DataInfoProvider::operator= ( const DataInfoProvider arg)
default

Copy assignment operator.

◆ operator=() [2/2]

DataInfoProvider& Arp::Plc::Commons::Meta::DataInfoProvider::operator= ( DataInfoProvider &&  arg)
default

Move assignment operator

◆ 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

◆ Reset()

void Arp::Plc::Commons::Meta::DataInfoProvider::Reset ( void  )

Removes all variable information


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