PLCnext API Documentation  22.9.0.33
Public Member Functions | Public Attributes | Friends | List of all members
Arp::CommonTypeName< T > Class Template Reference

This (meta programming) class provides the typename according the CLS (common language specification) of the as template argument passed type. More...

#include <CommonTypeName.hxx>

Public Member Functions

 CommonTypeName (void)
 Constructs a CommonTypeName instance and determines the typename of the of T. More...
 
 CommonTypeName (const CommonTypeName &arg)=default
 The default copy constructor. More...
 
 CommonTypeName (CommonTypeName &&arg) noexcept=default
 The default move constructor. More...
 
CommonTypeNameoperator= (const CommonTypeName &arg)=default
 The default assignment operator. More...
 
 ~CommonTypeName (void)=default
 The default destructor.. More...
 
String GetNamespace (void) const
 Gets the namespace of the as template parameter given type. More...
 
String GetClassName (void) const
 Gets the classname of the as template parameter given type. More...
 
 operator const String & (void) const
 Converts this instance implicitely to string. More...
 
 operator const char * (void) const
 Converts this instance implicitely to char*. More...
 

Public Attributes

String Value
 The CLS typename of the as template argument passed type. More...
 

Friends

class CommonTypeName< void >
 

Detailed Description

template<class T = void>
class Arp::CommonTypeName< T >

This (meta programming) class provides the typename according the CLS (common language specification) of the as template argument passed type.

The only difference to the TypeName class is, that the resulting C++ typename contains dots instead of the C++ scope operator :: according the CLS used by .NET. The main reason is, that PLCnext provides a uniformed reflection mechanism (meta data) across multiple programming languages as C++, C#, IEC, Java, and more. All typenames of PLC data comply to the following pattern:

<LibraryNamespace>/<LocalTypeName>

where the library namespace as well as the local typename inside the library contains dot as separators but not any programming language specific operators like ::.

This class uses RTTI which must be enabled by the C++ build.

Template Parameters
TThe type to retrieve the commoon typename from.

Constructor & Destructor Documentation

◆ CommonTypeName() [1/3]

template<class T >
Arp::CommonTypeName< T >::CommonTypeName ( void  )
inline

Constructs a CommonTypeName instance and determines the typename of the of T.

◆ CommonTypeName() [2/3]

template<class T = void>
Arp::CommonTypeName< T >::CommonTypeName ( const CommonTypeName< T > &  arg)
default

The default copy constructor.

Parameters
argThe argument to copy.

◆ CommonTypeName() [3/3]

template<class T = void>
Arp::CommonTypeName< T >::CommonTypeName ( CommonTypeName< T > &&  arg)
defaultnoexcept

The default move constructor.

Parameters
argThe argument to move.

◆ ~CommonTypeName()

template<class T = void>
Arp::CommonTypeName< T >::~CommonTypeName ( void  )
default

The default destructor..

Member Function Documentation

◆ GetClassName()

template<class T >
String Arp::CommonTypeName< T >::GetClassName ( void  ) const
inline

Gets the classname of the as template parameter given type.

Returns
The classname of the as template parameter given type.

◆ GetNamespace()

template<class T >
String Arp::CommonTypeName< T >::GetNamespace ( void  ) const
inline

Gets the namespace of the as template parameter given type.

Returns
The namespace of the as template parameter given type.

◆ operator const char *()

template<class T >
Arp::CommonTypeName< T >::operator const char * ( void  ) const
inline

Converts this instance implicitely to char*.

◆ operator const String &()

template<class T >
Arp::CommonTypeName< T >::operator const String & ( void  ) const
inline

Converts this instance implicitely to string.

◆ operator=()

template<class T = void>
CommonTypeName& Arp::CommonTypeName< T >::operator= ( const CommonTypeName< T > &  arg)
default

The default assignment operator.

Parameters
argThe argument to assign to this instance.
Returns
This instance as reference.

Member Data Documentation

◆ Value

template<class T = void>
String Arp::CommonTypeName< T >::Value

The CLS typename of the as template argument passed type.


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