IsisDlm  Version 0.2
iFile.h
Go to the documentation of this file.
00001 
00002 //_Title iFile.h Definition of basic file structure
00003 //
00004 //_Descr ISIS3 file/functionality definition
00005 //
00006 //_Hist Jul 24 2004 Kris Becker, USGS
00007 //_Version: $Id: iFile.h,v 1.4 2004/11/02 15:38:53 kbecker Exp $
00008 //_End
00010 #if !defined(iFile_h)
00011 #define iFile_h
00012 #include <string>
00013 #include "IdlVarTypes.h"
00014 
00015 #include "Cube.h"
00016 #include "Pvl.h"
00017 
00018 namespace ISISDLM {
00019 
00020 class FileRepository;
00021 
00032 class iFile {
00033   public:
00034     friend class FileRepository;
00035     typedef unsigned long Iid;               
00036 
00037     std::string name() const { return (_filename); }
00038     Iid      getId() const { return (_iid); }
00039     bool     readOnly() const { return (_readonly); }
00040 
00041     Isis::Cube *Cube() const { return (_cube); }
00042     Isis::Pvl  *Pvl() const;
00043 
00044     void Flush();
00045 
00046   protected:
00047     iFile();
00048     iFile(const std::string &filename, Isis::Cube *cube,  bool readonly = true);
00049     iFile(const std::string &filename, Isis::Pvl *pvl, bool readonly = true);
00050     virtual ~iFile();
00051 
00052   private:
00053     iFile(const iFile &f);
00054     iFile operator=(const iFile &f);
00055     Iid         _iid;          
00056     bool        _readonly;     
00057     Isis::Cube  *_cube;        
00058     Isis::Pvl   *_pvl;         
00059     std::string _filename;     
00060 
00061     static Iid _iid_counter;  
00062     Iid new_id() { return (++_iid_counter); }
00063 };
00064 
00065 }
00066 
00067 #endif