Since isockstream
is publicly derived from istream
, most
of the public functions of istream
are also available in
isockstream
.
isockstream
redefines rdbuf()
defined in its virtual base
class ios
. Since, ios::rdbuf()
is not virtual, care must
be taken to call the correct rdbuf()
through a reference or a
pointer to an object of class isockstream
.
In what follows,
sb
is a sockbuf
object
sbp
is a pointer to a sockbuf
object
isockstream is(sbp)
isockstream
object is
with *sbp
as its
sockbuf
.
sbp = is.rdbuf()
sockbuf
of the isockstream
object
is
.
isockstream::operator -> ()
isockstream
's sockbuf
so that
the user can use isockstream
object as a sockbuf
object.
is->connect (sa); // same as is.rdbuf()->connect (sa);
Since osockstream
is publicly derived from ostream
, most
of the public functions of ostream
are also available in
osockstream
.
osockstream
redefines rdbuf()
defined in its virtual base
class ios
. Since, ios::rdbuf()
is not virtual, care must
be taken to call the correct rdbuf()
through a reference or a
pointer to an object of class osockstream
.
In what follows,
sb
is a sockbuf
object
sbp
is a pointer to a sockbuf
object
osockstream os(sbp)
osockstream
object os
with *sbp
as its
sockbuf
.
sbp = os.rdbuf()
sockbuf
of the osockstream
object
os
.
osockstream::operator -> ()
osockstream
's sockbuf
so that
the user can use osockstream
object as a sockbuf
object.
os->connect (sa); // same as os.rdbuf()->connect (sa);
Since iosockstream
is publicly derived from iostream
, most
of the public functions of iostream
are also available in
iosockstream
.
iosockstream
redefines rdbuf()
defined in its virtual base
class ios
. Since, ios::rdbuf()
is not virtual, care must
be taken to call the correct rdbuf()
through a reference or a
pointer to an object of class iosockstream
.
In what follows,
sb
is a sockbuf
object
sbp
is a pointer to a sockbuf
object
iosockstream io(sbp)
iosockstream
object io
with *sbp
as its
sockbuf
.
sbp = io.rdbuf()
sockbuf
of the iosockstream
object
io
.
iosockstream::operator -> ()
iosockstream
's sockbuf
so that
the user can use iosockstream
object as a sockbuf
object.
io->connect (sa); // same as io.rdbuf()->connect (sa);