PSCF v1.2
Util::XdrFileIArchive Class Reference

Loading / input archive for binary XDR file. More...

#include <XdrFileIArchive.h>

Public Member Functions

 XdrFileIArchive ()
 Constructor.
 
 XdrFileIArchive (std::string filename)
 Constructor.
 
 XdrFileIArchive (std::ofstream &file)
 Constructor.
 
virtual ~XdrFileIArchive ()
 Destructor.
 
void init (FILE *file)
 Initialize by associating with an open file.
 
template<typename T >
XdrFileIArchiveoperator& (T &data)
 Load one object.
 
template<typename T >
XdrFileIArchiveoperator>> (T &data)
 Load one object.
 
FILE * file ()
 Get the underlying file handle.
 
XDR * xdrPtr ()
 Get a pointer to the enclosed XDR object.
 

Static Public Member Functions

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

Detailed Description

Loading / input archive for binary XDR file.

XDR is a standard protocol for writing and reading binary in a portable format. This archive saves data to an associated file in XDR format. It depends on the unix xdr library <rpc/xdr.h>. Because this library is written in C (not C++), this archive uses a standard C library file handle, not a C++ iostream.

Definition at line 39 of file XdrFileIArchive.h.

Constructor & Destructor Documentation

◆ XdrFileIArchive() [1/3]

Util::XdrFileIArchive::XdrFileIArchive ( )

Constructor.

Definition at line 17 of file XdrFileIArchive.cpp.

◆ XdrFileIArchive() [2/3]

Util::XdrFileIArchive::XdrFileIArchive ( std::string filename)

Constructor.

Parameters
filenamename of file to open for reading.

Definition at line 27 of file XdrFileIArchive.cpp.

References UTIL_THROW.

◆ XdrFileIArchive() [3/3]

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

Constructor.

Parameters
fileoutput file

◆ ~XdrFileIArchive()

Util::XdrFileIArchive::~XdrFileIArchive ( )
virtual

Destructor.

Definition at line 45 of file XdrFileIArchive.cpp.

Member Function Documentation

◆ is_saving()

bool Util::XdrFileIArchive::is_saving ( )
inlinestatic

Returns false.

Definition at line 121 of file XdrFileIArchive.h.

◆ is_loading()

bool Util::XdrFileIArchive::is_loading ( )
inlinestatic

Returns true.

Definition at line 124 of file XdrFileIArchive.h.

◆ init()

void Util::XdrFileIArchive::init ( FILE * file)

Initialize by associating with an open file.

Parameters
fileC library file handle, must be open for reading.

Definition at line 51 of file XdrFileIArchive.cpp.

References file().

◆ operator&()

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

Load one object.

Definition at line 133 of file XdrFileIArchive.h.

◆ operator>>()

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

Load one object.

Definition at line 143 of file XdrFileIArchive.h.

◆ file()

FILE * Util::XdrFileIArchive::file ( )
inline

Get the underlying file handle.

Definition at line 152 of file XdrFileIArchive.h.

Referenced by init().

◆ xdrPtr()

XDR * Util::XdrFileIArchive::xdrPtr ( )
inline

Get a pointer to the enclosed XDR object.

Definition at line 158 of file XdrFileIArchive.h.


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