FileProducerFactory.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2004 CSIRO ICT Centre
00003  *
00004  * $Id: FileProducerFactory.h 5491 2009-02-05 18:09:29Z RossCollins $
00005  */
00006 
00007 /*
00008  * A factory of ObjectProducers that read objects from files.
00009  *
00010  * The files may be a single file, or multiple (split) files,
00011  * with binary or ascii content.
00012  *
00013  * This is a singleton class, call using FileProducerFactory::instance().
00014  *
00015  * The new object producers returned must be deleted by the caller.
00016  */
00017 
00018 #ifndef FILEPRODUCERFACTORY_DEFINED
00019 #define FILEPRODUCERFACTORY_DEFINED
00020 
00021 #include "String.h"
00022 #include <vector>
00023 
00024 #include "Destroyer.h"
00025 #include "FileHeader.h"
00026 
00027 class ObjectProducer;
00028 
00029 
00030 class FileProducerFactory
00031 {
00032   public:
00033     static FileProducerFactory * instance()
00034     {
00035       if (s_instance == 0)
00036       {
00037         s_instance = new FileProducerFactory();
00038         DestroyerInit(s_instance)
00039       }
00040       return s_instance;
00041     }
00042     DestroyerFriend(FileProducerFactory)
00043 
00044     ~FileProducerFactory() {};
00045 
00046     ObjectProducer * createProducer(char * dir, char * prefix,
00047                                     bool isBinary, bool isMerge, bool isLarge,
00048                                     double maxSD);
00049 
00050     ObjectProducer * createProducer(char * dir, char * prefix,
00051                                     bool isBinary, bool isMerge, bool isLarge,
00052                                     double orthoSD, double decSD);
00053 
00054     ObjectProducer * createProducer(char * dir, char * prefix,
00055                                     bool isBinary, bool isMerge, bool isLarge,
00056                                     bool setMaxSDs=false);
00057 
00058   private:
00059     DestroyerDefine(FileProducerFactory)
00060     static FileProducerFactory * s_instance;
00061 
00062     FileProducerFactory() {};
00063     FileProducerFactory(FileProducerFactory const &);
00064     FileProducerFactory & operator=(FileProducerFactory const &);
00065 
00066     ObjectProducer * createSplitProducer(char * dir, char * prefix,
00067                                          bool isBinary, bool isMerge, bool isLarge,
00068                                          bool setMaxSDs, unsigned short numSDs=0,
00069                                          double maxSD=0.0,
00070                                          double orthoSD=0.0, double decSD=0.0);
00071 
00072     ObjectProducer * createProducer(char * name, bool isBinary, bool isLarge,
00073                                     bool setMaxSDs, unsigned short numSDs=0,
00074                                     double maxSD=0.0,
00075                                     double orthoSD=0.0, double decSD=0.0);
00076 };
00077 
00078 #endif // ifndef FILEPRODUCERFACTORY_DEFINED
Generated on Mon Oct 4 10:39:55 2010 for Matching.kdevelop by  doxygen 1.6.3