ACF $AcfVersion:0$
CComponentContext.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// Qt includes
6#include <QtCore/QByteArray>
7#include <QtCore/QMap>
8#include <QtCore/QMutex>
9
10// ACF includes
12
13
14namespace icomp
15{
16
17
18class IRegistryElement;
19
20
27{
28public:
30 const IRegistryElement* elementPtr,
31 const IComponentStaticInfo* staticInfoPtr,
32 const IComponentContext* parentPtr,
33 const QByteArray& contextId);
34
35 QByteArray GetCompleteContextId() const;
36
37 // reimplemented (icomp::IComponentContext)
38 virtual const QByteArray& GetContextId() const override;
39 virtual const IRegistryElement& GetRegistryElement() const override;
40 virtual const IComponentStaticInfo& GetStaticInfo() const override;
41 virtual const IComponentContext* GetParentContext() const override;
42 virtual const iser::IObject* GetAttribute(const QByteArray& attributeId, int* definitionLevelPtr = NULL) const override;
43
44 // static methods
48 static QByteArray GetHierarchyAddress(const IComponentContext* contextPtr);
49
50protected:
56
57 bool CalcAttributeInfo(const QByteArray& attributeId, AttributeInfo& result) const;
58
59private:
60 const IRegistryElement& m_registryElement;
61 const IComponentStaticInfo& m_staticInfo;
62
63 const IComponentContext* m_parentPtr;
64
65 typedef QMap<QByteArray, AttributeInfo> AttributeMap;
66 mutable AttributeMap m_attributeMap;
67
68 QByteArray m_contextId;
69
70#if QT_VERSION >= 0x060000
71 mutable QRecursiveMutex m_attributeMapMutex;
72#else
73 mutable QMutex m_attributeMapMutex;
74#endif
75};
76
77
78} // namespace icomp
79
80
Base implementation of component session context.
QByteArray GetCompleteContextId() const
virtual const iser::IObject * GetAttribute(const QByteArray &attributeId, int *definitionLevelPtr=NULL) const override
Get attribute using its ID.
virtual const IComponentContext * GetParentContext() const override
Get access to parent component context.
virtual const IComponentStaticInfo & GetStaticInfo() const override
Get component static info associated with this context.
bool CalcAttributeInfo(const QByteArray &attributeId, AttributeInfo &result) const
static QByteArray GetHierarchyAddress(const IComponentContext *contextPtr)
Get address of this component identifying it in component topology hierarchy.
CComponentContext(const IRegistryElement *elementPtr, const IComponentStaticInfo *staticInfoPtr, const IComponentContext *parentPtr, const QByteArray &contextId)
virtual const QByteArray & GetContextId() const override
Get ID of this component in the context tree.
virtual const IRegistryElement & GetRegistryElement() const override
Get access to component registry element object.
Provide session context of component.
This interface provide static information about component meta info.
Represents element of registry describing component parameters.
Common interface for factorisable model objects.
Definition IObject.h:23
#define NULL
Definition istd.h:74
Package with interfaces and class used for components concept.