OCRModule.h

00001 # ifndef OCRModule_h
00002 # define OCRModule_h OCRModule_h
00003 
00004 # include "ProcessComponent.h"
00005 # include "SegmentComponent.h"
00006 # include "IdentifyComponent.h"
00007 # include "FormatComponent.h"
00008 
00009 namespace Conjecture {
00010     // Forward Declarations
00011     class Env;
00012 
00047 
00048   class OCRModule {
00049   public:
00050     // Constructors/Destructors
00051     OCRModule();
00052     
00053     // Accessors
00054     //  - This class handles accessors for its algorithms differently than
00055     //    normal. The strategy is return non-const, and no 'xxxRef()'
00056     //    method is defined. This is because other classes always need
00057     //    non-const access to these algorithms in order to function.
00058     inline FormatComponent*          format()    const { return this->_format; }
00059     inline IdentifyComponent*        identify()  const { return this->_identify; }
00060     inline SegmentComponent*         segment()   const { return this->_segment; }
00061     inline ProcessComponent*         process()   const { return this->_process; }
00062     
00063     void init();
00064     
00065     // The Factory Methods that create every Component
00066     virtual ProcessComponent*        createProcessComponent()   const = 0;
00067     virtual SegmentComponent*        createSegmentComponent() const = 0;
00068     virtual IdentifyComponent*       createIdentifyComponent()  const = 0;
00069     virtual FormatComponent*         createFormatComponent()    const = 0;
00070 
00078     virtual void processArgs(int argc, const char** argv, Env* env = NULL) { }
00079 
00080   protected:
00081     // Accessors
00082     inline void                     formatIs(FormatComponent* format) { this->_format = format; }
00083     inline void                     identifyIs(IdentifyComponent* identify) { this->_identify = identify; }
00084     inline void                     segmentIs(SegmentComponent* segment) { this->_segment = segment; }
00085     inline void                     processIs(ProcessComponent* process) { this->_process = process; }
00086     
00087     // Methods 
00088     
00089   private: 
00090     // Accessors
00091 
00092     // Methods 
00093 
00094     // State
00095     FormatComponent*                 _format;
00096     IdentifyComponent*               _identify;
00097     SegmentComponent*                _segment;
00098     ProcessComponent*                _process;
00099   };
00100 };
00101 
00102 # endif // OCRModule_h
00103 

Generated on Wed Jun 14 15:08:02 2006 for Conjecture by  doxygen 1.4.6