osgEarth 2.1.1
|
Public Types | |
typedef std::map< std::string, osg::observer_ptr< VPBDatabase > > | VPBDatabaseMap |
Public Member Functions | |
ReaderWriterVPB () | |
virtual const char * | className () |
virtual ReadResult | readObject (const std::string &file_name, const Options *options) const |
Public Attributes | |
OpenThreads::Mutex | vpbDatabaseMapMutex |
VPBDatabaseMap | vpbDatabaseMap |
Definition at line 624 of file Copy of ReaderWriterVPB.cpp.
typedef std::map<std::string, osg::observer_ptr<VPBDatabase> > ReaderWriterVPB::VPBDatabaseMap |
Definition at line 663 of file Copy of ReaderWriterVPB.cpp.
ReaderWriterVPB::ReaderWriterVPB | ( | ) | [inline] |
Definition at line 627 of file Copy of ReaderWriterVPB.cpp.
{ supportsExtension( "osgearth_vpb", "VirtualPlanetBuilder data" ); }
virtual const char* ReaderWriterVPB::className | ( | ) | [inline, virtual] |
Definition at line 632 of file Copy of ReaderWriterVPB.cpp.
{ return "VirtualPlanetBuilder ReaderWriter"; }
virtual ReadResult ReaderWriterVPB::readObject | ( | const std::string & | file_name, |
const Options * | options | ||
) | const [inline, virtual] |
Definition at line 637 of file Copy of ReaderWriterVPB.cpp.
{ if ( !acceptsExtension(osgDB::getLowerCaseFileExtension( file_name ))) return ReadResult::FILE_NOT_HANDLED; const PluginOptions* pluginOpts = static_cast<const PluginOptions*>( options ); //osg::notify(osg::NOTICE) << pluginOpts->config().toString() << std::endl; std::string url = pluginOpts->config().value( PROPERTY_URL ); if ( !url.empty() ) { OpenThreads::ScopedLock<OpenThreads::Mutex> lock(vpbDatabaseMapMutex); osg::observer_ptr<VPBDatabase>& db_ptr = vpbDatabaseMap[url]; if (!db_ptr) db_ptr = new VPBDatabase( pluginOpts ); if (db_ptr.valid()) return new VPBSource(db_ptr.get(), pluginOpts ); else return ReadResult::FILE_NOT_FOUND; } else { return ReadResult::FILE_NOT_HANDLED; } }
Definition at line 665 of file Copy of ReaderWriterVPB.cpp.
OpenThreads::Mutex ReaderWriterVPB::vpbDatabaseMapMutex [mutable] |
Definition at line 664 of file Copy of ReaderWriterVPB.cpp.