Skip to content

Commit

Permalink
From Mattias Linde, "I've attached a modified ReaderWriter header whi…
Browse files Browse the repository at this point in the history
…ch has some additions

to osgDB::ReaderWriter::Options to handle PluginData."
  • Loading branch information
robertosfield committed Sep 28, 2007
1 parent 1df542c commit 9aab68b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions include/osgDB/ReaderWriter
Expand Up @@ -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:

Expand All @@ -130,6 +145,8 @@ class OSGDB_EXPORT ReaderWriter : public osg::Object
FilePathList _databasePaths;
CacheHintOptions _objectCacheHint;

typedef std::map<std::string,void*> PluginDataMap;
PluginDataMap _pluginData;
};


Expand Down

0 comments on commit 9aab68b

Please sign in to comment.