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

#include <TPZBFileStream.h>

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

Public Member Functions

 TPZBFileStream ()
 
 ~TPZBFileStream ()
 
void OpenRead (const std::string &fileName)
 
void OpenWrite (const std::string &fileName)
 
virtual bool AmIOpenForRead ()
 
virtual bool AmIOpenForWrite ()
 
void CloseRead ()
 
void CloseWrite ()
 
virtual void Read (int *p, int howMany)
 Reads howMany integers from pointer location p. More...
 
virtual void Read (unsigned int *p, int howMany)
 Reads howMany integers from pointer location p. More...
 
virtual void Read (uint64_t *p, int howMany)
 Reads howMany uint64_t from pointer location p. More...
 
virtual void Read (int64_t *p, int howMany)
 Reads howMany int64_t from pointer location p. More...
 
virtual void Read (float *p, int howMany)
 Reads howMany floating points from pointer location p. More...
 
virtual void Read (double *p, int howMany)
 Reads howMany floating points from pointer location p. More...
 
virtual void Read (unsigned char *p, int howMany)
 Reads howMany unsigned chars from pointer location p. More...
 
virtual void Read (char *p, int howMany)
 Reads howMany chars from pointer location p. More...
 
virtual void Read (std::complex< float > *p, int howMany)
 Reads howMany complex-float from pointer location p. More...
 
virtual void Read (std::complex< double > *p, int howMany)
 Reads howMany complex-double from pointer location p. More...
 
virtual void Write (const int *p, int howMany)
 Writes howMany integers at pointer location p. More...
 
virtual void Write (const unsigned int *p, int howMany)
 Writes howMany integers at pointer location p. More...
 
virtual void Write (const uint64_t *p, int howMany)
 Writes howMany uint64_t at pointer location p. More...
 
virtual void Write (const int64_t *p, int howMany)
 Writes howMany int64_t at pointer location p. More...
 
virtual void Write (const float *p, int howMany)
 Writes howMany floating points at pointer location p. More...
 
virtual void Write (const double *p, int howMany)
 Writes howMany floating points at pointer location p. More...
 
virtual void Write (const unsigned char *p, int howMany)
 Writes howMany unsigned chars at pointer location p. More...
 
virtual void Write (const char *p, int howMany)
 Writes howMany chars at pointer location p. More...
 
virtual void Write (const std::complex< float > *p, int howMany)
 Writes howMany complex-float at pointer location p. More...
 
virtual void Write (const std::complex< double > *p, int howMany)
 Writes howMany complex-double at pointer location p. More...
 
- 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)
 Reads howMany objects of the class T from pointer location p. More...
 
template<class T >
void WriteData (const T *p, int howMany)
 Reads howMany objects of the class T from pointer location p. More...
 

Private Attributes

std::ifstream fIn
 
std::ofstream fOut
 

Detailed Description

Definition at line 13 of file TPZBFileStream.h.

Constructor & Destructor Documentation

◆ TPZBFileStream()

TPZBFileStream::TPZBFileStream ( )

Definition at line 7 of file TPZBFileStream.cpp.

◆ ~TPZBFileStream()

TPZBFileStream::~TPZBFileStream ( )

Definition at line 9 of file TPZBFileStream.cpp.

References CloseRead(), and CloseWrite().

Member Function Documentation

◆ AmIOpenForRead()

bool TPZBFileStream::AmIOpenForRead ( )
virtual

Implements TPZGeneralFStream.

Definition at line 49 of file TPZBFileStream.cpp.

References fIn.

Referenced by OpenRead().

◆ AmIOpenForWrite()

bool TPZBFileStream::AmIOpenForWrite ( )
virtual

Implements TPZGeneralFStream.

Definition at line 53 of file TPZBFileStream.cpp.

References fOut.

Referenced by OpenWrite().

◆ CloseRead()

void TPZBFileStream::CloseRead ( )
virtual

Implements TPZGeneralFStream.

Definition at line 58 of file TPZBFileStream.cpp.

References fIn.

Referenced by ~TPZBFileStream().

◆ CloseWrite()

void TPZBFileStream::CloseWrite ( )
virtual

Implements TPZGeneralFStream.

Definition at line 64 of file TPZBFileStream.cpp.

References fOut.

Referenced by ~TPZBFileStream().

◆ OpenRead()

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

Implements TPZGeneralFStream.

Definition at line 14 of file TPZBFileStream.cpp.

References AmIOpenForRead(), TPZPersistenceManagerNS::binary, DebugStop, fIn, and PZError.

◆ OpenWrite()

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

◆ Read() [1/10]

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

Reads howMany integers from pointer location p.

Implements TPZStream.

Definition at line 34 of file TPZBFileStream.h.

Referenced by Read().

◆ Read() [2/10]

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

Reads howMany integers from pointer location p.

Implements TPZStream.

Definition at line 36 of file TPZBFileStream.h.

◆ Read() [3/10]

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

Reads howMany uint64_t from pointer location p.

Implements TPZStream.

Definition at line 38 of file TPZBFileStream.h.

◆ Read() [4/10]

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

Reads howMany int64_t from pointer location p.

Implements TPZStream.

Definition at line 40 of file TPZBFileStream.h.

◆ Read() [5/10]

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

Reads howMany floating points from pointer location p.

Implements TPZStream.

Definition at line 42 of file TPZBFileStream.h.

◆ Read() [6/10]

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

Reads howMany floating points from pointer location p.

Implements TPZStream.

Definition at line 44 of file TPZBFileStream.h.

◆ Read() [7/10]

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

Reads howMany unsigned chars from pointer location p.

Implements TPZStream.

Definition at line 46 of file TPZBFileStream.h.

◆ Read() [8/10]

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

Reads howMany chars from pointer location p.

Implements TPZStream.

Definition at line 48 of file TPZBFileStream.h.

◆ Read() [9/10]

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

Reads howMany complex-float from pointer location p.

Implements TPZStream.

Definition at line 50 of file TPZBFileStream.h.

◆ Read() [10/10]

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

Reads howMany complex-double from pointer location p.

Implements TPZStream.

Definition at line 52 of file TPZBFileStream.h.

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

◆ ReadData()

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

Reads howMany objects of the class T from pointer location p.

Definition at line 71 of file TPZBFileStream.cpp.

References DebugStop, fIn, and PZError.

Referenced by Write().

◆ Write() [1/10]

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

Writes howMany integers at pointer location p.

Implements TPZStream.

Definition at line 70 of file TPZBFileStream.h.

Referenced by Write().

◆ Write() [2/10]

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

Writes howMany integers at pointer location p.

Implements TPZStream.

Definition at line 72 of file TPZBFileStream.h.

◆ Write() [3/10]

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

Writes howMany uint64_t at pointer location p.

Implements TPZStream.

Definition at line 74 of file TPZBFileStream.h.

◆ Write() [4/10]

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

Writes howMany int64_t at pointer location p.

Implements TPZStream.

Definition at line 76 of file TPZBFileStream.h.

◆ Write() [5/10]

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

Writes howMany floating points at pointer location p.

Implements TPZStream.

Definition at line 78 of file TPZBFileStream.h.

◆ Write() [6/10]

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

Writes howMany floating points at pointer location p.

Implements TPZStream.

Definition at line 80 of file TPZBFileStream.h.

◆ Write() [7/10]

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

Writes howMany unsigned chars at pointer location p.

Implements TPZStream.

Definition at line 82 of file TPZBFileStream.h.

◆ Write() [8/10]

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

Writes howMany chars at pointer location p.

Implements TPZStream.

Definition at line 84 of file TPZBFileStream.h.

◆ Write() [9/10]

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

Writes howMany complex-float at pointer location p.

Implements TPZStream.

Definition at line 86 of file TPZBFileStream.h.

◆ Write() [10/10]

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

Writes howMany complex-double at pointer location p.

Implements TPZStream.

Definition at line 88 of file TPZBFileStream.h.

References ReadData(), Write(), and WriteData().

◆ WriteData()

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

Reads howMany objects of the class T from pointer location p.

Definition at line 82 of file TPZBFileStream.cpp.

References DebugStop, fOut, and PZError.

Referenced by Write().

Member Data Documentation

◆ fIn

std::ifstream TPZBFileStream::fIn
private

Definition at line 15 of file TPZBFileStream.h.

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

◆ fOut

std::ofstream TPZBFileStream::fOut
private

Definition at line 16 of file TPZBFileStream.h.

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


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