ICF 3.0.5.47
Technical documentation of ICF Libraries
CComponentAccessor.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#ifndef ipackage_CComponentAccessor_included
7#define ipackage_CComponentAccessor_included
8
9
10// ICF includes
14
15
16namespace ipackage
17{
18
19
24{
25public:
32 explicit CComponentAccessor(bool manualAutoInit = false);
33
42 const QString& registryFile,
43 const QString& configFile = QString(),
44 bool isDiagnosticEnabled = false);
45
54 template <class InterfaceType>
55 InterfaceType* GetComponentInterface(const QByteArray& componentId = QByteArray());
56
58
59private:
60 icomp::CCompositeComponent m_mainComponent;
61
62 std::unique_ptr<icomp::IComponentStaticInfo> m_mainComponentStaticInfoPtr;
63 std::unique_ptr<icomp::IComponentContext> m_mainComponentContextPtr;
64};
65
66
67template <class InterfaceType>
68InterfaceType* CComponentAccessor::GetComponentInterface(const QByteArray& componentId)
69{
70 InterfaceType* interfacePtr = m_mainComponent.GetComponentInterface<InterfaceType>(componentId);
71
72 return interfacePtr;
73}
74
75
76} // namespace ipackage
77
78
79#endif // !ipackage_CComponentAccessor_included
80
81
InterfaceType * GetComponentInterface(const QByteArray &subId="")
Get interface implemented by this composite component.
A helper class to access public interfaces of a composite component.
CComponentAccessor(bool manualAutoInit=false)
Constructor.
bool EnsureAutoInitComponentsCreated() const
bool LoadRegistry(const QString &registryFile, const QString &configFile=QString(), bool isDiagnosticEnabled=false)
Loads registry file.
InterfaceType * GetComponentInterface(const QByteArray &componentId=QByteArray())
Gets component interface.
Package contains implementation for the management of ICF environment.

© Witold Gantzke and Kirill Lepskiy