ACF $AcfVersion:0$
CModelBinderComp.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 <imod/IModel.h>
7#include <imod/IObserver.h>
9
10
11namespace ibase
12{
13
14
27{
28public:
30
31 I_BEGIN_COMPONENT(CModelBinderComp);
32 I_ASSIGN(m_modelCompPtr, "Model", "Model to be connected", true, "Model");
33 I_ASSIGN_MULTI_0(m_observersCompPtr, "Observers", "Observers for the model", true);
34 I_END_COMPONENT;
35
36protected:
37 // reimplemented (icomp::CComponentBase)
38 virtual void OnComponentCreated() override;
39 virtual void OnComponentDestroyed() override;
40
41private:
45 I_REF(imod::IModel, m_modelCompPtr);
46
50 I_MULTIREF(imod::IObserver, m_observersCompPtr);
51};
52
53
54} // namespace ibase
55
56
57
58
Implementation of a simple model-observer binder component.
icomp::CComponentBase BaseClass
virtual void OnComponentDestroyed() override
virtual void OnComponentCreated() override
Base class for component implementation.
Common interface for model objects, that supports Model/Observer design pattern.
Definition IModel.h:25
Common interface for all classes implementing the Observer functionality in the Model/Observer design...
Definition IObserver.h:156
This namespace contains basic implementations of standard primitives on the component level.