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

Saving archive for character based ostream. More...

#include <TextFileOArchive.h>

Public Member Functions

 TextFileOArchive ()
 Constructor. More...
 
 TextFileOArchive (std::string filename)
 Constructor. More...
 
 TextFileOArchive (std::ofstream &file)
 Constructor. More...
 
virtual ~TextFileOArchive ()
 Destructor. More...
 
std::ofstream & file ()
 Get the underlying ifstream by reference. More...
 
template<typename T >
TextFileOArchiveoperator& (T &data)
 Save one T object to this archive. More...
 
template<typename T >
TextFileOArchiveoperator<< (T &data)
 Save one T object to this archive. More...
 
template<typename T >
void pack (const T &data)
 Save one T object to this archive. More...
 
template<typename T >
void pack (const T *array, int n)
 Save a C-array of T objects to this archive. More...
 
template<typename T >
void pack (const T *array, int m, int n, int np)
 Save a 2D C array to this archive. More...
 

Static Public Member Functions

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

Detailed Description

Saving archive for character based ostream.

Definition at line 30 of file TextFileOArchive.h.

Constructor & Destructor Documentation

◆ TextFileOArchive() [1/3]

Util::TextFileOArchive::TextFileOArchive ( )

Constructor.

Definition at line 16 of file TextFileOArchive.cpp.

◆ TextFileOArchive() [2/3]

Util::TextFileOArchive::TextFileOArchive ( std::string  filename)

Constructor.

Parameters
filenamename of file to open for reading.

Definition at line 25 of file TextFileOArchive.cpp.

◆ TextFileOArchive() [3/3]

Util::TextFileOArchive::TextFileOArchive ( std::ofstream &  file)

Constructor.

Parameters
fileoutput file

Definition at line 35 of file TextFileOArchive.cpp.

References file(), and UTIL_THROW.

◆ ~TextFileOArchive()

Util::TextFileOArchive::~TextFileOArchive ( )
virtual

Destructor.

Definition at line 48 of file TextFileOArchive.cpp.

Member Function Documentation

◆ is_saving()

bool Util::TextFileOArchive::is_saving ( )
inlinestatic

Returns true;.

Definition at line 125 of file TextFileOArchive.h.

◆ is_loading()

bool Util::TextFileOArchive::is_loading ( )
inlinestatic

Returns false;.

Definition at line 128 of file TextFileOArchive.h.

◆ file()

std::ofstream & Util::TextFileOArchive::file ( )

Get the underlying ifstream by reference.

Definition at line 58 of file TextFileOArchive.cpp.

Referenced by TextFileOArchive().

◆ operator&()

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

Save one T object to this archive.

Definition at line 137 of file TextFileOArchive.h.

◆ operator<<()

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

Save one T object to this archive.

Definition at line 147 of file TextFileOArchive.h.

◆ pack() [1/3]

template<typename T >
void Util::TextFileOArchive::pack ( const T &  data)
inline

Save one T object to this archive.

Parameters
dataobject to be written to file

Definition at line 159 of file TextFileOArchive.h.

◆ pack() [2/3]

template<typename T >
void Util::TextFileOArchive::pack ( const T *  array,
int  n 
)
inline

Save a C-array of T objects to this archive.

Parameters
arrayC array of T objects (pointer to first element)
nnumber of elements

Definition at line 178 of file TextFileOArchive.h.

◆ pack() [3/3]

template<typename T >
void Util::TextFileOArchive::pack ( const T *  array,
int  m,
int  n,
int  np 
)
inline

Save a 2D C array to this archive.

Parameters
arrayaddress of first element array[0][0] of 2D array
mlogical number of rows
nlogical number of columns
npphysical number of columns

Definition at line 190 of file TextFileOArchive.h.


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