Boost logo

Boost :

From: Steven E. Harris (seharris_at_[hidden])
Date: 2002-07-26 16:26:23


Jeremy Siek <jsiek_at_[hidden]> writes:

> I should have been more specific. Can you create std stream from
> their pipes in a single line of code? :)

Sorry, I realized that was your question after posting my last
reply. The answer is no, you can't. For now, ACE doesn't strive to
adopt Standard Library conventions. They have a lot of facilities that
predate and continue to grow in parallel with the Standard
Library. That is, instead of incorporating std::streambuf-derived
types, they'll write their own totally unrelated buffer type that does
the almost same thing. Like many frameworks, they try to stay
internally consistent. The layering lets the user get in at almost any
level and build up from there, chopping off the stuff built above that
he doesn't care for.

Fortunately, creating a streambuf based on an interface like
read()/write() is pretty easy. Of course, you'd have to decide how to
handle blocking when, say, filling your buffer.

> Yep, just want to do simple stream IO between processes.

Providing a streambuf makes for simple client code, but can hide
important details. Should you incorporate timeouts on reading or
writing? If so, does a timeout present EOF? Can EOF be cleared? Maybe
files have the same problems.

-- 
Steven E. Harris        :: seharris_at_[hidden]
Raytheon                :: http://www.raytheon.com

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