Ogre::ArchiveManager Class Reference
Core » Resources

This class manages the available ArchiveFactory plugins. More...

`#include <OgreArchiveManager.h>`

Inheritance diagram for Ogre::ArchiveManager:
[legend]

## Public Types

typedef MapIterator< ArchiveMap > | ArchiveMapIterator

## Public Member Functions

| ArchiveManager ()
| Default constructor - should never get called by a client app. More...
virtual | ~ArchiveManager ()
| Default destructor. More...
void | addArchiveFactory (ArchiveFactory *factory)
| Adds a new ArchiveFactory to the list of available factories. More...
ArchiveMapIterator | getArchiveIterator (void)
| Get an iterator over the Archives in this Manager. More...
Archive * | load (const String &filename, const String &archiveType, bool readOnly)
| Opens an archive for file reading. More...
void | operator delete (void *ptr)
void | operator delete (void *ptr, void *)
void | operator delete (void *ptr, const char *, int, const char *)
void | operator delete[] (void *ptr)
void | operator delete[] (void *ptr, const char *, int, const char *)
void * | operator new (size_t sz, const char *file, int line, const char *func)
| operator new, with debug line info More...
void * | operator new (size_t sz)
void * | operator new (size_t sz, void *ptr)
| placement operator new More...
void * | operator new[] (size_t sz, const char *file, int line, const char *func)
| array operator new, with debug line info More...
void * | operator new[] (size_t sz)
void | unload (Archive *arch)
| Unloads an archive. More...
void | unload (const String &filename)
| Unloads an archive by name. More...

## Static Public Member Functions

static ArchiveManager & | getSingleton (void)
| Override standard Singleton retrieval. More...
static ArchiveManager * | getSingletonPtr (void)
| Override standard Singleton retrieval. More...

## Protected Types

typedef map< String, ArchiveFactory * >::type | ArchiveFactoryMap
typedef map< String, Archive * >::type | ArchiveMap
| Currently loaded archives. More...

## Protected Attributes

ArchiveFactoryMap | mArchFactories
| Factories available to create archives, indexed by archive type (String identifier e.g. 'Zip') More...
ArchiveMap | mArchives

## Static Protected Attributes

static ArchiveManager * | msSingleton

## Detailed Description

This class manages the available ArchiveFactory plugins.

Definition at line 47 of file OgreArchiveManager.h.

## Member Typedef Documentation

## ArchiveFactoryMap

typedef map<String, ArchiveFactory*>::type Ogre::ArchiveManager::ArchiveFactoryMap

protected

Definition at line 50 of file OgreArchiveManager.h.

## ArchiveMap

typedef map<String, Archive*>::type Ogre::ArchiveManager::ArchiveMap

protected

Currently loaded archives.

Definition at line 54 of file OgreArchiveManager.h.

## ArchiveMapIterator

typedef MapIterator<ArchiveMap> Ogre::ArchiveManager::ArchiveMapIterator

Definition at line 91 of file OgreArchiveManager.h.

## Constructor & Destructor Documentation

## ArchiveManager()

Ogre::ArchiveManager::ArchiveManager | ( |  | ) |

Default constructor - should never get called by a client app.

## ~ArchiveManager()

virtual Ogre::ArchiveManager::~ArchiveManager | ( |  | ) |

virtual

Default destructor.

## Member Function Documentation

## addArchiveFactory()

void Ogre::ArchiveManager::addArchiveFactory | ( | ArchiveFactory * | factory | ) |

Adds a new ArchiveFactory to the list of available factories.

Remarks
  Plugin developers who add new archive codecs need to call this after defining their ArchiveFactory subclass and Archive subclasses for their archive type.

## getArchiveIterator()

ArchiveMapIterator Ogre::ArchiveManager::getArchiveIterator | ( | void |  | ) |

Get an iterator over the Archives in this Manager.

## getSingleton()

static ArchiveManager& Ogre::ArchiveManager::getSingleton | ( | void |  | ) |

static

Override standard Singleton retrieval.

Remarks
  Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll.

  This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors.

## getSingletonPtr()

static ArchiveManager* Ogre::ArchiveManager::getSingletonPtr | ( | void |  | ) |

static

Override standard Singleton retrieval.

Remarks
  Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll.

  This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors.

## load()

Archive* Ogre::ArchiveManager::load | ( | const String & | filename,
|  | const String & | archiveType,
|  | bool | readOnly
| ) |  |

Opens an archive for file reading.

Remarks
  The archives are created using class factories within extension libraries.

Parameters

  filename | The filename that will be opened
  archiveType | The type of archive that this is. For example: "Zip".

Returns
  If the function succeeds, a valid pointer to an Archive object is returned.

  If the function fails, an exception is thrown.

## operator delete() [1/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr | ) |

inherited

Definition at line 96 of file OgreMemoryAllocatedObject.h.

## operator delete() [2/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | void * |
| ) |  |

inherited

Definition at line 102 of file OgreMemoryAllocatedObject.h.

## operator delete() [3/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |
| ) |  |

inherited

Definition at line 108 of file OgreMemoryAllocatedObject.h.

## operator delete[]() [1/2]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr | ) |

inherited

Definition at line 113 of file OgreMemoryAllocatedObject.h.

## operator delete[]() [2/2]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |
| ) |  |

inherited

Definition at line 119 of file OgreMemoryAllocatedObject.h.

## operator new() [1/3]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func
| ) |  |

inherited

operator new, with debug line info

Definition at line 68 of file OgreMemoryAllocatedObject.h.

## operator new() [2/3]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz | ) |

inherited

Definition at line 73 of file OgreMemoryAllocatedObject.h.

## operator new() [3/3]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | void * | ptr
| ) |  |

inherited

placement operator new

Definition at line 79 of file OgreMemoryAllocatedObject.h.

## operator new[]() [1/2]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func
| ) |  |

inherited

array operator new, with debug line info

Definition at line 86 of file OgreMemoryAllocatedObject.h.

## operator new[]() [2/2]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz | ) |

inherited

Definition at line 91 of file OgreMemoryAllocatedObject.h.

## unload() [1/2]

void Ogre::ArchiveManager::unload | ( | Archive * | arch | ) |

Unloads an archive.

Remarks
  You must ensure that this archive is not being used before removing it.

## unload() [2/2]

void Ogre::ArchiveManager::unload | ( | const String & | filename | ) |

Unloads an archive by name.

Remarks
  You must ensure that this archive is not being used before removing it.

## Member Data Documentation

## mArchFactories

ArchiveFactoryMap Ogre::ArchiveManager::mArchFactories

protected

Factories available to create archives, indexed by archive type (String identifier e.g. 'Zip')

Definition at line 52 of file OgreArchiveManager.h.

## mArchives

ArchiveMap Ogre::ArchiveManager::mArchives

protected

Definition at line 55 of file OgreArchiveManager.h.

## msSingleton

ArchiveManager * Ogre::Singleton< ArchiveManager >::msSingleton

static protected inherited

Definition at line 75 of file OgreSingleton.h.

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

- OgreArchiveManager.h

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.