CMS 3D CMS Logo

ext::basic_omemstream< Item_t, Traits_t, Allocator_t > Class Template Reference

#include <PhysicsTools/MVAComputer/interface/memstream.h>

List of all members.

Public Types

typedef Traits_t::char_type char_type
typedef Traits_t::int_type int_type
typedef Traits_t traits_type

Public Member Functions

 basic_omemstream (char_type *buf, size_t size)
char_typebegin () const
bool empty () const
char_typeend () const
size_t size () const

Private Member Functions

int_type overflow (int_type c)
int sync ()
std::streamsize xsputn (char_type const *data, std::streamsize size)

Private Attributes

char_typebuffer
char_typecur
char_typelast


Detailed Description

template<typename Item_t, typename Traits_t = std::char_traits<Item_t>, typename Allocator_t = std::allocator<Item_t>>
class ext::basic_omemstream< Item_t, Traits_t, Allocator_t >

Definition at line 24 of file memstream.h.


Member Typedef Documentation

template<typename Item_t, typename Traits_t = std::char_traits<Item_t>, typename Allocator_t = std::allocator<Item_t>>
typedef Traits_t::char_type ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::char_type

Definition at line 27 of file memstream.h.

template<typename Item_t, typename Traits_t = std::char_traits<Item_t>, typename Allocator_t = std::allocator<Item_t>>
typedef Traits_t::int_type ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::int_type

Definition at line 28 of file memstream.h.

template<typename Item_t, typename Traits_t = std::char_traits<Item_t>, typename Allocator_t = std::allocator<Item_t>>
typedef Traits_t ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::traits_type

Definition at line 29 of file memstream.h.


Constructor & Destructor Documentation

template<typename Item_t, typename Traits_t = std::char_traits<Item_t>, typename Allocator_t = std::allocator<Item_t>>
ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::basic_omemstream ( char_type buf,
size_t  size 
) [inline]

Definition at line 31 of file memstream.h.

00031                                                       :
00032                         std::basic_ostream<Item_t, Traits_t>(this),
00033                         buffer(buf), cur(buf), last(buf + size)
00034         { this->exceptions(std::ios_base::badbit); }


Member Function Documentation

template<typename Item_t, typename Traits_t = std::char_traits<Item_t>, typename Allocator_t = std::allocator<Item_t>>
char_type* ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::begin ( void   )  const [inline]

Definition at line 36 of file memstream.h.

References ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::buffer.

00036 { return buffer; }

template<typename Item_t, typename Traits_t = std::char_traits<Item_t>, typename Allocator_t = std::allocator<Item_t>>
bool ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::empty ( void   )  const [inline]

Definition at line 39 of file memstream.h.

References ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::buffer, and ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::cur.

00039 { return cur == buffer; }

template<typename Item_t, typename Traits_t = std::char_traits<Item_t>, typename Allocator_t = std::allocator<Item_t>>
char_type* ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::end ( void   )  const [inline]

Definition at line 37 of file memstream.h.

References ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::cur.

00037 { return cur; }

template<typename Item_t, typename Traits_t = std::char_traits<Item_t>, typename Allocator_t = std::allocator<Item_t>>
int_type ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::overflow ( int_type  c  )  [inline, private]

Definition at line 49 of file memstream.h.

References outputToXml::eof, t, and ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::xsputn().

00050         {
00051                 if (!traits_type::eq_int_type(c, traits_type::eof())) {
00052                         char_type t = traits_type::to_char_type(c);
00053                         if (xsputn(&t, 1) < 1)
00054                                 return traits_type::eof();
00055                 }
00056 
00057                 return c;
00058         }

template<typename Item_t, typename Traits_t = std::char_traits<Item_t>, typename Allocator_t = std::allocator<Item_t>>
size_t ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::size ( void   )  const [inline]

Definition at line 38 of file memstream.h.

References ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::buffer, and ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::cur.

00038 { return cur - buffer; }

template<typename Item_t, typename Traits_t = std::char_traits<Item_t>, typename Allocator_t = std::allocator<Item_t>>
int ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::sync ( void   )  [inline, private]

Definition at line 60 of file memstream.h.

00060 { return 0; }

template<typename Item_t, typename Traits_t = std::char_traits<Item_t>, typename Allocator_t = std::allocator<Item_t>>
std::streamsize ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::xsputn ( char_type const *  data,
std::streamsize  size 
) [inline, private]

Definition at line 42 of file memstream.h.

References edmNew::copy(), ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::cur, ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::last, and n.

Referenced by ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::overflow().

00042                                                                         {
00043                 size_t n = std::min<size_t>(last - cur, size);
00044                 traits_type::copy(cur, data, n);
00045                 cur += n;
00046                 return n;
00047         }


Member Data Documentation

template<typename Item_t, typename Traits_t = std::char_traits<Item_t>, typename Allocator_t = std::allocator<Item_t>>
char_type* ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::buffer [private]

Definition at line 62 of file memstream.h.

Referenced by ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::begin(), ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::empty(), and ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::size().

template<typename Item_t, typename Traits_t = std::char_traits<Item_t>, typename Allocator_t = std::allocator<Item_t>>
char_type * ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::cur [private]

Definition at line 62 of file memstream.h.

Referenced by ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::empty(), ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::end(), ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::size(), and ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::xsputn().

template<typename Item_t, typename Traits_t = std::char_traits<Item_t>, typename Allocator_t = std::allocator<Item_t>>
char_type * ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::last [private]

Definition at line 62 of file memstream.h.

Referenced by ext::basic_omemstream< Item_t, Traits_t, Allocator_t >::xsputn().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:46:54 2009 for CMSSW by  doxygen 1.5.4