|
#include <MercuryData.h>
Classes | |
class | IteratorProxy |
Public Member Functions | |
MercuryDataFile (std::string name) | |
operator bool () const | |
Gives the status of the backing std::ifstream Returns true is no error has occurred. In any other case (EOF, FailBit, ErrorBit), it returns false. For more information, see std::ifstream::operator bool(). More... | |
template<std::size_t NDIMS> | |
bool | isMercuryDataFile () |
Checks if this file is a valid Mercury 3D data file. This function jumps to the start of the file, reads the first line and restores the readpointer. It then checks if that line can be succesfully parsed as a time step header. This does however not check if the file is consistent or the particle entries are valid. It can however serve as a first sanity check. More... | |
template<std::size_t NDIMS> | |
IteratorProxy< NDIMS > | as () |
template<std::size_t NDIMS> | |
MercuryTimeStepIterator< NDIMS > | begin () |
Returns a forwarditerator to the time steps Returns a forwarditerator to the time steps, invalidating any other valid iterators in the process (since this is a lazy loader and does not actually load the entire file in memory). End iterators do not get invalidated. This function makes no guarantee for the validity of the file-state. More... | |
template<std::size_t NDIMS> | |
MercuryTimeStepIterator< NDIMS > | end () const |
Returns a forwarditerator one past the last time step. More... | |
Private Attributes | |
std::ifstream | file_ |
Friends | |
template<std::size_t NDIMS> | |
class | MercuryTimeStep |
template<std::size_t NDIMS> | |
class | MercuryTimeStepIterator |
Lazy loader for .data files. This class allows you to iterate over all the particles in it.
|
inline |
Opens the Mercury 3D .data file with filename file.
[in] | name | The filename |
|
inline |
Referenced by transformMercuryToVTK().
|
inline |
Returns a forwarditerator to the time steps Returns a forwarditerator to the time steps, invalidating any other valid iterators in the process (since this is a lazy loader and does not actually load the entire file in memory). End iterators do not get invalidated. This function makes no guarantee for the validity of the file-state.
References file_.
Referenced by MercuryDataFile::IteratorProxy< NDIMS >::begin().
|
inline |
Returns a forwarditerator one past the last time step.
Referenced by MercuryDataFile::IteratorProxy< NDIMS >::end().
|
inline |
Checks if this file is a valid Mercury 3D data file. This function jumps to the start of the file, reads the first line and restores the readpointer. It then checks if that line can be succesfully parsed as a time step header. This does however not check if the file is consistent or the particle entries are valid. It can however serve as a first sanity check.
References file_.
Referenced by main().
|
inline |
Gives the status of the backing std::ifstream Returns true is no error has occurred. In any other case (EOF, FailBit, ErrorBit), it returns false. For more information, see std::ifstream::operator bool().
References file_.
|
friend |
|
friend |
|
private |
The backing file stream used to represent the data file.
Referenced by begin(), isMercuryDataFile(), operator bool(), and MercuryTimeStepIterator< NDIMS >::operator++().