GET library
|
#include <GETRunFile.hh>
Public Member Functions | |
Constructors, affectation, destructor | |
GETRunFile (const string &fname="", bool open=true) | |
virtual | ~GETRunFile () |
File operations | |
virtual int | Open (const string &fname) |
virtual int | Open () |
virtual int | Close () |
virtual bool | IsOpen () const |
virtual int | OpenNext () |
virtual bool | AtEnd () const |
File information | |
int | GetFileLun () const |
virtual int | SetFileName (const string &fname) |
const string & | GetFileName () const |
string & | GetFileName () |
FILE * | GetFilePtr () |
virtual void | EventCountIncr () |
int | GetFileEventCount () const |
ROOT related functions | |
ClassDef (GETRunFile, 0) | |
Protected Attributes | |
u_int | file_event_count |
Number of events in the file. | |
string | run_file_name |
Name of the experimental data file. | |
FILE * | run_file_ptr |
Pointer to experimental data file. | |
Private Member Functions | |
GObject (GETRunFile) | |
This is the base class for runs data files. It manages a single file, while derived classes may handle more complicated groups of files.
The run files are only open in read mode.
GETRunFile::GETRunFile | ( | const string & | fname = "" , |
bool | open = true |
||
) |
Constructor.
fname | name of the file |
open | whether the file should be opened when created |
References file_event_count, Open(), run_file_name, and run_file_ptr.
|
inlinevirtual |
Return true if at end of file(s) (see meaning for derived classe). The function also returns true if no file is opened.
Reimplemented in GETRunSerie, and GETRunList.
References IsOpen(), and run_file_ptr.
Referenced by GETRunList::AtEnd(), and GETSystem::ReadEvent().
GETRunFile::ClassDef | ( | GETRunFile | , |
0 | |||
) |
for use within ROOT.
|
virtual |
Close the current run file, if open. The function returns 0 if no error occured
Reimplemented in GETRunSerie, and GETRunList.
References IsOpen(), run_file_name, and run_file_ptr.
Referenced by GETRunList::Close(), GETSystem::CloseRunFile(), GETRunList::OpenNext(), and ~GETRunFile().
|
inlinevirtual |
Increment the event counter.
Reimplemented in GETRunSerie, and GETRunList.
References file_event_count.
Referenced by GETRunList::EventCountIncr().
|
inline |
Return the event counter since last file open.
References file_event_count.
|
inline |
Return the logical number associated to the currently opened file. The function returns -1 if no file is opened.
References run_file_ptr.
Referenced by GETRCoBo::ReadEvent(), and GETSystem::ReadEvent().
|
inline |
Return the effective name of the file.
References run_file_name.
Referenced by GETSystem::GetRunFileName().
|
inline |
Return the effective name of the file.
References run_file_name.
|
inline |
Return the pointer to the C-file object.
References run_file_ptr.
|
private |
Macro from GCpp library that defines the following functions:
|
inlinevirtual |
Return true if the file is currently opened.
Reimplemented in GETRunSerie, and GETRunList.
References run_file_ptr.
Referenced by AtEnd(), GETRunList::Close(), Close(), GETRunList::IsOpen(), GETSystem::IsRunFileOpen(), SetFileName(), and ~GETRunFile().
|
virtual |
Open the file with argument name. If no name is given, then the file with current name is open, if defined. The function returns 0 if no error occured
fname | name of the (disk) file |
References file_event_count, run_file_name, and run_file_ptr.
Referenced by GETSystem::OpenRunFile(), and GETSystem::OpenRunSerie().
|
inlinevirtual |
Open the file which name is already defined in the class object. The function returns 0 if no error occured
Reimplemented in GETRunSerie, and GETRunList.
References run_file_name.
Referenced by GETRunFile(), GETRunList::Open(), and GETRunList::OpenNext().
|
inlinevirtual |
Open the next effective file. For the base class GETRunFile, that processes single files, the function does nothing. It returns -1 when there no next file, or a positive value in case of error.
Reimplemented in GETRunSerie, and GETRunList.
Referenced by GETSystem::ReadEvent().
|
virtual |
Defines the name of the file. The function returns 0 if no error occured. If the file is already opened, an error is returned.
fname | name of the (disk) file |
References IsOpen(), and run_file_name.