Boost logo

Boost :

From: Benjamin Collins (ben.collins_at_[hidden])
Date: 2007-10-06 23:53:39


I'm trying to write a device for iostreams, but I'm having a hard time
understanding how the current sources and the models explained in the
documentation are in agreement. Maybe I'm shooting myself in the foot by
never being able to work on this for more than 30 minutes at a time and
having that 30 minutes be late at night, but...

Anyway, it seems odd to me - for example, the
boost::iostreams::mapped_file_source class has the following category of
source_tag + direct_tag + closable_tag, and has member functions open(),
size(), data(), begin(), and end().

None of these are particularly surprising. After all - a mapped_file has to
be open()ed at some point. But under what model as defined in the docs? In
other words, how and when is that function called, and how does a
stream_buffer know he can call open() on a particular device? Also, the
documentation indicates that a source device needs to support the read()
function - but mapped_file_source has no read() (maybe because it is
convertible to 'direct'?).

-- 
Benjamin A. Collins <ben.collins_at_[hidden]>
http://bloggoergosum.us

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