CModelBasedProcessingTriggerComp.h
Go to the documentation of this file.
1 #ifndef iproc_CModelBasedProcessingTriggerComp_included
2 #define iproc_CModelBasedProcessingTriggerComp_included
3 
4 
5 // ACF includes
6 #include <ilog/TLoggerCompWrap.h>
7 
9 
10 #include <iproc/IProcessor.h>
11 
12 
13 namespace iproc
14 {
15 
16 
23 {
24 public:
26 
27  I_BEGIN_COMPONENT(CModelBasedProcessingTriggerComp);
28  I_REGISTER_INTERFACE(imod::IObserver);
29  I_ASSIGN(m_processorCompPtr, "Processor", "Target processing component", true, "Processor");
30  I_ASSIGN(m_progressManagerCompPtr, "ProgressManager", "Processing progress manager", false, "ProgressManager");
31  I_ASSIGN(m_paramsSetCompPtr, "ProcessingParamsSet", "Processing parameters", false, "ProcessingParameters");
32  I_ASSIGN_TO(m_paramsSetModelCompPtr, m_paramsSetCompPtr, false);
33  I_ASSIGN(m_outputDataCompPtr, "OutputData", "Processing output data", true, "OutputData");
34  I_ASSIGN(m_triggerOnParamsChangeAttrPtr, "TriggerOnParameterChanges", "Start processing if the parameters have been changed", true, false);
35  I_END_COMPONENT;
36 
38 
39  // reimplemented (icomp::CComponentBase)
40  virtual void OnComponentCreated();
41  virtual void OnComponentDestroyed();
42 
43 protected:
44  // reimplemented (imod::CSingleModelObserverBase)
45  virtual void OnUpdate(const istd::IChangeable::ChangeSet& changeSet);
46 
47 private:
48  void DoProcessing();
49 
50 private:
55  class ParamsObserver: public imod::TSingleModelObserverBase<iprm::IParamsSet>
56  {
57  public:
58  ParamsObserver(CModelBasedProcessingTriggerComp* parentPtr);
59 
60  // reimplemented (imod::CSingleModelObserverBase)
61  virtual void OnUpdate(const istd::IChangeable::ChangeSet& changeSet);
62 
63  private:
65  };
66 
67 private:
68  I_REF(iproc::IProcessor, m_processorCompPtr);
69  I_REF(ibase::IProgressManager, m_progressManagerCompPtr);
70  I_REF(iprm::IParamsSet, m_paramsSetCompPtr);
71  I_REF(imod::IModel, m_paramsSetModelCompPtr);
72  I_REF(istd::IChangeable, m_outputDataCompPtr);
73  I_ATTR(bool, m_triggerOnParamsChangeAttrPtr);
74 
75  ParamsObserver m_paramsObserver;
76 
77  bool m_isLocked;
78 };
79 
80 
81 } // namespace iproc
82 
83 
84 #endif // !iproc_CModelBasedProcessingTriggerComp_included
85 
86 
virtual void OnUpdate(const istd::IChangeable::ChangeSet &changeSet)
Component to trigger a processing action depending on model changes.
Interface for all synchrone and asynchrone processors with "push data" model.
Definition: IProcessor.h:24

© 2007-2017 Witold Gantzke and Kirill Lepskiy