DUNE-FEM (unstable)

input stream reading from a file in binary form More...

#include <dune/fem/io/streams/sionlibstreams.hh>

Public Types

typedef StandardInStreamTraits Traits
 type of the traits
 
typedef Traits::InStreamType InStreamType
 type of the implementation (Barton-Nackman)
 
typedef ThisType InStreamInterfaceType
 type of the interface
 

Public Member Functions

 SIONlibInStream (const std::string &filename, const int rank=MPIManager ::rank(), MPICommunicatorType mpiComm=MPIHelper ::getCommunicator())
 constructor More...
 
 ~SIONlibInStream ()
 destructor deleting interal data buffer
 
std::istream & stream ()
 
void readDouble (double &value)
 read a double from the stream More...
 
double readDouble ()
 read a double from the stream More...
 
void readFloat (float &value)
 read a float from the stream More...
 
float readFloat ()
 read a double from the stream More...
 
void readInt (int &value)
 read an int from the stream More...
 
int readInt ()
 read an int from the stream More...
 
void readSignedInt64 (int64_t &value)
 read an int64_t from the stream More...
 
int64_t readSignedInt64 ()
 read an int64_t from the stream More...
 
void readChar (char &value)
 read a char from the stream More...
 
int readChar ()
 read a char from the stream More...
 
void readBool (bool &value)
 read a bool from the stream More...
 
bool readBool ()
 read a bool from the stream More...
 
void readString (std::string &s)
 read a string from the stream More...
 
void readUnsignedInt (unsigned int &value)
 read an unsigned int from the stream More...
 
unsigned int readUnsignedInt ()
 read an unsigned int from the stream More...
 
void readUnsignedInt64 (uint64_t &value)
 read an uint64_t from the stream More...
 
uint64_t readUnsignedInt64 ()
 read an uint64_t from the stream More...
 

Protected Attributes

std::stringstream * data_
 standard file stream
 

Related Functions

(Note that these are not member functions.)

InStreamInterface< StreamTraits > & operator>> (InStreamInterface< StreamTraits > &in, DiscreteFunctionInterface< Impl > &df)
 read a discrete function from an input stream More...
 

Detailed Description

input stream reading from a file in binary form

Note
This stream directly stores the binary representation of the data. The binary representation might differ between different machines (e.g., little endian vs. big endian).
Newly added:

Constructor & Destructor Documentation

◆ SIONlibInStream()

Dune::Fem::SIONlibInStream::SIONlibInStream ( const std::string &  filename,
const int  rank = MPIManager :: rank(),
MPICommunicatorType  mpiComm = MPIHelper :: getCommunicator() 
)
inline

constructor

Parameters
[in]filenamename of a file to read from
[in]rankprocess rank data is read for
[in]mpiCommMPI communicator (defaults to MPIHelper :: getCommunicator() )
Note
The filename must be the same on all ranks.

Member Function Documentation

◆ readBool() [1/2]

bool Dune::Fem::InStreamInterface< StandardInStreamTraits >::readBool ( )
inlineinherited

read a bool from the stream

Returns
a bool read from the stream

◆ readBool() [2/2]

void Dune::Fem::StandardInStream::readBool ( bool &  value)
inlineinherited

read a bool from the stream

Parameters
[out]valuereference to the variable to read from the stream

◆ readChar() [1/2]

int Dune::Fem::InStreamInterface< StandardInStreamTraits >::readChar ( )
inlineinherited

read a char from the stream

Returns
a char read from the stream

◆ readChar() [2/2]

void Dune::Fem::StandardInStream::readChar ( char &  value)
inlineinherited

read a char from the stream

Parameters
[out]valuereference to the variable to read from the stream

◆ readDouble() [1/2]

double Dune::Fem::InStreamInterface< StandardInStreamTraits >::readDouble ( )
inlineinherited

read a double from the stream

Returns
a double read from the stream

◆ readDouble() [2/2]

void Dune::Fem::StandardInStream::readDouble ( double &  value)
inlineinherited

read a double from the stream

Parameters
[out]valuereference to the variable to read from the stream

◆ readFloat() [1/2]

float Dune::Fem::InStreamInterface< StandardInStreamTraits >::readFloat ( )
inlineinherited

read a double from the stream

Returns
a double read from the stream

◆ readFloat() [2/2]

void Dune::Fem::StandardInStream::readFloat ( float &  value)
inlineinherited

read a float from the stream

Parameters
[out]valuereference to the variable to read from the stream

◆ readInt() [1/2]

int Dune::Fem::InStreamInterface< StandardInStreamTraits >::readInt ( )
inlineinherited

read an int from the stream

Returns
an int read from the stream

◆ readInt() [2/2]

void Dune::Fem::StandardInStream::readInt ( int &  value)
inlineinherited

read an int from the stream

Parameters
[out]valuereference to the variable to read from the stream

◆ readSignedInt64() [1/2]

int64_t Dune::Fem::InStreamInterface< StandardInStreamTraits >::readSignedInt64 ( )
inlineinherited

read an int64_t from the stream

Parameters
[out]valuereference to the variable to read from the stream

◆ readSignedInt64() [2/2]

void Dune::Fem::StandardInStream::readSignedInt64 ( int64_t &  value)
inlineinherited

read an int64_t from the stream

Parameters
[out]valuereference to the variable to read from the stream

◆ readString()

void Dune::Fem::StandardInStream::readString ( std::string &  s)
inlineinherited

read a string from the stream

Parameters
[out]sreference to the string to read from the stream

◆ readUnsignedInt() [1/2]

unsigned int Dune::Fem::InStreamInterface< StandardInStreamTraits >::readUnsignedInt ( )
inlineinherited

read an unsigned int from the stream

Returns
an unsigned int read from the stream

◆ readUnsignedInt() [2/2]

void Dune::Fem::StandardInStream::readUnsignedInt ( unsigned int &  value)
inlineinherited

read an unsigned int from the stream

Parameters
[out]valuereference to the variable to read from the stream

◆ readUnsignedInt64() [1/2]

uint64_t Dune::Fem::InStreamInterface< StandardInStreamTraits >::readUnsignedInt64 ( )
inlineinherited

read an uint64_t from the stream

Returns
an uint64_t read from the stream

◆ readUnsignedInt64() [2/2]

void Dune::Fem::StandardInStream::readUnsignedInt64 ( uint64_t &  value)
inlineinherited

read an uint64_t from the stream

Parameters
[out]valuereference to the variable to read from the stream

◆ stream()

std::istream & Dune::Fem::StandardInStream::stream ( )
inlineinherited

return reference to internal istream

Friends And Related Function Documentation

◆ operator>>()

InStreamInterface< StreamTraits > & operator>> ( InStreamInterface< StreamTraits > &  in,
DiscreteFunctionInterface< Impl > &  df 
)
related

read a discrete function from an input stream

Parameters
[in]instream to read from
[out]dfdiscrete function to read
Returns
the input stream (for concatenation)

The documentation for this class was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 21, 23:30, 2024)