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(int updateFlags, istd::IPolymorphic* updateParamsPtr);
46 
47 private:
48  void DoProcessing();
49 
50 private:
51  class ParamsObserver: public imod::TSingleModelObserverBase<iprm::IParamsSet>
52  {
53  public:
54  ParamsObserver(CModelBasedProcessingTriggerComp* parentPtr);
55 
56  // reimplemented (imod::CSingleModelObserverBase)
57  virtual void OnUpdate(int updateFlags, istd::IPolymorphic* updateParamsPtr);
58 
59  private:
61  };
62 
63 private:
64  I_REF(iproc::IProcessor, m_processorCompPtr);
65  I_REF(ibase::IProgressManager, m_progressManagerCompPtr);
66  I_REF(iprm::IParamsSet, m_paramsSetCompPtr);
67  I_REF(imod::IModel, m_paramsSetModelCompPtr);
68  I_REF(istd::IChangeable, m_outputDataCompPtr);
69  I_ATTR(bool, m_triggerOnParamsChangeAttrPtr);
70 
71  ParamsObserver m_paramsObserver;
72 };
73 
74 
75 } // namespace iproc
76 
77 
78 #endif // !iproc_CModelBasedProcessingTriggerComp_included
79 
80 
Component to trigger a processing action depending on model changes.
Interface for all synchrone and assynchrone processors with "push data" model.
Definition: IProcessor.h:24
virtual void OnUpdate(int updateFlags, istd::IPolymorphic *updateParamsPtr)
I_ASSIGN_TO(m_paramsSetModelCompPtr, m_paramsSetCompPtr, false)

© 2007-2011 Witold Gantzke and Kirill Lepskiy