CComponentAccessor.h
Go to the documentation of this file.
1 #ifndef ipackage_CComponentAccessor_included
2 #define ipackage_CComponentAccessor_included
3 
4 
5 // ACF includes
6 #include <istd/TDelPtr.h>
10 
11 
12 namespace ipackage
13 {
14 
15 
20 {
21 public:
28  explicit CComponentAccessor(
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 
47 private:
48  icomp::CCompositeComponent m_mainComponent;
49 
50  istd::TDelPtr<icomp::IComponentStaticInfo> m_mainComponentStaticInfoPtr;
51  istd::TDelPtr<icomp::IComponentContext> m_mainComponentContextPtr;
52 };
53 
54 
55 template <class InterfaceType>
56 InterfaceType* 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 
66 
67 #endif // !ipackage_CComponentAccessor_included
68 
69 
CComponentAccessor(const QString &registryFile, const QString &configFile=QString(), bool isDiagnosticEnabled=false, bool manualAutoInit=false)
Constructor.
InterfaceType * GetComponentInterface(const QByteArray &componentId=QByteArray())
Gets component interface.
A helper class to access public interfaces of a composite component.
InterfaceType * GetComponentInterface(const QByteArray &subId="")
Get interface implemented by this composite component.
bool EnsureAutoInitComponentsCreated() const

© 2007-2017 Witold Gantzke and Kirill Lepskiy