Rosetta 3.3
|
A mpiper ostream. More...
#include <mpistream.hh>
Public Types | |
typedef basic_mpi_ostreambase < Elem, Tr, ElemA, ByteT, ByteAT > | mpi_ostreambase_type |
typedef std::basic_ostream < Elem, Tr > | ostream_type |
typedef std::basic_ostream < Elem, Tr > & | ostream_reference |
typedef Elem | char_type |
Public Member Functions | |
basic_mpi_ostream (std::string filename, int master_rank, std::stringstream &header, bool append=false, size_t buffer_size_=default_buffer_size) | |
Constructs a mpiper ostream decorator. | |
void | close () |
~basic_mpi_ostream () | |
template<typename T > | |
basic_mpi_ostream & | operator<< (T const &t) |
stream output | |
basic_mpi_ostream & | put (char const c) |
write char | |
basic_mpi_ostream & | write (char const *str, std::streamsize const count) |
write a string |
A mpiper ostream.
This class is a ostream decorator that behaves 'almost' like any other ostream.
At construction, it takes any ostream that shall be used to output of the compressed data.
When finished, you need to call the special method zflush or call the destructor to flush all the intermidiate streams.
Example:
// creating the target mpi string, could be a fstream ostringstream ostringstream_; // creating the mpi layer mpi_ostream mpiper(ostringstream_); // writing data mpiper<<f<<" "<<d<<" "<<ui<<" "<<ul<<" "<<us<<" "<<c<<" "<<dum; // mpi ostream needs special flushing... mpiper.zflush();
typedef Elem utility::io::mpi_stream::basic_mpi_ostream< Elem, Tr, ElemA, ByteT, ByteAT >::char_type |
typedef basic_mpi_ostreambase< Elem, Tr, ElemA, ByteT, ByteAT > utility::io::mpi_stream::basic_mpi_ostream< Elem, Tr, ElemA, ByteT, ByteAT >::mpi_ostreambase_type |
typedef std::basic_ostream< Elem, Tr >& utility::io::mpi_stream::basic_mpi_ostream< Elem, Tr, ElemA, ByteT, ByteAT >::ostream_reference |
Reimplemented from utility::io::mpi_stream::basic_mpi_ostreambase< Elem, Tr, ElemA, ByteT, ByteAT >.
typedef std::basic_ostream< Elem, Tr > utility::io::mpi_stream::basic_mpi_ostream< Elem, Tr, ElemA, ByteT, ByteAT >::ostream_type |
utility::io::mpi_stream::basic_mpi_ostream< Elem, Tr, ElemA, ByteT, ByteAT >::basic_mpi_ostream | ( | std::string | filename, |
int | master_rank, | ||
std::stringstream & | header, | ||
bool | append = false , |
||
size_t | buffer_size_ = default_buffer_size |
||
) | [inline] |
Constructs a mpiper ostream decorator.
ostream_ | ostream where the compressed output is written |
is_gmpi_ | true if gmpi header and footer have to be added |
level_ | level of compression 0, bad and fast, 9, good and slower, |
strategy_ | compression strategy |
window_size_ | see zlib doc |
memory_level_ | see zlib doc |
buffer_size_ | the buffer size used to mpi data |
References utility::io::mpi_stream::basic_mpi_ostreambase< Elem, Tr, ElemA, ByteT, ByteAT >::file_status(), utility::io::mpi_stream::MPI_FAIL, utility::io::mpi_stream::MPI_SUCCESS_NEW, and utility::io::mpi_stream::basic_mpi_ostreambase< Elem, Tr, ElemA, ByteT, ByteAT >::print_header().
utility::io::mpi_stream::basic_mpi_ostream< Elem, Tr, ElemA, ByteT, ByteAT >::~basic_mpi_ostream | ( | ) | [inline] |
void utility::io::mpi_stream::basic_mpi_ostream< Elem, Tr, ElemA, ByteT, ByteAT >::close | ( | ) | [inline] |
Referenced by utility::io::ozstream::close().
basic_mpi_ostream& utility::io::mpi_stream::basic_mpi_ostream< Elem, Tr, ElemA, ByteT, ByteAT >::operator<< | ( | T const & | t | ) | [inline] |
stream output
if mpi stream has been finalized, will reset
the stream and add header if necessary
References sd::t.
basic_mpi_ostream& utility::io::mpi_stream::basic_mpi_ostream< Elem, Tr, ElemA, ByteT, ByteAT >::put | ( | char const | c | ) | [inline] |
write char
if mpi stream has been finalized, will reset
the stream and add header if necessary
References utility::io::mpi_stream::basic_mpi_ostream< Elem, Tr, ElemA, ByteT, ByteAT >::put().
Referenced by utility::io::ozstream::put(), and utility::io::mpi_stream::basic_mpi_ostream< Elem, Tr, ElemA, ByteT, ByteAT >::put().
basic_mpi_ostream& utility::io::mpi_stream::basic_mpi_ostream< Elem, Tr, ElemA, ByteT, ByteAT >::write | ( | char const * | str, |
std::streamsize const | count | ||
) | [inline] |
write a string
if mpi stream has been finalized, will reset
the stream and add header if necessary
References utility::io::mpi_stream::basic_mpi_ostream< Elem, Tr, ElemA, ByteT, ByteAT >::write().
Referenced by utility::io::ozstream::write(), and utility::io::mpi_stream::basic_mpi_ostream< Elem, Tr, ElemA, ByteT, ByteAT >::write().