OpenMD 3.0
Molecular Dynamics in the Open
Loading...
Searching...
No Matches
OpenMD::basic_teebuf< CharT, Traits > Class Template Reference

As a subclass of basic_streambuf, basic_teebuf can operate on multiple stream simultaneously. More...

#include "utils/basic_teebuf.hpp"

+ Inheritance diagram for OpenMD::basic_teebuf< CharT, Traits >:

Public Types

using streambuf_type = std::basic_streambuf<CharT, Traits>
 
using traits_type = Traits
 
using char_type = CharT
 
using int_type = typename traits_type::int_type
 

Public Member Functions

template<typename ForwardIterator >
 basic_teebuf (ForwardIterator begin, ForwardIterator end)
 

Protected Member Functions

int_type overflow (int_type c=traits_type::eof())
 
int sync ()
 

Detailed Description

template<class CharT, class Traits = std::char_traits<CharT>>
class OpenMD::basic_teebuf< CharT, Traits >

As a subclass of basic_streambuf, basic_teebuf can operate on multiple stream simultaneously.

std::ofstream file1("file1");
std::ofstream file2("file22");
std::vector<std::streambuf*> buffers;
buffers.push_back(file1.rdbuf());
buffers.push_back(file2.rdbuf());
teebuf tmp(buffers.begin(), buffers.end());
std::ostream myOs(&tmp);
myOs << "hello world";

Definition at line 69 of file basic_teebuf.hpp.

Member Typedef Documentation

◆ char_type

template<class CharT , class Traits = std::char_traits<CharT>>
using OpenMD::basic_teebuf< CharT, Traits >::char_type = CharT

Definition at line 73 of file basic_teebuf.hpp.

◆ int_type

template<class CharT , class Traits = std::char_traits<CharT>>
using OpenMD::basic_teebuf< CharT, Traits >::int_type = typename traits_type::int_type

Definition at line 74 of file basic_teebuf.hpp.

◆ streambuf_type

template<class CharT , class Traits = std::char_traits<CharT>>
using OpenMD::basic_teebuf< CharT, Traits >::streambuf_type = std::basic_streambuf<CharT, Traits>

Definition at line 71 of file basic_teebuf.hpp.

◆ traits_type

template<class CharT , class Traits = std::char_traits<CharT>>
using OpenMD::basic_teebuf< CharT, Traits >::traits_type = Traits

Definition at line 72 of file basic_teebuf.hpp.

Constructor & Destructor Documentation

◆ basic_teebuf()

template<class CharT , class Traits = std::char_traits<CharT>>
template<typename ForwardIterator >
OpenMD::basic_teebuf< CharT, Traits >::basic_teebuf ( ForwardIterator begin,
ForwardIterator end )
inline

Definition at line 77 of file basic_teebuf.hpp.

Member Function Documentation

◆ overflow()

template<class CharT , class Traits = std::char_traits<CharT>>
int_type OpenMD::basic_teebuf< CharT, Traits >::overflow ( int_type c = traits_type::eof())
inlineprotected

Definition at line 81 of file basic_teebuf.hpp.

◆ sync()

template<class CharT , class Traits = std::char_traits<CharT>>
int OpenMD::basic_teebuf< CharT, Traits >::sync ( )
inlineprotected

Definition at line 96 of file basic_teebuf.hpp.


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