|
Boost : |
From: Rene Rivera (grafik.list_at_[hidden])
Date: 2005-12-27 16:13:36
Andrew Schweitzer wrote:
>>Andrew Schweitzer wrote:
>>
>>>5) demuxer_service creates a platform-implementation demuxer_service
>>>(right?)
>>
> Rene Rivera wrote:
>
>>Not as far as I know. This is one of the points that some people have
>>contention with. The real relation between demuxer_service and the
>>implementation is closer to a PIMPL idiom, but without the pointer. In
>>other words it's equivalent to:
>>
>> demuxer_service *is-a*
>> detail::win_iocp_demuxer_service
>
> [snip]
>
> I think I'm confused. As far as I can tell, there's no inheritance
> relationship between demuxer_service and win_iocp_demuxer_service, but
> as you said, it's a PIMPL relation, or perhaps an RIMPL relation since
> it's a reference not a pointer.
We can consider the reference as just a different kind of pointer in
this case. After all it could just as easily be a pointer and the
forwarding functions would deref the pointer, instead of the compiler
doing the deref for you.
> Is PIMPL considered is-a or has-a?
I've always considered it an is-a. A very special case, but equivalent.
> I think the library design or naming might be a bit confused on this
> point (or quite possibly it's me).
The fact that it's confusing, even when looking at the code, is a point
against the design ;-) OK, I'm rereading the code, instead of relying on
memory...
> As far as I can tell two things are true:
> 1) the demuxer ends up with two actual services in its list after it
> is constructed:
> a) demuxer_service
> b) win_iocp_demuxer_service (or the selected
> platform-implemenation of demuxer_service)
OK, AFAICT it only ends up with (b) in the service_registry.
> 2) the demuxer also has a PIMPL relation with demuxer_service,
> and demuxer_service has a PIMPL relation with
> win_iocp_demuxer_service
Yes. I guess the key point here is that there's only 1 (singleton) of
win_iocp_demuxer_service for all demuxer_service instances in the same
basic_demuxer instance? (again AFAICT)
> Are you reading the code differently? I might have gotten lost.
I guess, I'm reading it differently :-)
-- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com -- 102708583/icq - grafikrobot/aim - Grafik/jabber.org
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk