StrategyFactory.h

00001 # ifndef StrategyFactory_h
00002 # define StrategyFactory_h StrategyFactory_h
00003 
00004 # include "ProcessStrategy.h"
00005 # include "SegmentStrategy.h"
00006 # include "IdentifyStrategy.h"
00007 # include "FormatStrategy.h"
00008 
00009 namespace Conjecture {
00010 
00045 
00046   class StrategyFactory {
00047   public:
00048     // Constructors/Destructors
00049     StrategyFactory();
00050     
00051     // Accessors
00052     //  - This class handles accessors for its algorithms differently than
00053     //    normal. The strategy is return non-const, and no 'xxxRef()'
00054     //    method is defined. This is because other classes always need
00055     //    non-const access to these algorithms in order to function.
00056     inline FormatStrategy*          format()    const { return this->_format; }
00057     inline IdentifyStrategy*        identify()  const { return this->_identify; }
00058     inline SegmentStrategy*         segment()   const { return this->_segment; }
00059     inline ProcessStrategy*         process()   const { return this->_process; }
00060     
00061     void init();
00062     
00063     // Miscellaneous
00064     virtual ProcessStrategy*        createProcessStrategy()   const = 0;
00065     virtual SegmentStrategy*        createSegmentStrategy() const = 0;
00066     virtual IdentifyStrategy*       createIdentifyStrategy()  const = 0;
00067     virtual FormatStrategy*         createFormatStrategy()    const = 0;
00068 
00069   protected:
00070     // Accessors
00071     inline void                     formatIs(FormatStrategy* format) { this->_format = format; }
00072     inline void                     identifyIs(IdentifyStrategy* identify) { this->_identify = identify; }
00073     inline void                     segmentIs(SegmentStrategy* segment) { this->_segment = segment; }
00074     inline void                     processIs(ProcessStrategy* process) { this->_process = process; }
00075     
00076     // Methods 
00077     
00078   private: 
00079     // Accessors
00080 
00081     // Methods 
00082 
00083     // State
00084     FormatStrategy*                 _format;
00085     IdentifyStrategy*               _identify;
00086     SegmentStrategy*                _segment;
00087     ProcessStrategy*                _process;
00088   };
00089 };
00090 
00091 # endif // StrategyFactory_h
00092 

Generated on Mon Jun 12 20:27:15 2006 for Conjecture by  doxygen 1.4.6