At 11:29 PM 2/28/2001 +0000, Wez Furlong wrote:
>On 2001-02-28 20:51:18, Andi Gutmans <[EMAIL PROTECTED]> wrote:
> > Doing some C OOP here would probably come in handy. Short incomplete 
> example:
> > typedef union _io_abstraction {
> >          io_base base;
> >          socket_abstraction socket;
> >          ssl_abstraction ssl;
> >          file_abstraction file;
> > } io_abstraction;
>
>Thats the idea.  However, doing it exactly this way doesn't lend itself to
>having extensions in modules, but that a technicality easily solved by just
>passing pointers to io_base's around, rather than declaring the union.


Yeah you will usually pass around a pointer to io_base so you don't need a 
union. You only need the union if you ever want to save the struct but I 
guess that will usually not be the case.


>The code might still need to check the type of the underlying io, so we
>should probably put an id field into the io base and define bit fields
>to indicate if it can have socket operations performed on it, or if it
>can be fseek'd for example.  Either that or define those operations as
>methods in the io_base.  It feels like we are implementing a VFS layer
>in user space ;-)


Yes, we might have some places which will allow certain io structs and not 
others. In this case we will need to put an ID on each one of them. 
However, the per-struct functions will not need to know the type as they 
will know from the context who they are and cast accordingly.

Andi


> > I wrote this very quickly so I'm not quite sure I got it all right but it
> > could be the general direction. Don't bash me but MS does some nice stuff
> > this way too :)
>
>I believe you - although it is rare to see some "nice" MS code !
>
> > > > I'm going to look into it in more depth and come back with more info
> > > > about where we are using this stuff and where we check for sockets,
> > > > and think some more about the open/connect/construct part of it.
>
>I'm really going to do this now.
>
>--Wez.
>
>
>--
>PHP Development Mailing List <http://www.php.net/>
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to