OGRE-Next  3.0.0
Object-Oriented Graphics Rendering Engine
Ogre::ArchiveFactory Class Referenceabstract

Abstract factory class, archive codec plugins can register concrete subclasses of this. More...

#include <OgreArchiveFactory.h>

+ Inheritance diagram for Ogre::ArchiveFactory:

Public Member Functions

 ~ArchiveFactory () override
 
virtual void convertPath (String &inOutPath) const
 Some implementations (i.e. More...
 
ArchivecreateInstance (const String &name) override
 Creates a new object. More...
 
virtual ArchivecreateInstance (const String &name, bool readOnly)=0
 Creates a new object. More...
 
- Public Member Functions inherited from Ogre::FactoryObj< Archive >
virtual ~FactoryObj ()
 
virtual void destroyInstance (Archive *ptr)=0
 Destroys an object which was created by this factory. More...
 
virtual const StringgetType () const=0
 Returns the factory type. More...
 

Detailed Description

Abstract factory class, archive codec plugins can register concrete subclasses of this.

Remarks
All access to 'archives' (collections of files, compressed or just folders, maybe even remote) is managed via the abstract Archive class. Plugins are expected to provide the implementation for the actual codec itself, but because a subclass of Archive has to be created for every archive, a factory class is required to create the appropriate subclass.
So archive plugins create a subclass of Archive AND a subclass of ArchiveFactory which creates instances of the Archive subclass. See the 'Zip' and 'FileSystem' plugins for examples. Each Archive and ArchiveFactory subclass pair deal with a single archive type (identified by a string).

Constructor & Destructor Documentation

◆ ~ArchiveFactory()

Ogre::ArchiveFactory::~ArchiveFactory ( )
inlineoverride

Member Function Documentation

◆ convertPath()

virtual void Ogre::ArchiveFactory::convertPath ( String inOutPath) const
inlinevirtual

Some implementations (i.e.

APKFileSystemArchive) usually modify the filename. For example in APKFileSystemArchive, "/path/to/localfile.mesh" gets internally stored as "path/to/localfile.mesh" (no leading slash), but across the platform the leading slash is required. The ArchiveManager needs to be aware of this.

Parameters
inOutPathGiven the input path, converts it to the final path.

Reimplemented in Ogre::APKZipArchiveFactory, and Ogre::APKFileSystemArchiveFactory.

◆ createInstance() [1/2]

Archive* Ogre::ArchiveFactory::createInstance ( const String name)
inlineoverridevirtual

Creates a new object.

Parameters
nameName of the object to create
Returns
An object created by the factory. The type of the object depends on the factory.

Implements Ogre::FactoryObj< Archive >.

References createInstance().

Referenced by createInstance().

◆ createInstance() [2/2]

virtual Archive* Ogre::ArchiveFactory::createInstance ( const String name,
bool  readOnly 
)
pure virtual

Creates a new object.

Parameters
nameName of the object to create
Returns
An object created by the factory. The type of the object depends on the factory.

Implemented in Ogre::EmbeddedZipArchiveFactory, Ogre::ZipArchiveFactory, Ogre::FileSystemArchiveFactory, Ogre::APKZipArchiveFactory, and Ogre::APKFileSystemArchiveFactory.


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