OpenSceneGraph
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
osgDB::FileCache Class Reference
Inheritance diagram for osgDB::FileCache:
Inheritance graph
[legend]

Public Types

typedef std::list< osg::ref_ptr< DatabaseRevisions > > DatabaseRevisionsList
 

Public Member Functions

 FileCache (const std::string &path)
 
const std::string & getFileCachePath () const
 
virtual bool isFileAppropriateForFileCache (const std::string &originalFileName) const
 
virtual std::string createCacheFileName (const std::string &originalFileName) const
 
virtual bool existsInCache (const std::string &originalFileName) const
 
virtual ReaderWriter::ReadResult readImage (const std::string &originalFileName, const osgDB::Options *options) const
 
virtual ReaderWriter::WriteResult writeImage (const osg::Image &image, const std::string &originalFileName, const osgDB::Options *options) const
 
virtual ReaderWriter::ReadResult readObject (const std::string &originalFileName, const osgDB::Options *options) const
 
virtual ReaderWriter::WriteResult writeObject (const osg::Object &object, const std::string &originalFileName, const osgDB::Options *options) const
 
virtual ReaderWriter::ReadResult readHeightField (const std::string &originalFileName, const osgDB::Options *options) const
 
virtual ReaderWriter::WriteResult writeHeightField (const osg::HeightField &hf, const std::string &originalFileName, const osgDB::Options *options) const
 
virtual ReaderWriter::ReadResult readNode (const std::string &originalFileName, const osgDB::Options *options, bool buildKdTreeIfRequired=true) const
 
virtual ReaderWriter::WriteResult writeNode (const osg::Node &node, const std::string &originalFileName, const osgDB::Options *options) const
 
virtual ReaderWriter::ReadResult readShader (const std::string &originalFileName, const osgDB::Options *options) const
 
virtual ReaderWriter::WriteResult writeShader (const osg::Shader &shader, const std::string &originalFileName, const osgDB::Options *options) const
 
bool loadDatabaseRevisionsForFile (const std::string &originanlFileName)
 
DatabaseRevisionsListgetDatabaseRevisionsList ()
 
bool isCachedFileBlackListed (const std::string &originalFileName) const
 
- Public Member Functions inherited from osg::Referenced
 Referenced ()
 
 Referenced (bool threadSafeRefUnref)
 Deprecated, Referenced is now always uses thread safe ref/unref, use default Referenced() constructor instead. More...
 
 Referenced (const Referenced &)
 
Referencedoperator= (const Referenced &)
 
virtual void setThreadSafeRefUnref (bool)
 Deprecated, Referenced is always theadsafe so there method now has no effect and does not need to be called. More...
 
bool getThreadSafeRefUnref () const
 Get whether a mutex is used to ensure ref() and unref() are thread safe. More...
 
OpenThreads::MutexgetRefMutex () const
 Get the mutex used to ensure thread safety of ref()/unref(). More...
 
int ref () const
 Increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
int unref () const
 Decrement the reference count by one, indicating that a pointer to this object is no longer referencing it. More...
 
int unref_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is no longer referencing it. More...
 
int referenceCount () const
 Return the number of pointers currently referencing this object. More...
 
ObserverSetgetObserverSet () const
 Get the ObserverSet if one is attached, otherwise return NULL. More...
 
ObserverSetgetOrCreateObserverSet () const
 Get the ObserverSet if one is attached, otherwise create an ObserverSet, attach it, then return this newly created ObserverSet. More...
 
void addObserver (Observer *observer) const
 Add a Observer that is observing this object, notify the Observer when this object gets deleted. More...
 
void removeObserver (Observer *observer) const
 Remove Observer that is observing this object. More...
 

Protected Member Functions

virtual ~FileCache ()
 
FileListreadFileList (const std::string &originalFileName) const
 
bool removeFileFromBlackListed (const std::string &originalFileName) const
 
- Protected Member Functions inherited from osg::Referenced
virtual ~Referenced ()
 
void signalObserversAndDelete (bool signalDelete, bool doDelete) const
 
void deleteUsingDeleteHandler () const
 

Protected Attributes

std::string _fileCachePath
 
DatabaseRevisionsList _databaseRevisionsList
 
- Protected Attributes inherited from osg::Referenced
OpenThreads::AtomicPtr _observerSet
 
OpenThreads::Atomic _refCount
 

Additional Inherited Members

- Static Public Member Functions inherited from osg::Referenced
static OpenThreads::MutexgetGlobalReferencedMutex ()
 Get the optional global Referenced mutex, this can be shared between all osg::Referenced. More...
 
static void setDeleteHandler (DeleteHandler *handler)
 Set a DeleteHandler to which deletion of all referenced counted objects will be delegated. More...
 
static DeleteHandlergetDeleteHandler ()
 Get a DeleteHandler. More...
 

Member Typedef Documentation

◆ DatabaseRevisionsList

Constructor & Destructor Documentation

◆ FileCache()

osgDB::FileCache::FileCache ( const std::string &  path)

◆ ~FileCache()

virtual osgDB::FileCache::~FileCache ( )
protectedvirtual

Member Function Documentation

◆ createCacheFileName()

virtual std::string osgDB::FileCache::createCacheFileName ( const std::string &  originalFileName) const
virtual

◆ existsInCache()

virtual bool osgDB::FileCache::existsInCache ( const std::string &  originalFileName) const
virtual

◆ getDatabaseRevisionsList()

DatabaseRevisionsList& osgDB::FileCache::getDatabaseRevisionsList ( )
inline

◆ getFileCachePath()

const std::string& osgDB::FileCache::getFileCachePath ( ) const
inline

References osg::readImage().

◆ isCachedFileBlackListed()

bool osgDB::FileCache::isCachedFileBlackListed ( const std::string &  originalFileName) const

◆ isFileAppropriateForFileCache()

virtual bool osgDB::FileCache::isFileAppropriateForFileCache ( const std::string &  originalFileName) const
virtual

◆ loadDatabaseRevisionsForFile()

bool osgDB::FileCache::loadDatabaseRevisionsForFile ( const std::string &  originanlFileName)

◆ readFileList()

FileList* osgDB::FileCache::readFileList ( const std::string &  originalFileName) const
protected

◆ readHeightField()

virtual ReaderWriter::ReadResult osgDB::FileCache::readHeightField ( const std::string &  originalFileName,
const osgDB::Options options 
) const
virtual

◆ readImage()

virtual ReaderWriter::ReadResult osgDB::FileCache::readImage ( const std::string &  originalFileName,
const osgDB::Options options 
) const
virtual

◆ readNode()

virtual ReaderWriter::ReadResult osgDB::FileCache::readNode ( const std::string &  originalFileName,
const osgDB::Options options,
bool  buildKdTreeIfRequired = true 
) const
virtual

◆ readObject()

virtual ReaderWriter::ReadResult osgDB::FileCache::readObject ( const std::string &  originalFileName,
const osgDB::Options options 
) const
virtual

◆ readShader()

virtual ReaderWriter::ReadResult osgDB::FileCache::readShader ( const std::string &  originalFileName,
const osgDB::Options options 
) const
virtual

◆ removeFileFromBlackListed()

bool osgDB::FileCache::removeFileFromBlackListed ( const std::string &  originalFileName) const
protected

◆ writeHeightField()

virtual ReaderWriter::WriteResult osgDB::FileCache::writeHeightField ( const osg::HeightField hf,
const std::string &  originalFileName,
const osgDB::Options options 
) const
virtual

◆ writeImage()

virtual ReaderWriter::WriteResult osgDB::FileCache::writeImage ( const osg::Image image,
const std::string &  originalFileName,
const osgDB::Options options 
) const
virtual

◆ writeNode()

virtual ReaderWriter::WriteResult osgDB::FileCache::writeNode ( const osg::Node node,
const std::string &  originalFileName,
const osgDB::Options options 
) const
virtual

◆ writeObject()

virtual ReaderWriter::WriteResult osgDB::FileCache::writeObject ( const osg::Object object,
const std::string &  originalFileName,
const osgDB::Options options 
) const
virtual

◆ writeShader()

virtual ReaderWriter::WriteResult osgDB::FileCache::writeShader ( const osg::Shader shader,
const std::string &  originalFileName,
const osgDB::Options options 
) const
virtual

Member Data Documentation

◆ _databaseRevisionsList

DatabaseRevisionsList osgDB::FileCache::_databaseRevisionsList
protected

◆ _fileCachePath

std::string osgDB::FileCache::_fileCachePath
protected

The documentation for this class was generated from the following file: