Show
Ignore:
Timestamp:
03/10/09 13:21:13 (5 years ago)
Author:
robert
Message:

From Stephan Huber,
"Attached you'll find a proposal for using different
protocols. The idea behind the new code is:

1.) plugins/apps register protocols which they can handle. This is done
via osgDB::Registry::registerProtocol(aProtocolName). Plugins register
supported protocols as usual via ReaderWriter::supportsProtocol(..), the
Registry is updated accordingly.

2.) osgDB::containsServerAddress checks first for an appearance of "://"
in the filename and then checks the protocol against the set of
registered protocols via Registry::isProtocolRegistered(aProtocollName)

3.) the other getServer*-functions changed as well, there's even a
getServerProtocol-function

With these changes filenames/Urls get routed to loaded plugins even with
different protocols than 'http'."

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/include/osgDB/Registry

    r9334 r9884  
    479479        /** Add an Archive extension.*/ 
    480480        void addArchiveExtension(const std::string ext); 
    481  
     481         
     482        /** registers a protocol */ 
     483        void registerProtocol(const std::string& protocol); 
     484         
     485        /** returns true, if named protocol is registered */ 
     486        bool isProtocolRegistered(const std::string& protocol); 
     487         
    482488    protected: 
    483489 
     
    492498        typedef std::map<std::string, ObjectTimeStampPair >             ObjectCache; 
    493499        typedef std::map<std::string, osg::ref_ptr<osgDB::Archive> >    ArchiveCache; 
     500         
     501        typedef std::set<std::string>                                   RegisteredProtocolsSet; 
    494502 
    495503        /** constructor is private, as its a singleton, preventing 
     
    509517         
    510518        bool                                        _createNodeFromImage; 
     519         
     520        RegisteredProtocolsSet                      _registeredProtocols; 
    511521 
    512522        osg::Object*       readObject(DotOsgWrapperMap& dowMap,Input& fr);