1 #ifndef PhysicsTools_MVAComputer_memstream_h
2 #define PhysicsTools_MVAComputer_memstream_h
21 template <
typename Item_t,
typename Traits_t = std::
char_traits<Item_t>,
typename Allocator_t = std::allocator<Item_t> >
22 class basic_omemstream :
private std::basic_streambuf<Item_t, Traits_t>,
public std::basic_ostream<Item_t, Traits_t> {
30 this->exceptions(std::ios_base::badbit);
47 if (!traits_type::eq_int_type(
c, traits_type::eof())) {
50 return traits_type::eof();
56 int sync()
override {
return 0; }
61 template <
typename Item_t,
typename Traits_t = std::
char_traits<Item_t>,
typename Allocator_t = std::allocator<Item_t> >
62 class basic_imemstream :
private std::basic_streambuf<Item_t, Traits_t>,
public std::basic_istream<Item_t, Traits_t> {
69 this->exceptions(std::ios_base::badbit);
70 this->setg(const_cast<char_type *>(
buf), const_cast<char_type *>(
buf), const_cast<char_type *>(
buf +
size));
75 if (this->gptr() && this->gptr() < this->egptr())
76 return traits_type::to_int_type(*this->gptr());
78 return traits_type::eof();
89 #endif // PhysicsTools_MVAComputer_memstream_h