OGRE: Ogre::Page Class Reference - OGRE Documentation

Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends

# Ogre::Page Class Reference
[Paging]

Page class. More...

`#include <OgrePage.h>`

Inheritance diagram for Ogre::Page:
[legend]

List of all members.

## Classes
struct | PageData
struct | PageRequest
| Structure for holding background page requests. More...
struct | PageResponse
## Public Types
typedef vector < PageContentCollection * > ::type | ContentCollectionList
## Public Member Functions
| Page (PageID pageID, PagedWorldSection *parent)
virtual | ~Page ()
PageManager * | getManager () const
SceneManager * | getSceneManager () const
bool | isDeferredProcessInProgress () const
| If true, it's not safe to access this Page at this time, contents may be changing.
virtual PageID | getID () const
| Get the ID of this page, unique withing the parent.
virtual PagedWorldSection * | getParentSection () const
| Get the PagedWorldSection this page belongs to.
virtual unsigned long | getFrameLastHeld ()
| Get the frame number in which this Page was last loaded or held.
virtual void | touch ()
| 'Touch' the page to let it know it's being used
virtual void | load (bool synchronous)
| Load this page.
virtual void | unload ()
| Unload this page.
virtual bool | isHeld () const
| Returns whether this page was 'held' in the last frame, that is was it either directly needed, or requested to stay in memory (held - as in a buffer region for example).
virtual void | save ()
| Save page data to an automatically generated file name.
virtual void | save (const String &filename)
| Save page data to a file.
virtual void | save (StreamSerialiser &stream)
| Save page data to a serialiser.
virtual void | frameStart (Real timeSinceLastFrame)
| Called when the frame starts.
virtual void | frameEnd (Real timeElapsed)
| Called when the frame ends.
virtual void | notifyCamera (Camera *cam)
| Notify a section of the current camera.
virtual PageContentCollection * | createContentCollection (const String &typeName)
| Create a new PageContentCollection within this page.
virtual void | destroyContentCollection (PageContentCollection *coll)
| Destroy a PageContentCollection within this page.
virtual void | destroyAllContentCollections ()
| Destroy all PageContentCollections within this page.
virtual size_t | getContentCollectionCount () const
| Get the number of content collections.
virtual PageContentCollection * | getContentCollection (size_t index)
| Get a content collection.
const ContentCollectionList & | getContentCollectionList () const
| Get the list of content collections.
bool | canHandleRequest (const WorkQueue::Request *req, const WorkQueue *srcQ)
| WorkQueue::RequestHandler override.
WorkQueue::Response * | handleRequest (const WorkQueue::Request *req, const WorkQueue *srcQ)
| WorkQueue::RequestHandler override.
bool | canHandleResponse (const WorkQueue::Response *res, const WorkQueue *srcQ)
| WorkQueue::ResponseHandler override.
void | handleResponse (const WorkQueue::Response *res, const WorkQueue *srcQ)
| WorkQueue::ResponseHandler override.
void | _notifyModified ()
| Tell the page that it is modified.
bool | isModified () const
virtual bool | canHandleRequest (const Request *req, const WorkQueue *srcQ)
| Return whether this handler can process a given request.
virtual Response * | handleRequest (const Request *req, const WorkQueue *srcQ)=0
| The handler method every subclass must implement.
virtual bool | canHandleResponse (const Response *res, const WorkQueue *srcQ)
| Return whether this handler can process a given response.
virtual void | handleResponse (const Response *res, const WorkQueue *srcQ)=0
| The handler method every subclass must implement.
void * | operator new (size_t sz, const char *file, int line, const char *func)
| operator new, with debug line info
void * | operator new (size_t sz)
void * | operator new (size_t sz, void *ptr)
| placement operator new
void * | operator new[] (size_t sz, const char *file, int line, const char *func)
| array operator new, with debug line info
void * | operator new[] (size_t sz)
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 *)
## Static Public Attributes
static const uint32 | CHUNK_ID
static const uint16 | CHUNK_VERSION
static const uint32 | CHUNK_CONTENTCOLLECTION_DECLARATION_ID
static const uint16 | WORKQUEUE_PREPARE_REQUEST
static const uint16 | WORKQUEUE_CHANGECOLLECTION_REQUEST
## Protected Member Functions
void | updateDebugDisplay ()
virtual bool | prepareImpl (PageData *dataToPopulate)
virtual bool | prepareImpl (StreamSerialiser &str, PageData *dataToPopulate)
virtual void | loadImpl ()
String | generateFilename () const
## Protected Attributes
PageID | mID
PagedWorldSection * | mParent
unsigned long | mFrameLastHeld
ContentCollectionList | mContentCollections
uint16 | mWorkQueueChannel
bool | mDeferredProcessInProgress
bool | mModified
SceneNode * | mDebugNode
## Friends
_OgrePagingExport friend std::ostream & | operator<< (std::ostream &o, const Page &p)
| Function for writing to a stream.

## Detailed Description

Page class.

Definition at line 48 of file OgrePage.h.

## Member Typedef Documentation

typedef vector<PageContentCollection*>::type Ogre::Page::ContentCollectionList

Definition at line 52 of file OgrePage.h.

## Constructor & Destructor Documentation

Ogre::Page::Page | ( | PageID | pageID,
|  | PagedWorldSection * | parent |
| ) |  |  |

virtual Ogre::Page::~Page | ( |  | ) | `[virtual]`

## Member Function Documentation

void Ogre::Page::_notifyModified | ( |  | ) |

Tell the page that it is modified.

Definition at line 187 of file OgrePage.h.

bool Ogre::Page::canHandleRequest | ( | const WorkQueue::Request * | req,
|  | const WorkQueue * | srcQ |
| ) |  |  |

WorkQueue::RequestHandler override.

virtual bool Ogre::WorkQueue::RequestHandler::canHandleRequest | ( | const Request * | req,
|  | const WorkQueue * | srcQ |
| ) |  |  | `[virtual, inherited]`

Return whether this handler can process a given request.

Remarks:
  Defaults to true, but if you wish to add several handlers each of which deal with different types of request, you can override this method.

Definition at line 172 of file OgreWorkQueue.h.

References Ogre::WorkQueue::Request::getAborted().

virtual bool Ogre::WorkQueue::ResponseHandler::canHandleResponse | ( | const Response * | res,
|  | const WorkQueue * | srcQ |
| ) |  |  | `[virtual, inherited]`

Return whether this handler can process a given response.

Remarks:
  Defaults to true, but if you wish to add several handlers each of which deal with different types of response, you can override this method.

Reimplemented in Ogre::ResourceBackgroundQueue.

Definition at line 207 of file OgreWorkQueue.h.

References Ogre::WorkQueue::Request::getAborted(), and Ogre::WorkQueue::Response::getRequest().

bool Ogre::Page::canHandleResponse | ( | const WorkQueue::Response * | res,
|  | const WorkQueue * | srcQ |
| ) |  |  |

WorkQueue::ResponseHandler override.

virtual PageContentCollection* Ogre::Page::createContentCollection | ( | const String & | typeName | ) | `[virtual]`

Create a new PageContentCollection within this page.

This is equivalent to calling PageManager::createContentCollection and then attachContentCollection.

Parameters:

  | typeName | The name of the type of content collection (see PageManager::getContentCollectionFactories)

virtual void Ogre::Page::destroyAllContentCollections | ( |  | ) | `[virtual]`

Destroy all PageContentCollections within this page.

virtual void Ogre::Page::destroyContentCollection | ( | PageContentCollection * | coll | ) | `[virtual]`

Destroy a PageContentCollection within this page.

This is equivalent to calling detachContentCollection and PageManager::destroyContentCollection.

virtual void Ogre::Page::frameEnd | ( | Real | timeElapsed | ) | `[virtual]`

Called when the frame ends.

virtual void Ogre::Page::frameStart | ( | Real | timeSinceLastFrame | ) | `[virtual]`

Called when the frame starts.

String Ogre::Page::generateFilename | ( |  | ) | const`[protected]`

virtual PageContentCollection* Ogre::Page::getContentCollection | ( | size_t | index | ) | `[virtual]`

Get a content collection.

virtual size_t Ogre::Page::getContentCollectionCount | ( |  | ) | const`[virtual]`

Get the number of content collections.

const ContentCollectionList& Ogre::Page::getContentCollectionList | ( |  | ) | const

Get the list of content collections.

virtual unsigned long Ogre::Page::getFrameLastHeld | ( |  | ) | `[virtual]`

Get the frame number in which this Page was last loaded or held.

Remarks:
  A Page that has not been requested to be loaded or held in the recent past will be a candidate for removal.

Definition at line 120 of file OgrePage.h.

virtual PageID Ogre::Page::getID | ( |  | ) | const`[virtual]`

Get the ID of this page, unique withing the parent.

Definition at line 112 of file OgrePage.h.

PageManager* Ogre::Page::getManager | ( |  | ) | const

virtual PagedWorldSection* Ogre::Page::getParentSection | ( |  | ) | const`[virtual]`

Get the PagedWorldSection this page belongs to.

Definition at line 114 of file OgrePage.h.

SceneManager* Ogre::Page::getSceneManager | ( |  | ) | const

virtual Response* Ogre::WorkQueue::RequestHandler::handleRequest | ( | const Request * | req,
|  | const WorkQueue * | srcQ |
| ) |  |  | `[pure virtual, inherited]`

The handler method every subclass must implement.

If a failure is encountered, return a Response with a failure result rather than raise an exception.

Parameters:

  | req | The Request structure, which is effectively owned by the handler during this call. It must be attached to the returned Response regardless of success or failure.
  | srcQ | The work queue that this request originated from

Returns:
  Pointer to a Response object - the caller is responsible for deleting the object.

WorkQueue::Response* Ogre::Page::handleRequest | ( | const WorkQueue::Request * | req,
|  | const WorkQueue * | srcQ |
| ) |  |  |

WorkQueue::RequestHandler override.

virtual void Ogre::WorkQueue::ResponseHandler::handleResponse | ( | const Response * | res,
|  | const WorkQueue * | srcQ |
| ) |  |  | `[pure virtual, inherited]`

The handler method every subclass must implement.

Parameters:

  | res | The Response structure. The caller is responsible for deleting this after the call is made, none of the data contained (except pointers to structures in user Any data) will persist after this call is returned.
  | srcQ | The work queue that this request originated from

Implemented in Ogre::ResourceBackgroundQueue.

void Ogre::Page::handleResponse | ( | const WorkQueue::Response * | res,
|  | const WorkQueue * | srcQ |
| ) |  |  |

WorkQueue::ResponseHandler override.

bool Ogre::Page::isDeferredProcessInProgress | ( |  | ) | const

If true, it's not safe to access this Page at this time, contents may be changing.

Definition at line 109 of file OgrePage.h.

virtual bool Ogre::Page::isHeld | ( |  | ) | const`[virtual]`

Returns whether this page was 'held' in the last frame, that is was it either directly needed, or requested to stay in memory (held - as in a buffer region for example).

If not, this page is eligible for removal.

bool Ogre::Page::isModified | ( |  | ) | const

Definition at line 188 of file OgrePage.h.

virtual void Ogre::Page::load | ( | bool | synchronous | ) | `[virtual]`

Load this page.

Parameters:

  | synchronous | Whether to force this to happen synchronously.

virtual void Ogre::Page::loadImpl | ( |  | ) | `[protected, virtual]`

virtual void Ogre::Page::notifyCamera | ( | Camera * | cam | ) | `[virtual]`

Notify a section of the current camera.

template<class Alloc >

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

Definition at line 107 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

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

Definition at line 101 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

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

Definition at line 95 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

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

Definition at line 112 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

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

Definition at line 118 of file OgreMemoryAllocatedObject.h.

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 67 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

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

Definition at line 72 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

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

placement operator new

Definition at line 78 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

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

Definition at line 90 of file OgreMemoryAllocatedObject.h.

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 85 of file OgreMemoryAllocatedObject.h.

virtual bool Ogre::Page::prepareImpl | ( | PageData * | dataToPopulate | ) | `[protected, virtual]`

virtual bool Ogre::Page::prepareImpl | ( | StreamSerialiser & | str,
|  | PageData * | dataToPopulate |
| ) |  |  | `[protected, virtual]`

virtual void Ogre::Page::save | ( | StreamSerialiser & | stream | ) | `[virtual]`

Save page data to a serialiser.

virtual void Ogre::Page::save | ( |  | ) | `[virtual]`

Save page data to an automatically generated file name.

virtual void Ogre::Page::save | ( | const String & | filename | ) | `[virtual]`

Save page data to a file.

virtual void Ogre::Page::touch | ( |  | ) | `[virtual]`

'Touch' the page to let it know it's being used

virtual void Ogre::Page::unload | ( |  | ) | `[virtual]`

Unload this page.

void Ogre::Page::updateDebugDisplay | ( |  | ) | `[protected]`

## Friends And Related Function Documentation

_OgrePagingExport friend std::ostream& operator<< | ( | std::ostream & | o,
|  | const Page & | p |
| ) |  |  | `[friend]`

Function for writing to a stream.

## Member Data Documentation

const uint32 Ogre::Page::CHUNK_CONTENTCOLLECTION_DECLARATION_ID`[static]`

Definition at line 100 of file OgrePage.h.

const uint32 Ogre::Page::CHUNK_ID`[static]`

Definition at line 97 of file OgrePage.h.

const uint16 Ogre::Page::CHUNK_VERSION`[static]`

Definition at line 98 of file OgrePage.h.

ContentCollectionList Ogre::Page::mContentCollections`[protected]`

Definition at line 57 of file OgrePage.h.

SceneNode* Ogre::Page::mDebugNode`[protected]`

Definition at line 62 of file OgrePage.h.

bool Ogre::Page::mDeferredProcessInProgress`[protected]`

Definition at line 59 of file OgrePage.h.

unsigned long Ogre::Page::mFrameLastHeld`[protected]`

Definition at line 56 of file OgrePage.h.

PageID Ogre::Page::mID`[protected]`

Definition at line 54 of file OgrePage.h.

bool Ogre::Page::mModified`[protected]`

Definition at line 60 of file OgrePage.h.

PagedWorldSection* Ogre::Page::mParent`[protected]`

Definition at line 55 of file OgrePage.h.

uint16 Ogre::Page::mWorkQueueChannel`[protected]`

Definition at line 58 of file OgrePage.h.

const uint16 Ogre::Page::WORKQUEUE_CHANGECOLLECTION_REQUEST`[static]`

Definition at line 191 of file OgrePage.h.

const uint16 Ogre::Page::WORKQUEUE_PREPARE_REQUEST`[static]`

Definition at line 190 of file OgrePage.h.

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

- OgrePage.h

Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Wed Nov 3 2010 19:25:04