CManagerParamsSetShadowerComp.h
Go to the documentation of this file.
1 #ifndef iprm_CManagerParamsSetShadowerComp_included
2 #define iprm_CManagerParamsSetShadowerComp_included
3 
4 
5 #include <icomp/CComponentBase.h>
6 
8 
9 #include <iprm/IOptionsList.h>
10 #include <iprm/IParamsSet.h>
11 #include <iprm/ISelectionParam.h>
12 #include <iprm/IParamsManager.h>
13 
14 
15 namespace iprm
16 {
17 
18 
23  public icomp::CComponentBase,
25 {
26 public:
28 
29  I_BEGIN_COMPONENT(CManagerParamsSetShadowerComp);
30  I_ASSIGN(m_paramsManagerCompPtr, "ParamsManager", "Manager of parameter set used to realize selection", true, "ParamsManager");
31  I_ASSIGN_TO(m_paramsManagerModelCompPtr, m_paramsManagerCompPtr, true);
32  I_ASSIGN(m_selectionParamCompPtr, "SelectionParam", "Selection parameter choising some object in parameter manager", true, "SelectionParam");
33  I_ASSIGN(m_shadowParamsSetCompPtr, "ShadowParamsSet", "Shadow parameter set where current selected set will be copied", true, "ShadowParamsSet");
34  I_END_COMPONENT;
35 
37 
38 protected:
42  bool CopyParamsSetToShadow();
43 
50 
51  // reimplemented (icomp::CComponentBase)
52  virtual void OnComponentCreated();
53  virtual void OnComponentDestroyed();
54 
55  // reimplemented (imod::CSingleModelObserverBase)
56  virtual void OnUpdate(const istd::IChangeable::ChangeSet& changeSet);
57 
58 private:
63  class CurrentParamsSetObserver: public imod::CSingleModelObserverBase
64  {
65  public:
66  explicit CurrentParamsSetObserver(CManagerParamsSetShadowerComp* parentPtr);
67 
68  // reimplemented (imod::CSingleModelObserverBase)
69  virtual void OnUpdate(const istd::IChangeable::ChangeSet& changeSet);
70 
71  private:
73  };
74 
75  CurrentParamsSetObserver m_currentParamsSetObserver;
76  imod::IModel* m_currentParamsModelPtr;
77 
78  I_REF(IParamsManager, m_paramsManagerCompPtr);
79  I_REF(imod::IModel, m_paramsManagerModelCompPtr);
80  I_REF(ISelectionParam, m_selectionParamCompPtr);
81  I_REF(IParamsSet, m_shadowParamsSetCompPtr);
82 };
83 
84 
85 } // namespace iprm
86 
87 
88 #endif // !iprm_CManagerParamsSetShadowerComp_included
89 
90 
Basic implementation for a single model observer.
Keep parameter set with selected one synchronized.
Manager of parameters set.
Base class for component implementation.
void SetupCurrentParamsSetBridge()
Set the bridge to the currently selected parameter set.
virtual void OnUpdate(const istd::IChangeable::ChangeSet &changeSet)
Called on update of observed model.
Common interface for model objects, that supports Model/Observer design pattern.
Definition: IModel.h:23
Set of change flags (its IDs).
Definition: IChangeable.h:30
Interface allowing to select single option from list of options.
Set of general parameters.
Definition: IParamsSet.h:23
bool CopyParamsSetToShadow()
Do copy current selected parameter set to shadow object.

© 2007-2017 Witold Gantzke and Kirill Lepskiy