IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BaseAsyncProcessor.h
1 // BaseAsyncProcessor.h:
3 // ---------------------
4 //
14 
15 #ifndef __IPSDKBASEPROCESSING_BASEASYNCPROCESSOR_H__
16 #define __IPSDKBASEPROCESSING_BASEASYNCPROCESSOR_H__
17 
18 #include <IPSDKBaseProcessing/Processor/BaseProcessor.h>
22 
23 namespace ipsdk {
24 namespace processor {
25 
28 
30 {
31  // declare serial class
33 
34 protected:
37 
38 public:
40  virtual ~BaseAsyncProcessor() = 0;
41 
42 // methods
43 public:
45  ipUInt32 getCurIterIdx() const;
46 
47 
50  ipsdk::ipReal64 getProgress(ElementInfosCounter& eic) const;
51 
52 
54  ipsdk::ipBool supportGpu() const;
55 
56 protected:
61  virtual ipUInt32 retrieveSequenceInfo() = 0;
62 
67  virtual RetrievalResult retrieveProvider(const core::BasePriority& priority,
68  const ipUInt32 curProviderIdx,
69  const ipUInt32 curNbIter,
70  core::ActionProviderPtr& pProvider) = 0;
71 
75 
79 
80 private:
83  ExecResultDerived runDerived();
84 
86  void requestCancellationdDerived();
87 
89  core::ExecResult execPreProcess();
90 
92  core::ExecResult execPostProcess();
93 
95  ExecResultDerived execSyncIter();
96 
98  ExecResultDerived execAsyncIter();
99 
101  void notifyProviderCompletion(const core::ActionProviderPtr& pProvider);
102 
104  using BaseComplexAction::execInitProcess;
105  using BaseComplexAction::execEndProcess;
106 
107 // attributes
108 private:
110  ipUInt32 _nbProviders;
111 
113  ipUInt32 _curProviderIdx;
114 
116  Guid _providerGuid;
117 
119 // static ipBool _bSupportGpu;
120 
121 // attribites
122 protected:
125 };
126 
129 
130 } // end of namespace processor
131 } // end of namespace ipsdk
132 
133 #endif // __IPSDKBASEPROCESSING_BASEASYNCPROCESSOR_H__
Class allowing to encapsulate a typed process result associated to a string description.
Definition: ProcessingResult.h:28
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
#define IPSDKBASEPROCESSING_API
Import/Export macro for library IPSDKBaseProcessing.
Definition: IPSDKBaseProcessingExports.h:27
ipUInt32 _curNbIter
flag to inform if the processor can use GPU devices for calculation
Definition: BaseAsyncProcessor.h:124
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
virtual core::ExecResult postProcess()
method called after processing
Definition: BaseAsyncProcessor.h:78
#define IPSDK_DECLARE_ABSTRACT_SERIAL_WITHOUT_COPY(libraryName, className)
macro enabling serialization on abstract class
Definition: SerializationHdrMacro.h:97
virtual core::ExecResult preProcess()
method called before processing
Definition: BaseAsyncProcessor.h:74
Base class for priority encapsulation.
Definition: BasePriority.h:32
Predefined types for asynchonous processor management.
Base class for processor class.
Definition: BaseProcessor.h:43
Class encapsulating an auto initialized uuid.
Definition: Guid.h:27
Predefined types for action provider management.
Base class for asynchronous processors.
Definition: BaseAsyncProcessor.h:29
ProcessingResult< eExecutionResult > ExecResult
type used to retrieve an execution result
Definition: ProcessingTypes.h:65
Execution is successful.
Definition: ProcessingTypes.h:53
bool ipBool
Base types definition.
Definition: BaseTypes.h:47
boost::shared_ptr< BaseActionProvider > ActionProviderPtr
shared pointer to action provider
Definition: ActionProviderTypes.h:58
Data type to retrieve the number of pending, processing and processed elements.
Definition: ElementInfosCounter.h:25
Utility class giving access (without modification) to some dispatcher information.
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53