Hi Neil,

I've just done a review of your changes and don't feel that it's done
in the most flexible way.  What I usual do in the OSG with callbacks
that add custom behaviors is to allow them override the default
behavior completely, and if the custom callbacks wants it can always
defer to the underlying implementation.

In this context the usual way to tackle this type of functionality
would be to have the osgDB::findDataFile()/findLibraryFile()
implementation move into Registry.cpp, and have
osgDB::findDataFile()/findLibraryFile() simply use the
Registry::findDataFile() to do its job.  The Registry::findDataFile()
would then be an example of the template method design pattern which
it checks for the callback and calls this, or calls the
findDataFileImplemenetation().

As well as having a callback in the Registry I could also seem times
when it would be useful to have the ReaderWriter::Options object
provide a find callback as well.

The alternative to all this is just have a custom
Registry::ReadFileCallback.  I will need to do some more thinking
about the different possibilities on this front, but may well come up
with a general solution or just decide the best thing to do is to use
a ReadFileCallback...

Robert.

On Tue, May 5, 2009 at 10:15 AM,  <[email protected]> wrote:
> Hi Robert,
>
> As promissed, please find attached the amended files to support an 
> application supplied search algorithm for locating files. I think it impacts 
> minimally on exisiting users.
>
> Kind regards
>
> Neil.
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to