From Alan Harris, "Registry and Archive

~~~~~~~~~~~~~~~~~~~~~~~~~
This is a simple change to permit databases other than those named
"*.osga" to be used. It is hardcoded in read() at present.

It is non-critical and does not affect existing program functionality.

Registry and Registry.cpp
~~~~~~~~~~~~~~~~~~~~~~~~~
Added a new typedef:      typedef std::vector< std::string>
ArchiveExtensionList;

a list of extensions:     ArchiveExtensionList  _archiveExtList;

and an "add" method:      addArchiveExtension(const std::string ext)

This is initialised by adding "osga" in Registry() and used in
Registry::read() where the list is searched for the extension used.

Archive.cpp
~~~~~~~~~~~
This submission is a little more tentative. openArchive() is modified to
automatically add the filename extension to the Registry extension list.
"
This commit is contained in:
Robert Osfield
2007-05-09 09:43:18 +00:00
parent 6c74589014
commit 790a1ea66f
3 changed files with 50 additions and 19 deletions

View File

@@ -385,6 +385,8 @@ class OSGDB_EXPORT Registry : public osg::Referenced
/** Get the SharedStateManager. Return 0 if no SharedStateManager has been assigned.*/
SharedStateManager* getSharedStateManager() { return _sharedStateManager.get(); }
/** Add an Archive extension.*/
void addArchiveExtension(const std::string ext);
protected:
@@ -394,6 +396,7 @@ class OSGDB_EXPORT Registry : public osg::Referenced
typedef std::map< std::string, osg::ref_ptr<DotOsgWrapper> > DotOsgWrapperMap;
typedef std::vector< osg::ref_ptr<DynamicLibrary> > DynamicLibraryList;
typedef std::map< std::string, std::string> ExtensionAliasMap;
typedef std::vector< std::string> ArchiveExtensionList;
typedef std::pair<osg::ref_ptr<osg::Object>, double > ObjectTimeStampPair;
typedef std::map<std::string, ObjectTimeStampPair > ObjectCache;
@@ -489,7 +492,8 @@ class OSGDB_EXPORT Registry : public osg::Referenced
ArchiveCache _archiveCache;
OpenThreads::Mutex _archiveCacheMutex;
ArchiveExtensionList _archiveExtList;
osg::ref_ptr<DatabasePager> _databasePager;
osg::ref_ptr<SharedStateManager> _sharedStateManager;