CIterativeProcessorComp.h
Go to the documentation of this file.
1 #ifndef iproc_CIterativeProcessorComp_included
2 #define iproc_CIterativeProcessorComp_included
3 
4 
5 // Qt includes
6 #include <QtCore/QString>
7 #include <QtCore/QVector>
8 
9 // ACF includes
10 #include "ilog/TLoggerCompWrap.h"
11 
12 #include "iprm/IOptionsList.h"
13 
15 
16 
17 namespace iproc
18 {
19 
20 
28  virtual public iprm::IOptionsList
29 {
30 public:
33 
34  enum MessageId
35  {
36  MI_BAD_BUFFER = 0x6b30
37  };
38 
39  I_BEGIN_COMPONENT(CIterativeProcessorComp);
40  I_REGISTER_INTERFACE(iproc::IProcessor);
41  I_REGISTER_INTERFACE(iprm::IOptionsList);
42  I_ASSIGN(m_paramsIdAttrPtr, "IterationParamId", "ID of parameter defining number of iterations (type iprm::ISelectionParam)", true, "ParamsId");
43  I_ASSIGN(m_maxIterationsCountAttrPtr, "MaxIterations", "Maximal number of iterations", true, 10);
44  I_ASSIGN(m_bufferObjectCompPtr, "BufferObject", "Object used as buffer between single processing steps", true, "BufferObject");
45  I_ASSIGN(m_slaveProcessorCompPtr, "SlaveProcessor", "Slave image processor", true, "SlaveProcessor");
46  I_END_COMPONENT;
47 
48  // reimplemented (iproc::IProcessor)
49  virtual int DoProcessing(
50  const iprm::IParamsSet* paramsPtr,
51  const istd::IPolymorphic* inputPtr,
52  istd::IChangeable* outputPtr,
53  ibase::IProgressManager* progressManagerPtr = NULL);
54 
55  // reimplemented (iprm::IOptionsList)
56  virtual int GetOptionsFlags() const;
57  virtual int GetOptionsCount() const;
58  virtual QString GetOptionName(int index) const;
59  virtual QString GetOptionDescription(int index) const;
60  virtual QByteArray GetOptionId(int index) const;
61  virtual bool IsOptionEnabled(int index) const;
62 
63 protected:
64  int ProcessSlave(
65  const iprm::IParamsSet* paramsPtr,
66  const istd::IPolymorphic* inputPtr,
67  istd::IChangeable* outputPtr);
68 
69  // reimplemented (icomp::CComponentBase)
70  virtual void OnComponentCreated();
71 
72 private:
73  I_ATTR(QByteArray, m_paramsIdAttrPtr);
74  I_ATTR(int, m_maxIterationsCountAttrPtr);
75  I_REF(istd::IChangeable, m_bufferObjectCompPtr);
76  I_REF(iproc::IProcessor, m_slaveProcessorCompPtr);
77 
78  QVector<QString> m_iterationNames;
79 };
80 
81 
82 } // namespace iproc
83 
84 
85 #endif // !iproc_CIterativeProcessorComp_included
86 
87 
Processor wrapper for multiple executing of a slave processor.
Wrapper of iproc::IProcessor for simple synchrone processor implementations.
virtual int GetOptionsCount() const
virtual QString GetOptionName(int index) const
int ProcessSlave(const iprm::IParamsSet *paramsPtr, const istd::IPolymorphic *inputPtr, istd::IChangeable *outputPtr)
virtual int DoProcessing(const iprm::IParamsSet *paramsPtr, const istd::IPolymorphic *inputPtr, istd::IChangeable *outputPtr, ibase::IProgressManager *progressManagerPtr=NULL)
virtual int GetOptionsFlags() const
ilog::CLoggerComponentBase BaseClass
virtual bool IsOptionEnabled(int index) const
iproc::CSyncProcessorBase BaseClass2
Interface for all synchrone and assynchrone processors with "push data" model.
Definition: IProcessor.h:24
virtual QByteArray GetOptionId(int index) const
virtual QString GetOptionDescription(int index) const

© 2007-2011 Witold Gantzke and Kirill Lepskiy