$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
From: mfdylan (dylan_at_[hidden])
Date: 2001-12-20 22:17:19
--- In boost_at_y..., "bill_kempf" <williamkempf_at_h...> wrote:
>
> There's no evidence that a binary_stream need to be inefficient.
In
> fact the majority of overhead in iostreams comes from locales and
> formatting facilities, both of which would not exist in a
> binary_stream. I'd be willing to bet that we could develop a
> binary_stream that was as efficient as a lower level abstraction,
and
> there's a lot of power that comes from such a design. For instance
> it becomes quite easy to define inserters and extractors for
> arbitrary types, allows for pluggable converters for native
> representations, XDR representations, etc.
>
That's an interesting idea, mine doesn't allow pluggable convertors.
Maybe a templated convertor would be more sensible?
How useful would a "native representation" be?
> Further, if the binary_stream uses an streambuf to wire the data
then
> you can easily create buffer types for anything that work with both
> binary and formatted I/O. A single socketbuf class would allow you
> to use binary I/O (possibly with an XDR representation) in one
> instance and formatted text I/O (which can be much easier to use
for
> some protocols) in another instance.
>
Aha, that's exactly what mine does, all you need to use on the
streambuf is sputn(), sgetn() and sync().
Dylan