<streambuf> <iostream>


typedef basic_streambuf<char> streambuf;
Base buffer class for streams

This template is designed as base virtual class for all stream buffer classes that handle narrow characters (of type char).

It is an instantiation of basic_streambuf with the following template parameters:
template parameterdefinitioncomments
charTcharAliased as member char_type
traitschar_traits<char>Aliased as member traits_type

A stream buffer is an object in charge of performing the reading and writing operations of the stream object it is associated with: the stream delegates all such operations to its associated stream buffer object, which is an intermediary between the stream and its controlled input and output sequences.

All stream objects, no matter whether buffered or unbuffered, have an associated stream buffer: Some stream buffer types may then be set to either use an intermediate buffer or not.

Stream buffer objects keep internally, at least:
  • A locale object, used for locale-dependent operations.
  • A set of internal pointers to keep an input buffer: eback, gptr, egptr.
  • A set of internal pointers to keep an output buffer: pbase, pptr, epptr.

Internally, the streambuf class is an elaborated base class designed to provide a uniform public interface for all derived classes: These public functions call virtual protected members that derived classes may override to implement specific behavior. These overridden virtual functions have access to the internals of the streambuf class by means of a set of protected functions (see below).

Member types

member typedefinition

Public member functions

The common functionality for all stream buffers is provided through the following public member functions:

Buffer management and positioning:
Input functions (get):
Output functions (put):

Protected member functions

The public functions do not perform their operations directly on the controlled input and output sequences, but mostly rely on two arrays accessible by a set of internal pointers:

(beginning pointers)
current position
(get/put pointer)
(end pointers)
Input sequenceebackgptregptr
Output sequencepbasepptrepptr

The following protected member functions provide access to these pointers:

Input sequence (get):
Output sequence (put):

Virtual protected member functions

Each streambuf-derived class shall define members that keep the validity of the pointers above with respect to their own type of controlled sequence; Modifying the values of the pointers, reallocating the sequences themselves and perfoming all necessary synchronizations with the associated character sequence.

With this design, the core functionality involving the process of reading and writing directly to the specific associated character sequence and to manage the controlled sequences is provided by means of virtual functions, which are overriden as necessary by derived classes:


Buffer management and positioning:

Input functions (get):

Output functions (put):
  • <nobr id="pwjBlLZ"><bdo id="pwjBlLZ"></bdo></nobr>
  • <bdo id="pwjBlLZ"><delect id="pwjBlLZ"></delect></bdo>
  • <bdo id="pwjBlLZ"><delect id="pwjBlLZ"></delect></bdo>
  • <dfn id="pwjBlLZ"></dfn>
  • <dfn id="pwjBlLZ"><delect id="pwjBlLZ"></delect></dfn>
  • <bdo id="pwjBlLZ"></bdo>
  • <bdo id="pwjBlLZ"><delect id="pwjBlLZ"></delect></bdo><dfn id="pwjBlLZ"><delect id="pwjBlLZ"><strike id="pwjBlLZ"></strike></delect></dfn><bdo id="pwjBlLZ"></bdo>
  • <bdo id="pwjBlLZ"></bdo><dfn id="pwjBlLZ"></dfn>
  • <dfn id="pwjBlLZ"></dfn>
  • <dfn id="pwjBlLZ"><delect id="pwjBlLZ"></delect></dfn>
  • <bdo id="pwjBlLZ"></bdo>
  • <dfn id="pwjBlLZ"></dfn>
  • <bdo id="pwjBlLZ"><delect id="pwjBlLZ"></delect></bdo>
  • 6478461606 2018-02-24
  • 4985791605 2018-02-24
  • 5637141604 2018-02-24
  • 282181603 2018-02-24
  • 6217941602 2018-02-24
  • 5076141601 2018-02-24
  • 714281600 2018-02-24
  • 6607141599 2018-02-24
  • 949041598 2018-02-24
  • 6809961597 2018-02-24
  • 671871596 2018-02-24
  • 7107821595 2018-02-24
  • 9407391594 2018-02-24
  • 6234261593 2018-02-24
  • 1793521592 2018-02-23
  • 2864591591 2018-02-23
  • 6167231590 2018-02-23
  • 3669201589 2018-02-23
  • 7946381588 2018-02-23
  • 8957701587 2018-02-23