CObjectSynchronizerComp.h
Go to the documentation of this file.
1 #ifndef ibase_CObjectSynchronizerComp_included
2 #define ibase_CObjectSynchronizerComp_included
3 
4 
5 // ACF includes
6 #include <icomp/CComponentBase.h>
8 #include <istd/IChangeable.h>
9 
10 
11 namespace ibase
12 {
13 
14 
23  public icomp::CComponentBase,
25 {
26 public:
28 
29  I_BEGIN_COMPONENT(CObjectSynchronizerComp);
30  I_ASSIGN(m_referenceObjectCompPtr, "ReferenceObject", "Reference data object", true, "ReferenceObject");
31  I_ASSIGN_TO(m_referenceObjectModelCompPtr, m_referenceObjectCompPtr, true);
32  I_ASSIGN_MULTI_0(m_slaveObjectsCompPtr, "SlaveObjects", "The list of object which will be hold synchronized with reference object", true);
33  I_END_COMPONENT;
34 
35 protected:
36  // reimplemented (imod::CSingleModelObserverBase)
37  virtual void OnUpdate(const istd::IChangeable::ChangeSet& changeSet);
38 
39  // reimplemented (icomp::CComponentBase)
40  virtual void OnComponentCreated();
41  virtual void OnComponentDestroyed();
42 
43 private:
44  I_REF(istd::IChangeable, m_referenceObjectCompPtr);
45  I_REF(imod::IModel, m_referenceObjectModelCompPtr);
46  I_MULTIREF(istd::IChangeable, m_slaveObjectsCompPtr);
47 };
48 
49 
50 } // namespace ibase
51 
52 
53 #endif // !ibase_CObjectSynchronizerComp_included
54 
55 
Basic implementation for a single model observer.
virtual void OnComponentDestroyed()
Base class for component implementation.
Common interface for data model objects, which can be changed.
Definition: IChangeable.h:24
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
Component for synchronization between some master data object and its "slaves".

© 2007-2017 Witold Gantzke and Kirill Lepskiy