File: protectedstreambuf.yo

package info (click to toggle)
c%2B%2B-annotations 13.02.02-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,576 kB
  • sloc: cpp: 25,297; makefile: 1,523; ansic: 165; sh: 126; perl: 90; fortran: 27
file content (28 lines) | stat: -rw-r--r-- 1,556 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
The em(protected) members of the class tt(streambuf) are important for
understanding and using tt(streambuf) objects. Although there are both
protected hi(data member)data members and protected member functions
    hi(member function) defined in the tt(class streambuf) using the protected
em(data) members is strongly discouraged as using them violates the principle
of emi(data hiding). As tt(streambuf)'s set of member functions is quite
extensive, it is hardly ever necessary to use its data members directly. The
following subsections do not even list all protected member functions but only
those are covered that are useful for constructing specializations.

tt(Streambuf) objects control a buffer, used for input and/or output, for
which begin-, actual- and end-pointers have been defined, as depicted in
figure ref(SBBUFFERS).
    figure(iostreams/sbbuffers)
    (Input- and output buffer pointers of the class `streambuf')
    (SBBUFFERS)

tt(Streambuf) offers two protected constructors:
    itemization(
    ittq(streambuf::streambuf())
        (Default (protected) constructor of the tt(class streambuf).)
    ittq(streambuf::streambuf(streambuf const &rhs))
        ((Protected) copy constructor of the tt(class streambuf). Note that
this copy constructor merely copies the values of the data members of tt(rhs):
after using the copy constructor both tt(streambuf) objects refer to the same
data buffer and initially their pointers point at identical positions. Also
note that these are em(not) shared pointers, but only `raw copies'.)
    )