dune-fem 2.8.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Related Functions | List of all members
Dune::Fem::InStreamInterface< TraitsImp > Class Template Reference

abstract interface for an input stream More...

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

Inheritance diagram for Dune::Fem::InStreamInterface< TraitsImp >:
Inheritance graph

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
 
double readDouble ()
 read a double from the stream
 
void readFloat (float &value)
 read a float from the stream
 
float readFloat ()
 read a double from the stream
 
void readInt (int &value)
 read an int from the stream
 
int readInt ()
 read an int from the stream
 
void readChar (char &value)
 read a char from the stream
 
int readChar ()
 read a char from the stream
 
void readBool (bool &value)
 read a bool from the stream
 
bool readBool ()
 read a bool from the stream
 
void readString (std::string &s)
 read a string from the stream
 
void readUnsignedInt (unsigned int &value)
 read an unsigned int from the stream
 
unsigned int readUnsignedInt ()
 read an unsigned int from the stream
 
void readUnsignedInt64 (uint64_t &value)
 read an uint64_t from the stream
 
uint64_t readUnsignedInt64 ()
 read an uint64_t from the stream
 

Protected Member Functions

void readError () const
 
const Implementation & asImp () const
 
Implementation & asImp ()
 

Static Protected Member Functions

static const Implementation & asImp (const ThisType &other)
 
static Implementation & asImp (ThisType &other)
 
static const TraitsImp::InStreamType & asImp (const ThisType &other)
 
static TraitsImp::InStreamType & asImp (ThisType &other)
 

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
 

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 Typedef Documentation

◆ InStreamInterfaceType

template<class TraitsImp >
typedef ThisType Dune::Fem::InStreamInterface< TraitsImp >::InStreamInterfaceType

type of the interface

◆ InStreamType

template<class TraitsImp >
typedef Traits::InStreamType Dune::Fem::InStreamInterface< TraitsImp >::InStreamType

type of the implementation (Barton-Nackman)

◆ Traits

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

type of the traits

Member Function Documentation

◆ asImp() [1/6]

template<class TraitsImp >
Implementation & Dune::Fem::BartonNackmanInterface< Interface, Implementation >::asImp ( )
inlineprotected

◆ asImp() [2/6]

template<class TraitsImp >
const Implementation & Dune::Fem::BartonNackmanInterface< Interface, Implementation >::asImp ( ) const
inlineprotected

◆ asImp() [3/6]

template<class TraitsImp >
static const Implementation & Dune::Fem::BartonNackmanInterface< Interface, Implementation >::asImp ( const ThisType other)
inlinestaticprotected

◆ asImp() [4/6]

static const TraitsImp::InStreamType & Dune::Fem::BartonNackmanInterface< InStreamInterface< TraitsImp > , TraitsImp::InStreamType >::asImp ( const ThisType other)
inlinestaticprotectedinherited

◆ asImp() [5/6]

template<class TraitsImp >
static Implementation & Dune::Fem::BartonNackmanInterface< Interface, Implementation >::asImp ( ThisType other)
inlinestaticprotected

◆ asImp() [6/6]

static TraitsImp::InStreamType & Dune::Fem::BartonNackmanInterface< InStreamInterface< TraitsImp > , TraitsImp::InStreamType >::asImp ( ThisType other)
inlinestaticprotectedinherited

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

◆ readError()

template<class TraitsImp >
void Dune::Fem::InStreamInterface< TraitsImp >::readError ( ) const
inlineprotected

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

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)

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