From 9aab68b140e1b63afcee93638cd5a9386a1b5431 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 28 Sep 2007 13:35:51 +0000 Subject: [PATCH] From Mattias Linde, "I've attached a modified ReaderWriter header which has some additions to osgDB::ReaderWriter::Options to handle PluginData." --- include/osgDB/ReaderWriter | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/osgDB/ReaderWriter b/include/osgDB/ReaderWriter index 9cb194aa3af..8e9a39e1957 100644 --- a/include/osgDB/ReaderWriter +++ b/include/osgDB/ReaderWriter @@ -121,6 +121,21 @@ class OSGDB_EXPORT ReaderWriter : public osg::Object /** Get whether the Registry::ObjectCache should be used by default.*/ CacheHintOptions getObjectCacheHint() const { return _objectCacheHint; } + /** Sets a plugindata value PluginData with a string */ + void setPluginData(const std::string& s, void* v) { _pluginData[s] = v; } + + /** Get a value from the PluginData */ + void* getPluginData(const std::string& s) { return _pluginData[s]; } + + /** Get a value from the PluginData */ + const void* getPluginData(const std::string& s) const + { + PluginDataMap::const_iterator itr = _pluginData.find(s); + return (itr == _pluginData.end()) ? 0 : itr->second; + } + + /** Remove a value from the PluginData */ + void removePluginData(const std::string& s) { _pluginData.erase(s); } protected: @@ -130,6 +145,8 @@ class OSGDB_EXPORT ReaderWriter : public osg::Object FilePathList _databasePaths; CacheHintOptions _objectCacheHint; + typedef std::map PluginDataMap; + PluginDataMap _pluginData; };