ICF 3.1.1.10
Technical documentation of ICF Libraries
CEnableableParam.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#ifndef iprm_CEnableableParam_included
7#define iprm_CEnableableParam_included
8
9
10// ICF includes
12
13
14namespace iprm
15{
16
17
22{
23public:
24 CEnableableParam(bool isEnabled = true);
25
26 // reimplemented (iprm::IEnableableParam)
27 bool IsEnabled() const override;
28 bool IsEnablingAllowed() const override;
29 bool SetEnabled(bool isEnabled = true) override;
30
31 // reimplemented (iser::ISerializable)
32 bool Serialize(iser::IArchive& archive) override;
33
34 // reimplemented (istd::IChangeable)
35 bool CopyFrom(const IChangeable& object, CompatibilityMode mode = CM_WITHOUT_REFS) override;
36 std::unique_ptr<istd::IChangeable> CloneMe(istd::IChangeable::CompatibilityMode mode = istd::IChangeable::CM_WITHOUT_REFS) const override;
37
38private:
39 bool m_isEnabled;
40};
41
42
43} // namespace iprm
44
45
46#endif // iprm_CEnableableParam_included
47
48
Basic implementation of IEnableableParam interface.
bool IsEnablingAllowed() const override
Return a true, if something can be enabled.
std::unique_ptr< istd::IChangeable > CloneMe(istd::IChangeable::CompatibilityMode mode=istd::IChangeable::CM_WITHOUT_REFS) const override
Make a copy of this object.
bool SetEnabled(bool isEnabled=true) override
Set something to isEnabled state.
CEnableableParam(bool isEnabled=true)
bool CopyFrom(const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS) override
bool IsEnabled() const override
Return a true, if something is enabled.
bool Serialize(iser::IArchive &archive) override
Load or store state of this object as a archive stream.
Interface for objects which can be enabled/disabled.
Represent input/output persistence archive.
Definition IArchive.h:34
CompatibilityMode
Control how relationship betweeen objects are interpreted.
@ CM_WITHOUT_REFS
External references are simple ignored.
Contains interfaces and implementations of flexible parameter concept.

© Witold Gantzke and Kirill Lepskiy