source: branches/Corsika7500Compatibility/mfileio/MTopFitsGroup.h

Last change on this file was 14935, checked in by tbretz, 12 years ago
Add changes necessary to remove fits completely from namespace std in MARS.
File size: 2.0 KB
Line 
1#ifndef MARS_MTopFitsGroup
2#define MARS_MTopFitsGroup
3
4#include <sys/types.h>
5#include <sys/stat.h>
6
7#ifndef ROOT_TString
8#include <TString.h>
9#endif
10
11#ifndef MARS_fits
12#include "fits.h"
13#endif
14
15#ifndef MARS_ofits
16#include "ofits.h"
17#endif
18
19///////////////////////////////////////////////////////////////////////////////
20// An unique id of files. It is sortable, i. e. can be uses as a key in maps
21class MUniqueFileId
22{
23 dev_t fst_dev; // id of the device of this file
24 ino_t fst_ino; // inode number of the file on the device fst_dev
25
26public:
27 MUniqueFileId(dev_t st_dev, ino_t st_ino)
28 : fst_dev(st_dev), fst_ino(st_ino) {}
29
30 bool operator < (const MUniqueFileId & fileId) const
31 { if (fst_dev == fileId.fst_dev)
32 return fst_ino < fileId.fst_ino;
33 return fst_dev < fileId.fst_dev; }
34
35};
36
37///////////////////////////////////////////////////////////////////////////////
38// All information of one open Top Level FITS group
39class MTopFitsGroup
40{
41 // filename of the group, but expanded by ROOT
42 // ( see gSystem->ExpandPathName() )
43 TString fFileName;
44
45 // the top level group as AstroROOT-2 data structure
46 ofits* fTopGroup;
47
48 // number of usage of this group by different MWriteFitsFile instances
49 Int_t fNumOpen;
50
51public:
52 MTopFitsGroup(const char * fileName, ofits* file) : fFileName(fileName),
53 fTopGroup(file),
54 fNumOpen(1)
55 {}
56
57 void IncreaseUsage() {++fNumOpen;}
58 void DecreaseUsage() {--fNumOpen;}
59 Int_t GetNumUsage() {return fNumOpen;}
60
61 void Attach(ofits* table);
62 Bool_t GetNextChild(ofits* table);
63
64 ofits* GetGroup() {return fTopGroup;}
65 const TString &GetFileName() const {return fFileName;}
66
67};
68
69#endif
70
Note: See TracBrowser for help on using the repository browser.