HI Anish,

Just because one plugin isn't able to locate a file doesn't mean other
plugins won't have the ability to find it.  For instance if you have a
file over http then a standard plugin won't find it, but the libcurl
plugin may be able to locate it.

It's a deliberate policy of the Registry to pass on the option for
handling files to all loaded plugins.  The design pattern that this
approach is based on is the Chain Of Responsibility Pattern,

Robert.

On 26 August 2016 at 07:26, Anish Thomas <[email protected]> wrote:
> Hi,
>
> I noticed that when ReaderWriters return a ReadStatus::FILE_NOT_FOUND for a 
> file, the osgDB::Registry keeps checking with other ReaderWriters, then 
> generates library names for that file extension, and tries to load those 
> DLLs/SOs.
>
> The code that does the checking is
>
>     // first attempt to load the file from existing ReaderWriter's
>     AvailableReaderWriterIterator itr(_rwList, _pluginMutex);
>     for(;itr.valid();++itr)
>     {
>         ReaderWriter::ReadResult rr = readFunctor.doRead(*itr);
>         if (readFunctor.isValid(rr)) return rr;
>         else results.push_back(rr);
>     }
>
> in ReaderWriter::ReadResult Registry::read(const ReadFunctor& readFunctor)
>
> Now, since ReaderWriters return FILE_NOT_HANDLED when they aren't meant for 
> that file-type, but can return FILE_NOT_FOUND when the search for the file 
> fails, the other ReaderWriters need not be checked.
>
> Attaching an empty osg::Node object to the result to avoid checking the other 
> ReaderWriters would be inefficient. And the receiving NodePaths would need to 
> write the code to handle these empty osg::Node objects too.
>
> Any other opinions?
>
> Thank you!
>
> Cheers,
> Anish
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=68448#68448
>
>
>
>
>
> _______________________________________________
> 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