ACF $AcfVersion:0$
CComponentAccessor.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ACF-Commercial
2#pragma once
3
4
5// ACF includes
6#include <istd/TDelPtr.h>
10
11
12namespace ipackage
13{
14
15
20{
21public:
29 const QString& registryFile,
30 const QString& configFile = QString(),
31 bool isDiagnosticEnabled = false,
32 bool manualAutoInit = false);
33
42 template <class InterfaceType>
43 InterfaceType* GetComponentInterface(const QByteArray& componentId = QByteArray());
44
46
47private:
48 icomp::CCompositeComponent m_mainComponent;
49
50 istd::TDelPtr<icomp::IComponentStaticInfo> m_mainComponentStaticInfoPtr;
51 icomp::IComponentContextSharedPtr m_mainComponentContextPtr;
52};
53
54
55template <class InterfaceType>
56InterfaceType* CComponentAccessor::GetComponentInterface(const QByteArray& componentId)
57{
58 InterfaceType* interfacePtr = m_mainComponent.GetComponentInterface<InterfaceType>(componentId);
59
60 return interfacePtr;
61}
62
63
64} // namespace ipackage
65
InterfaceType * GetComponentInterface(const QByteArray &subId="")
Get interface implemented by this composite component.
A helper class to access public interfaces of a composite component.
CComponentAccessor(const QString &registryFile, const QString &configFile=QString(), bool isDiagnosticEnabled=false, bool manualAutoInit=false)
Constructor.
bool EnsureAutoInitComponentsCreated() const
InterfaceType * GetComponentInterface(const QByteArray &componentId=QByteArray())
Gets component interface.
Pointer wrapper providing automatic deleting pointed object during destruction.
Definition TDelPtr.h:21
std::shared_ptr< icomp::IComponentContext > IComponentContextSharedPtr
Package contains implementation for the management of ACF environment.