DUNE-FEM (unstable)

Dune::Fem::InStreamInterface< TraitsImp > Class Template Reference

abstract interface for an input stream More...

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

Public Types

typedef TraitsImp 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

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...
 

Related Functions

(Note that these are not member functions.)

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

Detailed Description

template<class TraitsImp>
class Dune::Fem::InStreamInterface< TraitsImp >

abstract interface for an input stream

An input stream provides methods to read the basic C++ types from the stream. Based on this information, more complicated types can be read from the stream by using these basic input operations.

Normally, the input methods of the stream are not used directly, but the operator >> ist used to read information from the stream. This operator should also be overloaded for all types that should be readable.

Unlike STL streams, dune-fem input streams throw a StreamError exception when a reading operation fails. Since the program is automatically aborted, if the exception is not caught, careless programming will not result in uninitialized objects. If the user catches the exception, he may not assume the object, that should be read, to be in a defined or even useful state.

An interface class:

Member Function Documentation

◆ readBool() [1/2]

template<class TraitsImp >
bool Dune::Fem::InStreamInterface< TraitsImp >::readBool ( )
inline

read a bool from the stream

Returns
a bool read from the stream

Referenced by Dune::Fem::InStreamInterface< TraitsImp >::readBool().

◆ readBool() [2/2]

template<class TraitsImp >
void Dune::Fem::InStreamInterface< TraitsImp >::readBool ( bool &  value)
inline

read a bool from the stream

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

References CHECK_AND_CALL_INTERFACE_IMPLEMENTATION, and Dune::Fem::InStreamInterface< TraitsImp >::readBool().

◆ readChar() [1/2]

template<class TraitsImp >
int Dune::Fem::InStreamInterface< TraitsImp >::readChar ( )
inline

read a char from the stream

Returns
a char read from the stream

Referenced by Dune::Fem::InStreamInterface< TraitsImp >::readChar().

◆ readChar() [2/2]

template<class TraitsImp >
void Dune::Fem::InStreamInterface< TraitsImp >::readChar ( char &  value)
inline

read a char from the stream

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

References CHECK_AND_CALL_INTERFACE_IMPLEMENTATION, and Dune::Fem::InStreamInterface< TraitsImp >::readChar().

◆ readDouble() [1/2]

template<class TraitsImp >
double Dune::Fem::InStreamInterface< TraitsImp >::readDouble ( )
inline

read a double from the stream

Returns
a double read from the stream

Referenced by Dune::Fem::InStreamInterface< TraitsImp >::readDouble().

◆ readDouble() [2/2]

template<class TraitsImp >
void Dune::Fem::InStreamInterface< TraitsImp >::readDouble ( double &  value)
inline

read a double from the stream

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

References CHECK_AND_CALL_INTERFACE_IMPLEMENTATION, and Dune::Fem::InStreamInterface< TraitsImp >::readDouble().

◆ readFloat() [1/2]

template<class TraitsImp >
float Dune::Fem::InStreamInterface< TraitsImp >::readFloat ( )
inline

read a double from the stream

Returns
a double read from the stream

Referenced by Dune::Fem::InStreamInterface< TraitsImp >::readFloat().

◆ readFloat() [2/2]

template<class TraitsImp >
void Dune::Fem::InStreamInterface< TraitsImp >::readFloat ( float &  value)
inline

read a float from the stream

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

References CHECK_AND_CALL_INTERFACE_IMPLEMENTATION, and Dune::Fem::InStreamInterface< TraitsImp >::readFloat().

◆ readInt() [1/2]

template<class TraitsImp >
int Dune::Fem::InStreamInterface< TraitsImp >::readInt ( )
inline

read an int from the stream

Returns
an int read from the stream

Referenced by Dune::Fem::InStreamInterface< TraitsImp >::readInt().

◆ readInt() [2/2]

template<class TraitsImp >
void Dune::Fem::InStreamInterface< TraitsImp >::readInt ( int &  value)
inline

read an int from the stream

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

References CHECK_AND_CALL_INTERFACE_IMPLEMENTATION, and Dune::Fem::InStreamInterface< TraitsImp >::readInt().

◆ readSignedInt64() [1/2]

template<class TraitsImp >
int64_t Dune::Fem::InStreamInterface< TraitsImp >::readSignedInt64 ( )
inline

read an int64_t from the stream

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

Referenced by Dune::Fem::InStreamInterface< TraitsImp >::readSignedInt64().

◆ readSignedInt64() [2/2]

template<class TraitsImp >
void Dune::Fem::InStreamInterface< TraitsImp >::readSignedInt64 ( int64_t &  value)
inline

read an int64_t from the stream

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

References CHECK_AND_CALL_INTERFACE_IMPLEMENTATION, and Dune::Fem::InStreamInterface< TraitsImp >::readSignedInt64().

◆ readString()

template<class TraitsImp >
void Dune::Fem::InStreamInterface< TraitsImp >::readString ( std::string &  s)
inline

read a string from the stream

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

References CHECK_AND_CALL_INTERFACE_IMPLEMENTATION.

◆ readUnsignedInt() [1/2]

template<class TraitsImp >
unsigned int Dune::Fem::InStreamInterface< TraitsImp >::readUnsignedInt ( )
inline

read an unsigned int from the stream

Returns
an unsigned int read from the stream

Referenced by Dune::Fem::InStreamInterface< TraitsImp >::readUnsignedInt().

◆ readUnsignedInt() [2/2]

template<class TraitsImp >
void Dune::Fem::InStreamInterface< TraitsImp >::readUnsignedInt ( unsigned int &  value)
inline

read an unsigned int from the stream

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

References CHECK_AND_CALL_INTERFACE_IMPLEMENTATION, and Dune::Fem::InStreamInterface< TraitsImp >::readUnsignedInt().

◆ readUnsignedInt64() [1/2]

template<class TraitsImp >
uint64_t Dune::Fem::InStreamInterface< TraitsImp >::readUnsignedInt64 ( )
inline

read an uint64_t from the stream

Returns
an uint64_t read from the stream

Referenced by Dune::Fem::InStreamInterface< TraitsImp >::readUnsignedInt64().

◆ readUnsignedInt64() [2/2]

template<class TraitsImp >
void Dune::Fem::InStreamInterface< TraitsImp >::readUnsignedInt64 ( uint64_t &  value)
inline

read an uint64_t from the stream

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

References CHECK_AND_CALL_INTERFACE_IMPLEMENTATION, and Dune::Fem::InStreamInterface< TraitsImp >::readUnsignedInt64().

Friends And Related Function Documentation

◆ operator>>()

template<class StreamTraits , class Impl >
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)

References Dune::Fem::DiscreteFunctionInterface< Impl >::read().


The documentation for this class was generated from the following files:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (May 12, 22:29, 2024)