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

helper class that writes NEMO-compatible snapshot file More...

Public Member Functions

 CNemoSnapshotWriter (const std::string &filename, bool append=false)
 create class instance and open file (append if necessary)
 
 ~CNemoSnapshotWriter ()
 close file
 
template<typename T >
char typeLetter ()
 return a letter corresponding to the given type
 
template<typename T >
void putVal (const std::string &name, T val)
 store a named quantity
 
template<typename T >
void putArray (const std::string &name, int ndim, const int dim[], const T *data)
 write array of T; ndim - number of dimensions, dim - length of array for each dimension
 
void startLevel (const std::string &name)
 begin a new nested array
 
void endLevel ()
 end a nested array
 
void putString (const std::string &name, const std::string &str)
 store an array of char
 
void putZString (const std::string &name)
 store a string enclosed by zeros
 
void writeHistory (const std::string &new_h)
 store history line in header
 
template<typename NumT >
void writePhase (const CPointMassSet< NumT > *points, double time)
 write phase space (positions and velocities)
 
bool ok () const
 check if any i/o errors occured
 
template<>
char typeLetter ()
 
template<>
char typeLetter ()
 
template<>
char typeLetter ()
 
template<>
char typeLetter ()
 

Private Attributes

std::ofstream snap
 data stream
 
int level
 index of current level (root level is 0)
 

Detailed Description

helper class that writes NEMO-compatible snapshot file


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