Boost logo

Boost :

From: Christopher Kohlhoff (chris_at_[hidden])
Date: 2006-02-26 07:54:20


Hi Felipe,

--- Felipe Magno de Almeida <felipe.m.almeida_at_[hidden]> wrote:

> I see that there's both Const/Mutable_Buffers Concept, but there isnt
> any Buffer concept in asio.
>
> Why is that?

No need for one :)

Ultimately the data needs to be treated as a contiguous sequence
of bytes. The const_buffer and mutable_buffer classes are the
concrete representations of that.

The step where a dereferenced Const/Mutable_Buffers::iterator is
converted to a const_buffer or mutable_buffer is basically where
the code says to the Const/Mutable_Buffers implementation "a
contiguous sequence of bytes is needed now".

> What if I want to create a more customized buffer/buffers, how
> could I do? It seems to be impossible, since the buffer must
> be inherited or convertible to boost::asio::buffer /
> const_buffer. And there isnt any Buffer concept so that it
> could explain how a buffer could be extensible.

What particular use case did you have in mind? If you have a
specific example perhaps I could illustrate how it could be
implemented.

Cheers,
Chris


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk