PLCnext API Documentation  21.0.0.35466
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) = default;
32 
33 public: // setter/getter operations
34 
35 public: // IMetaLibrary operations
36  const char* GetNamespace(void)override;
37  ITypeInfoProvider& GetTypeInfoProvider(bool useBackgroundDomain)override;
38  IChangeNavigator* GetChangeNavigator(void)override;
39 
40 private: // fields
41  TypeInfoProvider typeInfoProvider;
42 };
43 
45 // inline methods of class MetaLibraryBase
46 inline MetaLibraryBase::MetaLibraryBase(AppDomain& appDomain, const Version& buildVersion, TypeDomain& typeDomain)
47  : LibraryBase(appDomain, buildVersion)
48  , typeInfoProvider(typeDomain)
49 {
50 }
51 
52 inline const char* MetaLibraryBase::GetNamespace()
53 {
54  return this->typeInfoProvider.GetTypeDomain().GetLibraryNamespace();
55 }
56 
57 inline ITypeInfoProvider& MetaLibraryBase::GetTypeInfoProvider(bool /*useBackgroundDomain*/)
58 {
59  return this->typeInfoProvider;
60 }
61 
63 {
64  return nullptr;
65 }
66 
67 }}}} // end of namespace Arp::Plc::Commons::Meta
IChangeNavigator * GetChangeNavigator(void) override
Gets the specialized IChangeNavigator of this component.
Definition: MetaLibraryBase.hpp:62
const char * GetLibraryNamespace(void) const
Returns the namespace of the library
Definition: TypeDomain.hpp:90
Interface to type information of a library
Definition: ITypeInfoProvider.hpp:24
Interface for all libraries providing meta data
Definition: IMetaLibrary.hpp:18
This class represents the version of a special SDK or Arp build.
Definition: BasicVersion.hpp:34
MetaLibraryBase(AppDomain &appDomain, const Version &buildVersion, TypeDomain &typeDomain)
Constructs an MetaLibraryBase instance.
Definition: MetaLibraryBase.hpp:46
This class represents a single application domain for each process and is implemented as singleton...
Definition: AppDomain.hpp:122
Provides type information of one library
Definition: TypeInfoProvider.hpp:19
Container for the type information of a library
Definition: TypeDomain.hpp:25
Root namespace for the PLCnext API
Namespace for the type information of the Meta component
Definition: DataInfoDeduction.hxx:10
Any Acf Library shall derive from this base class.
Definition: LibraryBase.hpp:19
ITypeInfoProvider & GetTypeInfoProvider(bool useBackgroundDomain) override
Gets the ITypeInfoProvider of this library.
Definition: MetaLibraryBase.hpp:57
This is the namespace of the Application Component Framework.
Definition: ComponentBase.hpp:12
const char * GetNamespace(void) override
Gets the namespace of this library.
Definition: MetaLibraryBase.hpp:52
Base class for libraries providing meta data
Definition: MetaLibraryBase.hpp:18
Enables switching of counterparts during download change
Definition: IChangeNavigator.hpp:16