PSCF v1.1
Public Member Functions | Static Public Member Functions | List of all members
Util::TextFileIArchive Class Reference

Loading archive for text istream. More...

#include <TextFileIArchive.h>

Public Member Functions

 TextFileIArchive ()
 Constructor. More...
 
 TextFileIArchive (std::string filename)
 Constructor. More...
 
 TextFileIArchive (std::ifstream &file)
 Constructor. More...
 
virtual ~TextFileIArchive ()
 Destructor. More...
 
std::ifstream & file ()
 Get the underlying ifstream by reference. More...
 
template<typename T >
TextFileIArchiveoperator& (T &data)
 Load one object. More...
 
template<typename T >
TextFileIArchiveoperator>> (T &data)
 Load one object. More...
 
template<typename T >
void unpack (T &data)
 Load a single T object. More...
 
template<typename T >
void unpack (T *array, int n)
 Load a C-array of T objects. More...
 
template<typename T >
void unpack (T *array, int m, int n, int np)
 Load a 2D C array. More...
 

Static Public Member Functions

static bool is_saving ()
 Returns true;. More...
 
static bool is_loading ()
 Returns false;. More...
 

Detailed Description

Loading archive for text istream.

Definition at line 30 of file TextFileIArchive.h.

Constructor & Destructor Documentation

◆ TextFileIArchive() [1/3]

Util::TextFileIArchive::TextFileIArchive ( )

Constructor.

Definition at line 18 of file TextFileIArchive.cpp.

◆ TextFileIArchive() [2/3]

Util::TextFileIArchive::TextFileIArchive ( std::string  filename)

Constructor.

Parameters
filenamename of file to open for reading.

Definition at line 27 of file TextFileIArchive.cpp.

◆ TextFileIArchive() [3/3]

Util::TextFileIArchive::TextFileIArchive ( std::ifstream &  file)

Constructor.

Parameters
fileoutput file

Definition at line 37 of file TextFileIArchive.cpp.

References file(), and UTIL_THROW.

◆ ~TextFileIArchive()

Util::TextFileIArchive::~TextFileIArchive ( )
virtual

Destructor.

Definition at line 51 of file TextFileIArchive.cpp.

Member Function Documentation

◆ is_saving()

bool Util::TextFileIArchive::is_saving ( )
inlinestatic

Returns true;.

Definition at line 125 of file TextFileIArchive.h.

◆ is_loading()

bool Util::TextFileIArchive::is_loading ( )
inlinestatic

Returns false;.

Definition at line 128 of file TextFileIArchive.h.

◆ file()

std::ifstream & Util::TextFileIArchive::file ( )

Get the underlying ifstream by reference.

Definition at line 61 of file TextFileIArchive.cpp.

Referenced by TextFileIArchive().

◆ operator&()

template<typename T >
TextFileIArchive & Util::TextFileIArchive::operator& ( T &  data)
inline

Load one object.

Definition at line 137 of file TextFileIArchive.h.

◆ operator>>()

template<typename T >
TextFileIArchive & Util::TextFileIArchive::operator>> ( T &  data)
inline

Load one object.

Definition at line 147 of file TextFileIArchive.h.

◆ unpack() [1/3]

template<typename T >
void Util::TextFileIArchive::unpack ( T &  data)
inline

Load a single T object.

Parameters
dataobject to be loaded from this archive.

Definition at line 159 of file TextFileIArchive.h.

◆ unpack() [2/3]

template<typename T >
void Util::TextFileIArchive::unpack ( T *  array,
int  n 
)
inline

Load a C-array of T objects.

Parameters
arraypointer to array of T objecs.
nnumber of elements in array

Definition at line 166 of file TextFileIArchive.h.

◆ unpack() [3/3]

template<typename T >
void Util::TextFileIArchive::unpack ( T *  array,
int  m,
int  n,
int  np 
)

Load a 2D C array.

Parameters
arraypointer to first row or element
mlogical number of rows
nlogical number of columns
npphysical number of columns (elements allocated per row)

Definition at line 177 of file TextFileIArchive.h.


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