IProcessor.h
Go to the documentation of this file.
1 #ifndef iproc_IProcessor_included
2 #define iproc_IProcessor_included
3 
4 
5 #include "iprm/IParamsSet.h"
6 
8 
9 
10 namespace iproc
11 {
12 
13 
24 class IProcessor: virtual public istd::IPolymorphic
25 {
26 public:
27  enum MessageId
28  {
32  MI_BAD_PARAMS = 0x16372620,
34  };
35 
40  {
57  };
58 
62  enum TaskState
63  {
84  };
85 
91  virtual int GetProcessorState(const iprm::IParamsSet* paramsPtr) const = 0;
92 
99  virtual bool AreParamsAccepted(
100  const iprm::IParamsSet* paramsPtr,
101  const istd::IPolymorphic* inputPtr,
102  const istd::IChangeable* outputPtr) const = 0;
103 
108  virtual int DoProcessing(
109  const iprm::IParamsSet* paramsPtr,
110  const istd::IPolymorphic* inputPtr,
111  istd::IChangeable* outputPtr,
112  ibase::IProgressManager* progressManagerPtr = NULL) = 0;
113 
129  virtual int BeginTask(
130  const iprm::IParamsSet* paramsPtr,
131  const istd::IPolymorphic* inputPtr,
132  istd::IChangeable* outputPtr,
133  ibase::IProgressManager* progressManagerPtr = NULL) = 0;
134 
143  virtual int WaitTaskFinished(
144  int taskId = -1,
145  double timeoutTime = -1,
146  bool killOnTimeout = true) = 0;
147 
152  virtual void CancelTask(int taskId = -1) = 0;
153 
159  virtual int GetReadyTask() = 0;
160 
169  virtual int GetTaskState(int taskId = -1) const = 0;
170 
180  virtual void InitProcessor(const iprm::IParamsSet* paramsPtr) = 0;
181 };
182 
183 
184 } // namespace iproc
185 
186 
187 #endif // !iproc_IProcessor_included
188 
189 
virtual int GetReadyTask()=0
Get the ID of any ready task.
Task is during execution.
Definition: IProcessor.h:71
Task finished correctly.
Definition: IProcessor.h:75
ProcessorState
State of processing.
Definition: IProcessor.h:39
Processor is during initalisation.
Definition: IProcessor.h:48
virtual bool AreParamsAccepted(const iprm::IParamsSet *paramsPtr, const istd::IPolymorphic *inputPtr, const istd::IChangeable *outputPtr) const =0
Check if specified parameter set is accepted for this processor.
virtual int BeginTask(const iprm::IParamsSet *paramsPtr, const istd::IPolymorphic *inputPtr, istd::IChangeable *outputPtr, ibase::IProgressManager *progressManagerPtr=NULL)=0
Begin new task for this processor and add them to queue.
virtual int GetProcessorState(const iprm::IParamsSet *paramsPtr) const =0
Get state of this processor for processing of specified parameters.
Processor cannot be initialized.
Definition: IProcessor.h:56
virtual int GetTaskState(int taskId=-1) const =0
Get actual task state.
Processor is initialized and ready.
Definition: IProcessor.h:52
virtual void CancelTask(int taskId=-1)=0
Remove task from queue.
virtual int WaitTaskFinished(int taskId=-1, double timeoutTime=-1, bool killOnTimeout=true)=0
Wait for task is finished.
Bad processor parameter.
Definition: IProcessor.h:32
Task was canceled by user.
Definition: IProcessor.h:79
virtual int DoProcessing(const iprm::IParamsSet *paramsPtr, const istd::IPolymorphic *inputPtr, istd::IChangeable *outputPtr, ibase::IProgressManager *progressManagerPtr=NULL)=0
Do synchronized processing.
Interface for all synchrone and assynchrone processors with "push data" model.
Definition: IProcessor.h:24
Processing state is unknown or not initialized.
Definition: IProcessor.h:44
TaskState
Describe state of task.
Definition: IProcessor.h:62
virtual void InitProcessor(const iprm::IParamsSet *paramsPtr)=0
Init processor to optimal process with specified params.
Task finished but error is occured.
Definition: IProcessor.h:83
Task state is undefined.
Definition: IProcessor.h:67

© 2007-2011 Witold Gantzke and Kirill Lepskiy