PLCnext API Documentation  22.9.0.33
MetaLibraryBase.hpp
1 //
3 // Copyright PHOENIX CONTACT Electronics GmbH
4 //
6 #pragma once
7 #include "Arp/System/Core/Arp.h"
8 #include "Arp/System/Acf/LibraryBase.hpp"
9 #include "Arp/Plc/Commons/Meta/IMetaLibrary.hpp"
10 #include "Arp/Plc/Commons/Meta/TypeInfoProvider.hpp"
11 namespace Arp { namespace Plc { namespace Commons { namespace Meta
12 {
13 
14 using namespace Arp::System::Acf;
16 
19 {
20 public: // construction/destruction
25  MetaLibraryBase(AppDomain& appDomain, const Version& buildVersion, TypeDomain& typeDomain);
27  MetaLibraryBase(const MetaLibraryBase& arg) = default;
29  MetaLibraryBase& operator=(const MetaLibraryBase& arg) = default;
31  ~MetaLibraryBase(void) override = default;
32 
33 public: // setter/getter operations
34  TypeDomain& GetTypeDomain();
35 
36 public: // IMetaLibrary operations
37  const char* GetNamespace(void)override;
38  ITypeInfoProvider& GetTypeInfoProvider(bool useBackgroundDomain)override;
39  IChangeNavigator* GetChangeNavigator(void)override;
40 
41 private: // fields
42  TypeInfoProvider typeInfoProvider;
43 };
44 
46 // inline methods of class MetaLibraryBase
47 inline MetaLibraryBase::MetaLibraryBase(AppDomain& appDomain, const Version& buildVersion, TypeDomain& typeDomain)
48  : LibraryBase(appDomain, buildVersion)
49  , typeInfoProvider(typeDomain)
50 {
51 }
52 
53 inline const char* MetaLibraryBase::GetNamespace()
54 {
55  return this->typeInfoProvider.GetTypeDomain().GetLibraryNamespace();
56 }
57 
58 inline ITypeInfoProvider& MetaLibraryBase::GetTypeInfoProvider(bool /*useBackgroundDomain*/)
59 {
60  return this->typeInfoProvider;
61 }
62 
64 {
65  return nullptr;
66 }
67 
68 }}}} // end of namespace Arp::Plc::Commons::Meta
This class represents a single application domain for each process and is implemented as singleton.
Definition: AppDomain.hpp:122
This class represents the version of a special SDK or Arp build.
Definition: BasicVersion.hpp:35
Enables switching of counterparts during download change
Definition: IChangeNavigator.hpp:17
Interface for all libraries providing meta data
Definition: IMetaLibrary.hpp:19
Interface to type information of a library
Definition: ITypeInfoProvider.hpp:25
Base class for libraries providing meta data
Definition: MetaLibraryBase.hpp:19
MetaLibraryBase(AppDomain &appDomain, const Version &buildVersion, TypeDomain &typeDomain)
Constructs an MetaLibraryBase instance.
Definition: MetaLibraryBase.hpp:47
IChangeNavigator * GetChangeNavigator(void) override
Gets the specialized IChangeNavigator of this component.
Definition: MetaLibraryBase.hpp:63
ITypeInfoProvider & GetTypeInfoProvider(bool useBackgroundDomain) override
Gets the ITypeInfoProvider of this library.
Definition: MetaLibraryBase.hpp:58
MetaLibraryBase & operator=(const MetaLibraryBase &arg)=default
Assignment operator.
const char * GetNamespace(void) override
Gets the namespace of this library.
Definition: MetaLibraryBase.hpp:53
MetaLibraryBase(const MetaLibraryBase &arg)=default
Copy constructor.
~MetaLibraryBase(void) override=default
Destructs this instance and frees all resources.
Provides type information of one library
Definition: TypeInfoProvider.hpp:20
Container for the type information of a library
Definition: TypeDomain.hpp:26
const char * GetLibraryNamespace(void) const
Returns the namespace of the library
Definition: TypeDomain.hpp:96
Any Acf Library shall derive from this base class.
Definition: LibraryBase.hpp:20
Namespace for the type information of the Meta component
Definition: DataInfoDeduction.hxx:11
This is the namespace of the Application Component Framework.
Definition: ComponentBase.hpp:13
Root namespace for the PLCnext API