PLCnext API Documentation 23.6.0.37
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.
 
 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..
 
String GetFullName (void) const
 Gets the full typename of this instance. 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.
 
 operator const char * (void) const
 Converts this instance implicitely to char*.
 

Public Attributes

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

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/2]

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

The default copy constructor.

Parameters
argThe argument to copy.

◆ CommonTypeName() [2/2]

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

The default move constructor.

Parameters
argThe argument to move.

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.

◆ GetFullName()

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

Gets the full typename of this instance.

Returns
The full typename.

◆ 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=()

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.

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