osgEarth 2.1.1
Public Types | Public Member Functions | Public Attributes

ReaderWriterVPB Class Reference

List of all members.

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

Detailed Description

Definition at line 624 of file Copy of ReaderWriterVPB.cpp.


Member Typedef Documentation

typedef std::map<std::string, osg::observer_ptr<VPBDatabase> > ReaderWriterVPB::VPBDatabaseMap

Definition at line 663 of file Copy of ReaderWriterVPB.cpp.


Constructor & Destructor Documentation

ReaderWriterVPB::ReaderWriterVPB ( ) [inline]

Definition at line 627 of file Copy of ReaderWriterVPB.cpp.

        {
            supportsExtension( "osgearth_vpb", "VirtualPlanetBuilder data" );
        }

Member Function Documentation

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;
            }
        }

Member Data Documentation

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.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines