1 #ifndef TPZCONTBUFFEREDSTREAM_H 2 #define TPZCONTBUFFEREDSTREAM_H 76 virtual void Write(
const int *p,
int howMany=1);
77 virtual void Write(
const unsigned int *p,
int howMany=1);
78 virtual void Write(
const uint64_t *p,
int howMany=1);
79 virtual void Write(
const int64_t *p,
int howMany=1);
80 virtual void Write(
const float *p,
int howMany=1);
81 virtual void Write(
const double *p,
int howMany=1);
82 virtual void Write(
const unsigned char *p,
int howMany=1);
83 virtual void Write(
const char *p,
int howMany=1);
84 virtual void Write(
const std::complex<float> *p,
int howMany=1);
85 virtual void Write(
const std::complex<double> *p,
int howMany=1);
99 virtual void Read(
int *p,
int howMany=1);
100 virtual void Read(
unsigned int *p,
int howMany=1);
101 virtual void Read(uint64_t *p,
int howMany=1);
102 virtual void Read(int64_t *p,
int howMany=1);
103 virtual void Read(
float *p,
int howMany=1);
104 virtual void Read(
double *p,
int howMany=1);
105 virtual void Read(
unsigned char *p,
int howMany=1);
106 virtual void Read(
char *p,
int howMany=1);
107 virtual void Read(std::complex<float> *p,
int howMany=1);
108 virtual void Read(std::complex<double> *p,
int howMany=1);
140 virtual void ConstRead(
char *dest,
const size_t &nBytes)
const;
148 virtual void WriteToBuffer(
const char *source,
const size_t &nBytes);
169 template <
class T>
void ReadData(T *p,
int howMany);
171 template <
class T>
void WriteData(
const T *p,
int howMany);
176 template <
typename T>
178 ReadFromBuffer(reinterpret_cast<char *> (p), howMany *
sizeof (T));
181 template <
typename T>
183 WriteToBuffer(reinterpret_cast<const char *> (p), howMany *
sizeof (T));
228 #endif // TPZCONTBUFFEREDSTREAM_H
TPZContBufferedStream & operator=(const TPZContBufferedStream &other)
Assingment operator.
Class for creating a bidirectional circular buffer.
virtual void Read(int *p, int howMany=1)
virtual void Write(const int *p, int howMany=1)
void WriteData(const T *p, int howMany)
virtual void ConstRead(char *dest, const size_t &nBytes) const
Reads from buffer WITHOUT consuming it. Unless it is still reading from its underlying stream...
void ReadData(T *p, int howMany)
virtual void ReadFromBuffer(char *dest, const size_t &nBytes)
Reads from buffer.
virtual void Write(const bool val)
~TPZContBufferedStream()
Destroys the object.
virtual void ConstReadFromBuffer(char *dest, const size_t &nBytes) const
Reads from buffer WITHOUT consuming it.
void Print()
Prints buffer info and data.
virtual void WriteToBuffer(const char *source, const size_t &nBytes)
Writes to buffer.
TPZContBufferedStream()
Creates a buffer.
Contains declaration of the abstract TPZStream class. TPZStream defines the interface for saving and ...
Defines the interface for saving and reading data. Persistency.
static const size_t MIN_SIZE_INCREMENT
virtual TPZContBufferedStream & operator<<(TPZContBufferedStream &other)
It reads all data in a buffer, consuming it.
void GetDataFromBuffer(char *dest) const
Get all buffer data to a char* in a contiguous manner. May be interesting if one needs to this data t...
virtual void Read(bool &val)