DUNE-FEM (unstable)

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

abstract interface for an output stream More...

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

Public Types

typedef TraitsImp Traits
 type of the traits
 
typedef Traits::OutStreamType OutStreamType
 type of the implementation (Barton-Nackman)
 
typedef ThisType OutStreamInterfaceType
 type of the interface
 

Public Member Functions

void flush ()
 flush the stream More...
 
void writeDouble (const double value)
 write a double to the stream More...
 
void writeFloat (const float value)
 write a float to the stream More...
 
void writeInt (const int value)
 write an int to the stream More...
 
void writeSignedInt64 (int64_t value)
 write an int64_t to the stream More...
 
void writeChar (const char value)
 write a char to the stream More...
 
void writeBool (const bool value)
 write a bool to the stream More...
 
void writeString (const std::string &s)
 write a string to the stream More...
 
void writeUnsignedInt (unsigned int value)
 write an unsigned int to the stream More...
 
void writeUnsignedInt64 (uint64_t value)
 write an uint64_t to the stream More...
 

Related Functions

(Note that these are not member functions.)

template<class StreamTraits , class Impl >
OutStreamInterface< StreamTraits > & operator<< (OutStreamInterface< StreamTraits > &out, const DiscreteFunctionInterface< Impl > &df)
 write a discrete function into an output stream More...
 

Detailed Description

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

abstract interface for an output stream

An output stream provides methods to write the basic C++ types into the stream. Based on this information, more complicated types can be written to the stream by using these basic output operations.

Normally, the output methods of the stream are not used directly, but the operator << ist used to write information into the stream. This operator should also be overloaded for all types that should be writeable.

Unlike STL streams, dune-fem output streams throw a StreamError exception when a writing operation fails. Since the program is automatically aborted, if the exception is not caught, careless programming will not result in corrupted data files.

An interface class:

Member Function Documentation

◆ flush()

template<class TraitsImp >
void Dune::Fem::OutStreamInterface< TraitsImp >::flush ( )
inline

flush the stream

By calling the flush method, the user can ensure that the stream is actually transferred (e.g., written to disk)

References CHECK_AND_CALL_INTERFACE_IMPLEMENTATION, and Dune::Fem::OutStreamInterface< TraitsImp >::flush().

Referenced by Dune::Fem::OutStreamInterface< TraitsImp >::flush().

◆ writeBool()

template<class TraitsImp >
void Dune::Fem::OutStreamInterface< TraitsImp >::writeBool ( const bool  value)
inline

write a bool to the stream

Parameters
[in]valuevalue to write to the stream

References CHECK_AND_CALL_INTERFACE_IMPLEMENTATION, and Dune::Fem::OutStreamInterface< TraitsImp >::writeBool().

Referenced by Dune::Fem::OutStreamInterface< TraitsImp >::writeBool().

◆ writeChar()

template<class TraitsImp >
void Dune::Fem::OutStreamInterface< TraitsImp >::writeChar ( const char  value)
inline

write a char to the stream

Parameters
[in]valuevalue to write to the stream

References CHECK_AND_CALL_INTERFACE_IMPLEMENTATION, and Dune::Fem::OutStreamInterface< TraitsImp >::writeChar().

Referenced by Dune::Fem::OutStreamInterface< TraitsImp >::writeChar().

◆ writeDouble()

template<class TraitsImp >
void Dune::Fem::OutStreamInterface< TraitsImp >::writeDouble ( const double  value)
inline

write a double to the stream

Parameters
[in]valuevalue to write to the stream

References CHECK_AND_CALL_INTERFACE_IMPLEMENTATION, and Dune::Fem::OutStreamInterface< TraitsImp >::writeDouble().

Referenced by Dune::Fem::OutStreamInterface< TraitsImp >::writeDouble().

◆ writeFloat()

template<class TraitsImp >
void Dune::Fem::OutStreamInterface< TraitsImp >::writeFloat ( const float  value)
inline

write a float to the stream

Parameters
[in]valuevalue to write to the stream

References CHECK_AND_CALL_INTERFACE_IMPLEMENTATION, and Dune::Fem::OutStreamInterface< TraitsImp >::writeFloat().

Referenced by Dune::Fem::OutStreamInterface< TraitsImp >::writeFloat().

◆ writeInt()

template<class TraitsImp >
void Dune::Fem::OutStreamInterface< TraitsImp >::writeInt ( const int  value)
inline

write an int to the stream

Parameters
[in]valuevalue to write to the stream

References CHECK_AND_CALL_INTERFACE_IMPLEMENTATION, and Dune::Fem::OutStreamInterface< TraitsImp >::writeInt().

Referenced by Dune::Fem::OutStreamInterface< TraitsImp >::writeInt().

◆ writeSignedInt64()

template<class TraitsImp >
void Dune::Fem::OutStreamInterface< TraitsImp >::writeSignedInt64 ( int64_t  value)
inline

write an int64_t to the stream

Parameters
[in]valuevalue to write to the stream

References CHECK_AND_CALL_INTERFACE_IMPLEMENTATION, and Dune::Fem::OutStreamInterface< TraitsImp >::writeSignedInt64().

Referenced by Dune::Fem::OutStreamInterface< TraitsImp >::writeSignedInt64().

◆ writeString()

template<class TraitsImp >
void Dune::Fem::OutStreamInterface< TraitsImp >::writeString ( const std::string &  s)
inline

write a string to the stream

Parameters
[in]sstring to write to the stream

References CHECK_AND_CALL_INTERFACE_IMPLEMENTATION, and Dune::Fem::OutStreamInterface< TraitsImp >::writeString().

Referenced by Dune::Fem::OutStreamInterface< TraitsImp >::writeString().

◆ writeUnsignedInt()

template<class TraitsImp >
void Dune::Fem::OutStreamInterface< TraitsImp >::writeUnsignedInt ( unsigned int  value)
inline

write an unsigned int to the stream

Parameters
[in]valuevalue to write to the stream

References CHECK_AND_CALL_INTERFACE_IMPLEMENTATION, and Dune::Fem::OutStreamInterface< TraitsImp >::writeUnsignedInt().

Referenced by Dune::Fem::OutStreamInterface< TraitsImp >::writeUnsignedInt().

◆ writeUnsignedInt64()

template<class TraitsImp >
void Dune::Fem::OutStreamInterface< TraitsImp >::writeUnsignedInt64 ( uint64_t  value)
inline

write an uint64_t to the stream

Parameters
[in]valuevalue to write to the stream

References CHECK_AND_CALL_INTERFACE_IMPLEMENTATION, and Dune::Fem::OutStreamInterface< TraitsImp >::writeUnsignedInt64().

Referenced by Dune::Fem::OutStreamInterface< TraitsImp >::writeUnsignedInt64().

Friends And Related Function Documentation

◆ operator<<()

template<class StreamTraits , class Impl >
OutStreamInterface< StreamTraits > & operator<< ( OutStreamInterface< StreamTraits > &  out,
const DiscreteFunctionInterface< Impl > &  df 
)
related

write a discrete function into an output stream

Parameters
[in]outstream to write to
[in]dfdiscrete function to write
Returns
the output stream (for concatenation)

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.111.3 (Nov 20, 23:30, 2024)