ACF $AcfVersion:0$
IComponent.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// STL includes
6#include <memory>
7
8// Qt includes
9#include <QtCore/QByteArray>
10
11// ACF includes
12#include <istd/TInterfacePtr.h>
14
15
16namespace istd
17{
18 class CClassInfo;
19}
20
21
22namespace icomp
23{
24
25
31class IComponent: virtual public istd::IPolymorphic
32{
33public:
41 virtual const icomp::IComponent* GetParentComponent(bool ownerOnly = false) const = 0;
42
48 virtual void* GetInterface(const istd::CClassInfo& interfaceType, const QByteArray& subId = "") = 0;
49
55
64 virtual void SetComponentContext(
65 const IComponentContextSharedPtr& contextPtr,
66 const icomp::IComponent* parentPtr,
67 bool isParentOwner) = 0;
68};
69
70
71typedef std::shared_ptr<IComponent> IComponentSharedPtr;
72typedef std::unique_ptr<IComponent> IComponentUniquePtr;
73
74
75} // namespace icomp
76
77
Main component interface.
Definition IComponent.h:32
virtual const icomp::IComponent * GetParentComponent(bool ownerOnly=false) const =0
Get parent of this component.
virtual void SetComponentContext(const IComponentContextSharedPtr &contextPtr, const icomp::IComponent *parentPtr, bool isParentOwner)=0
Set component context of this component.
virtual IComponentContextSharedPtr GetComponentContext() const =0
Get access to component context describing all application-specified component information loaded fro...
virtual void * GetInterface(const istd::CClassInfo &interfaceType, const QByteArray &subId="")=0
Get access to specified component interface.
Represents platform independent type info and provide set of static class manipulation functions.
Definition CClassInfo.h:23
Base interface for all used interfaces and implementations.
Package with interfaces and class used for components concept.
std::unique_ptr< IComponent > IComponentUniquePtr
Definition IComponent.h:72
std::shared_ptr< icomp::IComponentContext > IComponentContextSharedPtr
std::shared_ptr< IComponent > IComponentSharedPtr
Definition IComponent.h:71
Standard library.
Definition IComponent.h:17