IsisDlm  Version 0.2
iFile.h
Go to the documentation of this file.
1 
2 //_Title iFile.h Definition of basic file structure
3 //
4 //_Descr ISIS3 file/functionality definition
5 //
6 //_Hist Jul 24 2004 Kris Becker, USGS
7 //_Version: $Id: iFile.h,v 1.4 2004/11/02 15:38:53 kbecker Exp $
8 //_End
10 #if !defined(iFile_h)
11 #define iFile_h
12 #include <string>
13 #include "IdlVarTypes.h"
14 
15 #include "Cube.h"
16 #include "Pvl.h"
17 
18 namespace ISISDLM {
19 
20 class FileRepository;
21 
32 class iFile {
33  public:
34  friend class FileRepository;
35  typedef unsigned long Iid;
36 
37  std::string name() const { return (_filename); }
38  Iid getId() const { return (_iid); }
39  bool readOnly() const { return (_readonly); }
40 
41  Isis::Cube *Cube() const { return (_cube); }
42  Isis::Pvl *Pvl() const;
43 
44  void Flush();
45 
46  protected:
47  iFile();
48  iFile(const std::string &filename, Isis::Cube *cube, bool readonly = true);
49  iFile(const std::string &filename, Isis::Pvl *pvl, bool readonly = true);
50  virtual ~iFile();
51 
52  private:
53  iFile(const iFile &f);
54  iFile operator=(const iFile &f);
56  bool _readonly;
57  Isis::Cube *_cube;
58  Isis::Pvl *_pvl;
59  std::string _filename;
60 
61  static Iid _iid_counter;
62  Iid new_id() { return (++_iid_counter); }
63 };
64 
65 }
66 
67 #endif