ImagingTools Core SDK
CStructureSubscriberControllerComp.h
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ImtCore-Commercial
2#pragma once
3
4
5// ACF includes
6#include <imod/TSingleModelObserverBase.h>
7
8// ImtCore includes
9#include <imtservergql/CGqlPublisherCompBase.h>
10#include <imtbase/IHierarchicalStructure.h>
11
12
13namespace imtservergql
14{
15
16
17class CStructureSubscriberControllerComp:
18 public CGqlPublisherCompBase,
19 public imod::TSingleModelObserverBase<istd::IChangeable>
20{
21public:
22 typedef CGqlPublisherCompBase BaseClass;
23
24 I_BEGIN_COMPONENT(CStructureSubscriberControllerComp);
25 I_ASSIGN(m_collectionStructureCompPtr, "CollectionStructure", "Collection structure", true, "CollectionStructure");
26 I_ASSIGN_TO(m_modelCompPtr, m_collectionStructureCompPtr, true);
27 I_END_COMPONENT;
28
29protected:
30 // reimplemented (icomp::CComponentBase)
31 virtual void OnComponentCreated() override;
32 virtual void OnComponentDestroyed() override;
33
34 // reimplemented (imod::CSingleModelObserverBase)
35 virtual void OnUpdate(const istd::IChangeable::ChangeSet& changeSet) override;
36
37protected:
38 I_REF(imtbase::IHierarchicalStructure, m_collectionStructureCompPtr);
39 I_REF(imod::IModel, m_modelCompPtr);
40
41};
42
43
44} // namespace imtservergql
45
46