ACF $AcfVersion:0$
CDelegatedEnableableParamComp.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
9
10
11namespace iprm
12{
13
14
18{
19public:
21
22 I_BEGIN_COMPONENT(CDelegatedEnableableParamComp);
23 I_REGISTER_INTERFACE(iprm::IEnableableParam);
24 I_REGISTER_INTERFACE(iser::ISerializable);
25 I_REGISTER_INTERFACE(istd::IChangeable);
26 I_ASSIGN(m_baseEnableableParamCompPtr, "BaseEnabler", "Base enableable parameter", false, "BaseEnabler");
27 I_ASSIGN_TO(m_baseEnableableParamModelCompPtr, m_baseEnableableParamCompPtr, false);
28 I_END_COMPONENT;
29
31
32protected:
33 // reimplemented (iprm::IEnableableParam)
34 virtual bool IsEnabled() const override;
35 virtual bool IsEnablingAllowed() const override;
36 virtual bool SetEnabled(bool isEnabled = true) override;
37
38 // reimplemented (iser::ISerializable)
39 virtual bool Serialize(iser::IArchive& archive) override;
40
41 // reimplemented (istd::IChangeable)
42 virtual bool CopyFrom(const IChangeable& object, CompatibilityMode mode = CM_WITHOUT_REFS) override;
43
44 // reimplemented (icomp::CComponentBase)
45 virtual void OnComponentCreated() override;
46 virtual void OnComponentDestroyed() override;
47
48private:
49 I_REF(iprm::IEnableableParam, m_baseEnableableParamCompPtr);
50 I_REF(imod::IModel, m_baseEnableableParamModelCompPtr);
51
52 imod::CModelUpdateBridge m_updateBridge;
53};
54
55
56} // namespace iprm
57
58
Base class for component implementation.
Reflects the changes of observed objects as changes of some other object (over istd::IChangeable),...
Common interface for model objects, that supports Model/Observer design pattern.
Definition IModel.h:25
virtual bool CopyFrom(const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS) override
virtual bool IsEnabled() const override
Return true if something is enabled.
virtual void OnComponentDestroyed() override
virtual bool IsEnablingAllowed() const override
Return true if enabling/disabling is allowed.
virtual void OnComponentCreated() override
virtual bool Serialize(iser::IArchive &archive) override
Load or store state of this object as a archive stream.
virtual bool SetEnabled(bool isEnabled=true) override
Set the enabled state.
Interface for objects which can be enabled/disabled.
Represents an input/output persistence archive for object serialization.
Definition IArchive.h:164
Common class for all classes which objects can be archived or restored from archive.
Common interface for data model objects, which can be changed.
Definition IChangeable.h:28
CompatibilityMode
Control how relationship betweeen objects are interpreted.
@ CM_WITHOUT_REFS
External references are simple ignored.
Contains interfaces and implementations of flexible parameter concept.