ICF 3.1.1.10
Technical documentation of ICF Libraries
CModelBasedProcessingTriggerComp.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 iproc_CModelBasedProcessingTriggerComp_included
7#define iproc_CModelBasedProcessingTriggerComp_included
8
9
10// ICF includes
12
14
15#include <iproc/IProcessor.h>
16
17
18namespace iproc
19{
20
21
28{
29public:
31
32 I_BEGIN_COMPONENT(CModelBasedProcessingTriggerComp);
33 I_REGISTER_INTERFACE(imod::IObserver);
34 I_ASSIGN(m_processorCompPtr, "Processor", "Target processing component", true, "Processor");
35 I_ASSIGN(m_progressManagerCompPtr, "ProgressManager", "Processing progress manager", false, "ProgressManager");
36 I_ASSIGN(m_paramsSetCompPtr, "ProcessingParamsSet", "Processing parameters", false, "ProcessingParameters");
37 I_ASSIGN_TO(m_paramsSetModelCompPtr, m_paramsSetCompPtr, false);
38 I_ASSIGN(m_outputDataCompPtr, "OutputData", "Processing output data", true, "OutputData");
39 I_ASSIGN(m_triggerOnParamsChangeAttrPtr, "TriggerOnParameterChanges", "Start processing if the parameters have been changed", true, false);
40 I_END_COMPONENT;
41
43
44 // reimplemented (icomp::CComponentBase)
45 void OnComponentCreated() override;
46 void OnComponentDestroyed() override;
47
48protected:
49 // reimplemented (imod::CSingleModelObserverBase)
50 void OnUpdate(const istd::IChangeable::ChangeSet& changeSet) override;
51
52private:
53 void DoProcessing();
54
55private:
60 class ParamsObserver: public imod::TSingleModelObserverBase<iprm::IParamsSet>
61 {
62 public:
63 ParamsObserver(CModelBasedProcessingTriggerComp* parentPtr);
64
65 // reimplemented (imod::CSingleModelObserverBase)
66 virtual void OnUpdate(const istd::IChangeable::ChangeSet& changeSet);
67
68 private:
70 };
71
72private:
73 I_REF(iproc::IProcessor, m_processorCompPtr);
74 I_REF(iproc::IProgressManager, m_progressManagerCompPtr);
75 I_REF(iprm::IParamsSet, m_paramsSetCompPtr);
76 I_REF(imod::IModel, m_paramsSetModelCompPtr);
77 I_REF(istd::IChangeable, m_outputDataCompPtr);
78 I_ATTR(bool, m_triggerOnParamsChangeAttrPtr);
79
80 ParamsObserver m_paramsObserver;
81
82 bool m_isLocked;
83};
84
85
86} // namespace iproc
87
88
89#endif // !iproc_CModelBasedProcessingTriggerComp_included
90
91
Wrapper provider of log-functionality for component based implementations.
Basic implementation for a single model observer.
Common interface for model objects, that supports Model/Observer design pattern.
Definition IModel.h:29
Common interface for all classes implementing the Observer functionality in the Model/Observer design...
Definition IObserver.h:30
Basic implementation for a single model observer with binding to concrete data object interface.
Set of general parameters.
Definition IParamsSet.h:29
Component to trigger a processing action depending on model changes.
void OnUpdate(const istd::IChangeable::ChangeSet &changeSet) override
Called on update of observed model.
Interface for all synchrone and asynchrone processors with "push data" model.
Definition IProcessor.h:26
Consume information about progress of some process.
Set of change flags (its IDs).
Definition IChangeable.h:38
Common interface for data model objects, which can be changed.
Definition IChangeable.h:32
This namespace containes interfaces and implementation of data processing concepts.

© Witold Gantzke and Kirill Lepskiy