NeoPZ
Public Member Functions | Private Member Functions | Private Attributes | List of all members
TPZFileStream Class Reference

Implements reading from and writing to an ascii file. Persistency. More...

#include <TPZFileStream.h>

Inheritance diagram for TPZFileStream:
[legend]
Collaboration diagram for TPZFileStream:
[legend]

Public Member Functions

 TPZFileStream ()
 
virtual ~TPZFileStream ()
 
void OpenRead (const std::string &fileName)
 
void OpenWrite (const std::string &fileName)
 
virtual bool AmIOpenForRead ()
 
virtual bool AmIOpenForWrite ()
 
void CloseRead ()
 
void CloseWrite ()
 
bool eof ()
 
virtual void Write (const int *p, int howMany)
 
virtual void Write (const unsigned int *p, int howMany)
 
virtual void Write (const uint64_t *p, int howMany)
 
virtual void Write (const int64_t *p, int howMany)
 
virtual void Write (const float *p, int howMany)
 
virtual void Write (const double *p, int howMany)
 
virtual void Write (const unsigned char *p, int howMany)
 
virtual void Write (const char *p, int howMany)
 
virtual void Write (const std::complex< float > *p, int howMany)
 
virtual void Write (const std::complex< double > *p, int howMany)
 
virtual void Read (int *p, int howMany)
 
virtual void Read (unsigned int *p, int howMany)
 
virtual void Read (uint64_t *p, int howMany)
 
virtual void Read (int64_t *p, int howMany)
 
virtual void Read (float *p, int howMany)
 
virtual void Read (double *p, int howMany)
 
virtual void Read (unsigned char *p, int howMany)
 
virtual void Read (char *p, int howMany)
 
virtual void Read (std::complex< float > *p, int howMany)
 
virtual void Read (std::complex< double > *p, int howMany)
 
- Public Member Functions inherited from TPZStream
 TPZStream ()
 
virtual ~TPZStream ()
 
virtual void Write (const bool val)
 
virtual void Write (const long double *p, int howMany=1)
 Writes howMany floating points at pointer location p. More...
 
virtual void Write (const std::string *p, int howMany=1)
 
virtual void Write (const std::complex< long double > *p, int howMany=1)
 Writes howMany complex-long double at pointer location p. More...
 
void Write (const TPZFlopCounter *p, int howMany=1)
 
virtual void Read (bool &val)
 
virtual void Read (long double *p, int howMany=1)
 
virtual void Read (std::string *p, int howMany=1)
 
virtual void Read (std::complex< long double > *p, int howMany=1)
 Reads howMany complex-long double from pointer location p. More...
 
void Read (TPZFlopCounter *p, int howMany=1)
 
template<class T , typename std::enable_if<(std::is_same< std::string, T >::value||is_arithmetic_pz< T >::value), int >::type * = nullptr>
void Write (const TPZVec< T > &vec)
 
template<class T , typename std::enable_if<!(std::is_same< std::string, T >::value||is_arithmetic_pz< T >::value), int >::type * = nullptr>
void Write (const TPZVec< T > &vec)
 
template<class T >
void WritePointers (const TPZVec< TPZAutoPointer< T >> &vec)
 
template<class T , typename std::enable_if<(std::is_same< std::string, T >::value||is_arithmetic_pz< T >::value), int >::type * = nullptr>
void Write (const std::vector< T > &vec)
 
template<class T , typename std::enable_if<!(std::is_same< std::string, T >::value||is_arithmetic_pz< T >::value), int >::type * = nullptr>
void Write (const std::vector< T > &vec)
 
void Write (const TPZVec< TPZFlopCounter > &vec)
 
template<class T , class U >
void Write (const std::map< T, U > &vec)
 
template<class T , typename std::enable_if<(std::is_same< std::string, T >::value||is_arithmetic_pz< T >::value), int >::type * = nullptr>
void Write (const std::set< T > &vec)
 
template<class T >
void Read (TPZVec< T > &vec)
 
template<class T , typename std::enable_if<!(std::is_same< std::string, T >::value||is_arithmetic_pz< T >::value), int >::type * = nullptr>
void Read (TPZVec< T > &vec, void *context)
 
template<class T , typename std::enable_if<(std::is_same< std::string, T >::value||is_arithmetic_pz< T >::value), int >::type * = nullptr>
void Read (TPZVec< T > &vec, void *context)
 
template<class T >
void ReadPointers (TPZVec< TPZAutoPointer< T >> &vec)
 
void Read (TPZVec< TPZFlopCounter > &vec)
 
template<class T , typename std::enable_if<!(std::is_same< std::string, T >::value||is_arithmetic_pz< T >::value), int >::type * = nullptr>
void Read (std::vector< T > &vec, void *context)
 
template<class T , typename std::enable_if<(std::is_same< std::string, T >::value||is_arithmetic_pz< T >::value), int >::type * = nullptr>
void Read (std::vector< T > &vec, void *context)
 
template<int N>
void Read (TPZManVector< REAL, N > &vec)
 
template<int N>
void Read (TPZManVector< int64_t, N > &vec)
 
template<class T , class U >
void Read (std::map< T, U > &vec)
 
template<class T , typename std::enable_if<(std::is_same< std::string, T >::value||is_arithmetic_pz< T >::value), int >::type * = nullptr>
void Read (std::set< T > &vec)
 
template<class T >
void WritePointers (const TPZVec< T *> &vec)
 
template<class T >
void ReadPointers (TPZVec< T *> &vec)
 
template<class T >
void WritePointers (const std::map< int, TPZAutoPointer< T >> &vec)
 
template<class T >
void ReadPointers (std::map< int, TPZAutoPointer< T > > &vec)
 
template<class T >
void WritePointers (const std::map< int, T *> &vec)
 
template<class T >
void ReadPointers (std::map< int, T *> &vec)
 
template<class T >
void WritePointers (const std::set< T *> &vec)
 
template<class T >
void ReadPointers (std::set< T *> &vec)
 
template<class T , int EXP>
void WritePointers (const TPZChunkVector< T *, EXP > &vec)
 
template<class T , int EXP>
void ReadPointers (TPZChunkVector< T *, EXP > &vec)
 
template<class T , int EXP>
void WritePointers (const TPZAdmChunkVector< T *, EXP > &vec)
 
template<class T , int EXP>
void ReadPointers (TPZAdmChunkVector< T *, EXP > &vec)
 
template<class T >
void ReadPointers (std::map< int, TPZAutoPointer< T >> &map)
 

Private Member Functions

template<class T >
void ReadData (T *p, int howMany)
 
template<class T >
void WriteData (const T *p, int howMany)
 

Private Attributes

std::ifstream fIn
 
std::ofstream fOut
 

Detailed Description

Implements reading from and writing to an ascii file. Persistency.

Definition at line 15 of file TPZFileStream.h.

Constructor & Destructor Documentation

◆ TPZFileStream()

TPZFileStream::TPZFileStream ( )

Definition at line 9 of file TPZFileStream.cpp.

◆ ~TPZFileStream()

TPZFileStream::~TPZFileStream ( )
virtual

Definition at line 12 of file TPZFileStream.cpp.

References CloseRead(), and CloseWrite().

Member Function Documentation

◆ AmIOpenForRead()

bool TPZFileStream::AmIOpenForRead ( )
virtual

Implements TPZGeneralFStream.

Definition at line 45 of file TPZFileStream.cpp.

References fIn.

Referenced by OpenRead().

◆ AmIOpenForWrite()

bool TPZFileStream::AmIOpenForWrite ( )
virtual

Implements TPZGeneralFStream.

Definition at line 49 of file TPZFileStream.cpp.

References fOut.

Referenced by OpenWrite().

◆ CloseRead()

void TPZFileStream::CloseRead ( )
virtual

Implements TPZGeneralFStream.

Definition at line 53 of file TPZFileStream.cpp.

References fIn.

Referenced by ~TPZFileStream().

◆ CloseWrite()

void TPZFileStream::CloseWrite ( )
virtual

Implements TPZGeneralFStream.

Definition at line 59 of file TPZFileStream.cpp.

References fOut.

Referenced by ~TPZFileStream().

◆ eof()

bool TPZFileStream::eof ( )
inline

Definition at line 39 of file TPZFileStream.h.

References TPZStream::Write().

◆ OpenRead()

void TPZFileStream::OpenRead ( const std::string &  fileName)
virtual

Implements TPZGeneralFStream.

Definition at line 17 of file TPZFileStream.cpp.

References AmIOpenForRead(), fIn, and PZError.

◆ OpenWrite()

void TPZFileStream::OpenWrite ( const std::string &  fileName)
virtual

◆ Read() [1/10]

virtual void TPZFileStream::Read ( int *  p,
int  howMany 
)
inlinevirtual

Implements TPZStream.

Definition at line 123 of file TPZFileStream.h.

Referenced by Read().

◆ Read() [2/10]

virtual void TPZFileStream::Read ( unsigned int *  p,
int  howMany 
)
inlinevirtual

Implements TPZStream.

Definition at line 127 of file TPZFileStream.h.

◆ Read() [3/10]

virtual void TPZFileStream::Read ( uint64_t *  p,
int  howMany 
)
inlinevirtual

Implements TPZStream.

Definition at line 131 of file TPZFileStream.h.

◆ Read() [4/10]

virtual void TPZFileStream::Read ( int64_t *  p,
int  howMany 
)
inlinevirtual

Implements TPZStream.

Definition at line 135 of file TPZFileStream.h.

◆ Read() [5/10]

virtual void TPZFileStream::Read ( float *  p,
int  howMany 
)
inlinevirtual

Implements TPZStream.

Definition at line 139 of file TPZFileStream.h.

◆ Read() [6/10]

virtual void TPZFileStream::Read ( double *  p,
int  howMany 
)
inlinevirtual

Implements TPZStream.

Definition at line 143 of file TPZFileStream.h.

◆ Read() [7/10]

virtual void TPZFileStream::Read ( unsigned char *  p,
int  howMany 
)
inlinevirtual

Implements TPZStream.

Definition at line 147 of file TPZFileStream.h.

◆ Read() [8/10]

virtual void TPZFileStream::Read ( char *  p,
int  howMany 
)
inlinevirtual

Implements TPZStream.

Definition at line 151 of file TPZFileStream.h.

◆ Read() [9/10]

virtual void TPZFileStream::Read ( std::complex< float > *  p,
int  howMany 
)
inlinevirtual

Implements TPZStream.

Definition at line 155 of file TPZFileStream.h.

◆ Read() [10/10]

virtual void TPZFileStream::Read ( std::complex< double > *  p,
int  howMany 
)
inlinevirtual

Implements TPZStream.

Definition at line 159 of file TPZFileStream.h.

References Read().

◆ ReadData()

template<class T >
void TPZFileStream::ReadData ( T *  p,
int  howMany 
)
private

Definition at line 66 of file TPZFileStream.cpp.

References DebugStop, fIn, and PZError.

◆ Write() [1/10]

virtual void TPZFileStream::Write ( const int *  p,
int  howMany 
)
inlinevirtual

Implements TPZStream.

Definition at line 45 of file TPZFileStream.h.

Referenced by Write().

◆ Write() [2/10]

virtual void TPZFileStream::Write ( const unsigned int *  p,
int  howMany 
)
inlinevirtual

Implements TPZStream.

Definition at line 49 of file TPZFileStream.h.

◆ Write() [3/10]

virtual void TPZFileStream::Write ( const uint64_t *  p,
int  howMany 
)
inlinevirtual

Implements TPZStream.

Definition at line 53 of file TPZFileStream.h.

◆ Write() [4/10]

virtual void TPZFileStream::Write ( const int64_t *  p,
int  howMany 
)
inlinevirtual

Implements TPZStream.

Definition at line 57 of file TPZFileStream.h.

◆ Write() [5/10]

virtual void TPZFileStream::Write ( const float *  p,
int  howMany 
)
inlinevirtual

Implements TPZStream.

Definition at line 61 of file TPZFileStream.h.

◆ Write() [6/10]

virtual void TPZFileStream::Write ( const double *  p,
int  howMany 
)
inlinevirtual

Implements TPZStream.

Definition at line 65 of file TPZFileStream.h.

◆ Write() [7/10]

virtual void TPZFileStream::Write ( const unsigned char *  p,
int  howMany 
)
inlinevirtual

Implements TPZStream.

Definition at line 69 of file TPZFileStream.h.

◆ Write() [8/10]

virtual void TPZFileStream::Write ( const char *  p,
int  howMany 
)
inlinevirtual

Implements TPZStream.

Definition at line 73 of file TPZFileStream.h.

◆ Write() [9/10]

virtual void TPZFileStream::Write ( const std::complex< float > *  p,
int  howMany 
)
inlinevirtual

Implements TPZStream.

Definition at line 77 of file TPZFileStream.h.

◆ Write() [10/10]

virtual void TPZFileStream::Write ( const std::complex< double > *  p,
int  howMany 
)
inlinevirtual

Implements TPZStream.

Definition at line 81 of file TPZFileStream.h.

References TPZStream::Read(), and Write().

◆ WriteData()

template<class T >
void TPZFileStream::WriteData ( const T *  p,
int  howMany 
)
private

Definition at line 87 of file TPZFileStream.cpp.

References DebugStop, fOut, and PZError.

Member Data Documentation

◆ fIn

std::ifstream TPZFileStream::fIn
private

Definition at line 17 of file TPZFileStream.h.

Referenced by AmIOpenForRead(), CloseRead(), OpenRead(), and ReadData().

◆ fOut

std::ofstream TPZFileStream::fOut
private

Definition at line 18 of file TPZFileStream.h.

Referenced by AmIOpenForWrite(), CloseWrite(), OpenWrite(), and WriteData().


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