SMILE  v2.5
Schwarzschild Modelling Interactive expLoratory Environment
Public Member Functions | Private Member Functions | Private Attributes | List of all members
smile::CFileInputText Class Reference

Class for reading data from a text file, possibly accompanied by binary files for the orbit library. More...

#include <iodata.h>

Public Member Functions

 CFileInputText ()
 create object but don't open file
 
 CFileInputText (const std::string &_baseFileName)
 create object and open the file
 
 ~CFileInputText ()
 close the file(s) if they were opened
 
void open (const std::string &_baseFileName)
 open a new file for reading; if another file was opened then close it beforehand
 
bool ok () const
 status of last file operation
 
COrbitreadOrbit (const CConfigOrbit *configOrbit, const CPotential *potential)
 load a single trajectory from file, create and return a COrbit object. More...
 
COrbitLibraryreadOrbitLibrary (bool withModelData)
 load an orbit library from the text file (possibly with binary data files). More...
 

Private Member Functions

COrbitDescreadOrbitDesc (bool withModelData)
 load orbit description from a single line in the orbit library text file, and possibly also reads binary data for trajectory sample and Schwarzschild model. More...
 

Private Attributes

std::string baseFileName
 name of the text file; if necessary to load binary files, extensions are added to this name
 
bool status
 status of last i/o operation
 
bool isopen
 indicates whether the file is open
 
size_t orbitIndex
 index of current orbit in the orbit library (for keeping track of the position in binary files)
 
std::ifstream strmText
 stream object for the main text file
 
std::vector
< CBasicSchwData::SCHWDATATYPE
schwtypes
 list of Schw.data objects for each orbit in the library
 
std::vector< size_t > schwsizes
 list of lengths of Schw.data objects for each orbit in the library
 
hid_t h5_fileSchwData
 identificator of HDF5 file with Schwarzschild model data arrays (CSchwInformation)
 
hid_t h5_datasetSchwData
 identificator of HDF5 dataset for Schwarzschild data
 
hid_t h5_fileTrajSample
 identificator of HDF5 file with trajectory sample (CTrajSampleInformation)
 
hid_t h5_datasetTrajSample
 identificator of HDF5 dataset with trajectory sample
 

Detailed Description

Class for reading data from a text file, possibly accompanied by binary files for the orbit library.

Member Function Documentation

COrbit * smile::CFileInputText::readOrbit ( const CConfigOrbit configOrbit,
const CPotential potential 
)

load a single trajectory from file, create and return a COrbit object.

File must be open (in the constructor or using open());

Parameters
[in]configOrbit,potentialare passed to the constructor of orbit;
Returns
a new COrbit object on success or NULL on failure.
COrbitDesc * smile::CFileInputText::readOrbitDesc ( bool  withModelData)
private

load orbit description from a single line in the orbit library text file, and possibly also reads binary data for trajectory sample and Schwarzschild model.

COrbitLibrary * smile::CFileInputText::readOrbitLibrary ( bool  withModelData)

load an orbit library from the text file (possibly with binary data files).

Parameters
[in]withModelDataspecifies whether an attempt to open and read additional binary files is made; these are filename.schw and filename.smpl files containing CSchwInformation and CTrajSampleInformation for each orbit, correspondingly.
Returns
a new COrbitLibrary object on success or NULL on failure.

The documentation for this class was generated from the following files: