contrib/oxl/mvl/FileNameGeneratorBase.h
Go to the documentation of this file.
00001 // This is oxl/mvl/FileNameGeneratorBase.h
00002 #ifndef FileNameGeneratorBase_h_
00003 #define FileNameGeneratorBase_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //
00008 // \author
00009 //     Andrew W. Fitzgibbon, Oxford RRG, 28 Aug 98
00010 //
00011 // \verbatim
00012 // Modifications
00013 //  Dec.2001 - Ported to vxl by Peter Vanroose
00014 // \endverbatim
00015 //
00016 //-----------------------------------------------------------------------------
00017 
00018 #include <vnl/vnl_unary_function.h>
00019 #include <vcl_string.h>
00020 
00021 class FileNameGeneratorBase
00022 {
00023  public:
00024   typedef vnl_unary_function<int,int> Indexer;
00025 
00026   // Constructors/Destructors--------------------------------------------------
00027   FileNameGeneratorBase();
00028   FileNameGeneratorBase(const Indexer& indexer /* = vnl_identity<int>() */ );
00029   FileNameGeneratorBase(const FileNameGeneratorBase&);
00030   FileNameGeneratorBase& operator=(const FileNameGeneratorBase&);
00031 
00032   // Destructor
00033   virtual ~FileNameGeneratorBase() { delete indexer_; }
00034 
00035   // Operations----------------------------------------------------------------
00036   virtual vcl_string dirname()=0;
00037   virtual vcl_string basename()=0;
00038   virtual vcl_string image_extension()=0;
00039 
00040   virtual vcl_string frame_basename(int i1)=0;
00041   virtual vcl_string pair_basename(int i1, int i2)=0;
00042   virtual vcl_string triplet_basename(int i1, int i2, int i3)=0;
00043 
00044   virtual vcl_string basename(const char* subdir)=0;
00045   virtual vcl_string frame_basename(const char* subdir, int i1)=0;
00046   virtual vcl_string pair_basename(const char* subdir, int i1, int i2)=0;
00047   virtual vcl_string triplet_basename(const char* subdir, int i1, int i2, int i3)=0;
00048 
00049   virtual int get_real_index(int index) const;
00050 
00051   virtual FileNameGeneratorBase* copy()=0;
00052   virtual FileNameGeneratorBase* copy(char const* new_basename)=0;
00053 
00054   bool use_subdirs;
00055 
00056  protected:
00057   // Data Members--------------------------------------------------------------
00058   Indexer* indexer_;
00059 };
00060 
00061 #endif // FileNameGeneratorBase_h_