Boost logo

Boost :

From: Daryle Walker (darylew_at_[hidden])
Date: 2000-12-26 14:04:37


I haven't looked at the 'scoped_ptr' stuff, but aren't these suggestions
overkill? No other object ('tcpipbuf' is noncopyable) or subclass
('tcpip_data_' is private) is supposed to look at the implementation. The
'tcpipbuf' class could take care of the destruction itself.

on 12/26/00 12:10 PM, Marshall Clow at marshall_at_[hidden] wrote:

> At 7:54 PM -0500 12/25/00, Daryle Walker wrote:
>> A major point of my class was to not use templates at all, so the
>> implementation can be offloaded to a source file. This lets the writer hide
>> the platform-specific stuff there. This means that the user-visible
>> interface can't know anything about the actual (platform-dependent) TCP/IP
>> structures. I represented this by hiding them with a "void*".
>
> Sounds like a perfect place to use the "pImpl" idiom.
>
> class SocketImpl;
>
> class tcpipbuf ...... {
>
> private:
> scoped_ptr<SocketImpl> socketData_;
> };
>
> And then define the SocketImpl in your source file (a different one for each
> implementation)

on 12/25/00 9:16 PM, David Abrahams at abrahams_at_[hidden] wrote:

> I haven't looked at your stuff in detail, but usually the modern type-safe
> way to do this uses a smart pointer to an abstract base class in the header
> file. Would that be a better approach?
>
> ----- Original Message -----
>> A major point of my class was to not use templates at all, so the
>> implementation can be offloaded to a source file. This lets the writer hide
>> the platform-specific stuff there. This means that the user-visible
>> interface can't know anything about the actual (platform-dependent) TCP/IP
>> structures. I represented this by hiding them with a "void*".

-- 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com

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