ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> cpp-sig
cpp-sig
Re: [C++-sig] Re: Adding __len__ to range objects
by Joel de Guzman other posts by this author
Aug 25 2003 1:26PM messages near this date
[C++-sig] Re: arg type equivivalence (constness) | Re: [C++-sig] Re: Adding __len__ to range objects
Raoul Gough <RaoulGough@[...].uk>  wrote:
>  "Joel de Guzman" <djowel@[...].uk> writes:

>  Well, my concern is to do with the complexity of the support - it
>  seems to require hooks throughout all of the code that modifies the
>  container. Maybe it would be possible to create a "container proxy"
>  that emulates the vector interface, and use:
>  
>  indexing_suite <container_proxy <std::vector<MyType> > >
>  
>  Thus encapsulating the proxy code. I think this would localize the
>  code much better, if it is possible to do.

A possibility, yes, nice idea.

>  Another concern about this - have you considered cases where C++ code
>  accesses the raw container (i.e. without going via the indexing
>  suite)? e.g.
>  
>      val = c[i]
>      cxx_function(c)
>      val == c[i]  # ??
>  
>  where cxx_function might (from C++) insert something into the
>  container. If I understand correctly, doing an insertion via the
>  indexing suite would notify the proxy when it needs to update its
>  index. I think that means that raw C++ code that modifies the
>  container would cause problems.

Yes, I am aware of that. That's a caveat. Before, the indexing_suite 
goes public, I have to provide a notification function that one needs 
to call in such cases. Right now, I am not sure about its interface.

>  So what do you think of the idea of providing a proxy-container-
>  wrapper, instead of integrating the proxy support directly into the
>  indexing suite? C++ code would then be aware (and have direct access
>  to) the wrapped container, and it might significantly simplify the
>  internals of the indexing suite.

Looks like a good idea. Feel free to try it out. I'm all for further refactoring.

Cheers,
-- 
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net


_______________________________________________
C++-sig mailing list
C++-sig@[...].org
http://mail.python.org/mailman/listinfo/c++-sig
Thread:
Raoul Gough
Raoul Gough
Raoul Gough
David Abrahams
Joel de Guzman
David Abrahams
Joel de Guzman
Raoul Gough
Joel de Guzman
Joel de Guzman
Joel de Guzman
Joel de Guzman
Joel de Guzman
Joel de Guzman
Raoul Gough
Raoul Gough
Raoul Gough
Raoul Gough
Raoul Gough
Raoul Gough
David Abrahams
David Abrahams
David Abrahams
Raoul Gough
Raoul Gough
Raoul Gough
Joel de Guzman
Raoul Gough
Joel de Guzman
Raoul Gough
Raoul Gough
Raoul Gough
Raoul Gough
David Abrahams
David Abrahams
David Abrahams
Raoul Gough
Raoul Gough
Raoul Gough
David Abrahams
David Abrahams
David Abrahams

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved