osgEarth 2.1.1
Public Types | Public Member Functions | Public Attributes

VPBSourceFactory Class Reference

Inheritance diagram for VPBSourceFactory:
Collaboration diagram for VPBSourceFactory:

List of all members.

Public Types

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

Public Member Functions

 VPBSourceFactory ()
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 634 of file ReaderWriterVPB.cpp.


Member Typedef Documentation

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

Definition at line 673 of file ReaderWriterVPB.cpp.


Constructor & Destructor Documentation

VPBSourceFactory::VPBSourceFactory ( ) [inline]

Definition at line 637 of file ReaderWriterVPB.cpp.

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

Member Function Documentation

virtual const char* VPBSourceFactory::className ( ) [inline, virtual]

Definition at line 642 of file ReaderWriterVPB.cpp.

        {
            return "VirtualPlanetBuilder ReaderWriter";
        }
virtual ReadResult VPBSourceFactory::readObject ( const std::string &  file_name,
const Options *  options 
) const [inline, virtual]

Definition at line 647 of file ReaderWriterVPB.cpp.

        {
            if ( !acceptsExtension(osgDB::getLowerCaseFileExtension( file_name )))
                return ReadResult::FILE_NOT_HANDLED;

            VPBOptions vpbOptions( getTileSourceOptions(options) );

            URI url = vpbOptions.url().value();
            if ( !url.empty() )
            {                
                OpenThreads::ScopedLock<OpenThreads::Mutex> lock(vpbDatabaseMapMutex);
                osg::observer_ptr<VPBDatabase>& db_ptr = vpbDatabaseMap[*url]; //get or create
                
                if (!db_ptr) db_ptr = new VPBDatabase( vpbOptions );
                
                if (db_ptr.valid())
                    return new VPBSource( db_ptr.get(), vpbOptions );
                else
                    return ReadResult::FILE_NOT_FOUND;               
            }
            else
            {
                return ReadResult::FILE_NOT_HANDLED;
            }
        }

Here is the call graph for this function:


Member Data Documentation

Definition at line 675 of file ReaderWriterVPB.cpp.

OpenThreads::Mutex VPBSourceFactory::vpbDatabaseMapMutex [mutable]

Definition at line 674 of file ReaderWriterVPB.cpp.


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