ACF $AcfVersion:0$
CParamsSetDelegatorComp.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
7#include <iprm/IParamsSet.h>
9
10
11namespace iprm
12{
13
14
21 virtual public iprm::IParamsSet
22{
23public:
26
27 I_BEGIN_COMPONENT(CParamsSetDelegatorComp);
28 I_REGISTER_INTERFACE(iprm::IParamsSet);
29 I_REGISTER_INTERFACE(iser::IObject);
30 I_REGISTER_INTERFACE(iser::ISerializable);
31 I_REGISTER_INTERFACE(istd::IChangeable);
32 I_ASSIGN(m_slaveParamsSetCompPtr, "SlaveParamsSet", "Delegated parameters set", false, "SlaveParamsSet");
33 I_ASSIGN(m_typeIdAttrPtr, "TypeId", "Type ID if differs from slave object", false, "Default");
34 I_ASSIGN(m_modelCompPtr, "SlaveChangesModel", "Model to intercept changes from (can be differ from SlaveParamsSet)", false, "SlaveChangesModel");
35 I_END_COMPONENT;
36
38
39 // reimplemented (iprm::IParamsSet)
40 virtual Ids GetParamIds(bool editableOnly = false) const override;
41 virtual const iser::ISerializable* GetParameter(const QByteArray& id) const override;
42 virtual iser::ISerializable* GetEditableParameter(const QByteArray& id) override;
43 virtual const IParamsInfoProvider* GetParamsInfoProvider() const override;
44
45 // reimplemented (iser::IObject)
46 virtual QByteArray GetFactoryId() const override;
47
48 // reimplemented (iser::ISerializable)
49 virtual bool Serialize(iser::IArchive& archive) override;
50
51 // reimplemented (istd::IChangeable)
52 virtual bool CopyFrom(const IChangeable& object, CompatibilityMode mode = CM_WITHOUT_REFS) override;
53
54protected:
55 // reimplemented (icomp::CComponentBase)
56 virtual void OnComponentCreated() override;
57 virtual void OnComponentDestroyed() override;
58
59private:
60 I_REF(iprm::IParamsSet, m_slaveParamsSetCompPtr);
61 I_ATTR(QByteArray, m_typeIdAttrPtr);
62 I_REF(imod::IModel, m_modelCompPtr);
63};
64
65
66} // namespace iprm
67
68
69
70
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
Delegator of the parameter set interface.
virtual void OnComponentCreated() override
virtual bool Serialize(iser::IArchive &archive) override
Load or store state of this object as a archive stream.
imod::CModelUpdateBridge BaseClass2
virtual bool CopyFrom(const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS) override
virtual QByteArray GetFactoryId() const override
virtual const iser::ISerializable * GetParameter(const QByteArray &id) const override
Get any parameter (read-only access).
virtual iser::ISerializable * GetEditableParameter(const QByteArray &id) override
Get access to editable parameter (read-write access).
virtual const IParamsInfoProvider * GetParamsInfoProvider() const override
Get parameter information provider.
virtual Ids GetParamIds(bool editableOnly=false) const override
Get list of used parameter IDs in the parameter set.
virtual void OnComponentDestroyed() override
Provider of parameter information (name and description).
Set of general parameters.
Definition IParamsSet.h:81
QSet< QByteArray > Ids
Definition IParamsSet.h:83
Represents an input/output persistence archive for object serialization.
Definition IArchive.h:164
Common interface for factorisable model objects.
Definition IObject.h:23
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.