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
00049 StrategyFactory();
00050
00051
00052
00053
00054
00055
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
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
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
00077
00078 private:
00079
00080
00081
00082
00083
00084 FormatStrategy* _format;
00085 IdentifyStrategy* _identify;
00086 SegmentStrategy* _segment;
00087 ProcessStrategy* _process;
00088 };
00089 };
00090
00091 # endif // StrategyFactory_h
00092