AtlasResourceStub< ChunkTypeT > Class Template Reference [Atlas Core]

#include <atlasResourceTOC.h>

Inheritance diagram for AtlasResourceStub< ChunkTypeT >:

Inheritance graph
[legend]
List of all members.

Detailed Description


template<class ChunkTypeT> class AtlasResourceStub< ChunkTypeT >

Base class for resource stubs.

For a resource TOC, the stubs need to know where in the file a given chunk is, as well as other information (like generation of the stub, and how to perform IO).


Public Types

typedef ChunkTypeT ChunkType
 Unloaded
 No chunk data loaded.
 Pending
 Requested, but not currently queued for load.
 Loading
 Currently queued for load; in-flight.
 Loaded
 Chunk is currently loaded.
enum  {
  Unloaded,
  Pending,
  Loading,
  Loaded
}
 Track the current state of this stub's paged data. More...

Public Member Functions

 AtlasResourceStub ()
const bool hasResource () const
 Is a chunk for this stub currently loaded?
virtual void read (Stream *s, const U32 version)
virtual void write (Stream *s)
void purge ()
 Forcibly purge our chunk.

Public Attributes

ChunkTypemChunk
U32 offset
 Position relative to file start, in bytes, for this stub's chunk.
U32 length
 Length of the chunk.
U32 generation
 fancy pants generation number.
U32 stubOffset
 Offset of this stub in the file.
U32 optimizeOrder
 When writing optimized, we can provide an optimization order which allows us to optimize for write order, e.g.
enum AtlasResourceStub:: { ... }  mState
 Track the current state of this stub's paged data.
F32 mPriority
F32 mHeat
AtlasRequestHeader mRequests


Member Typedef Documentation

template<class ChunkTypeT>
typedef ChunkTypeT AtlasResourceStub< ChunkTypeT >::ChunkType


Member Enumeration Documentation

template<class ChunkTypeT>
anonymous enum

Track the current state of this stub's paged data.

Enumerator:
Unloaded  No chunk data loaded.
Pending  Requested, but not currently queued for load.
Loading  Currently queued for load; in-flight.
Loaded  Chunk is currently loaded.


Constructor & Destructor Documentation

template<class ChunkTypeT>
AtlasResourceStub< ChunkTypeT >::AtlasResourceStub (  )  [inline]


Member Function Documentation

template<class ChunkTypeT>
const bool AtlasResourceStub< ChunkTypeT >::hasResource (  )  const [inline]

Is a chunk for this stub currently loaded?

template<class ChunkTypeT>
virtual void AtlasResourceStub< ChunkTypeT >::read ( Stream s,
const U32  version 
) [inline, virtual]

template<class ChunkTypeT>
virtual void AtlasResourceStub< ChunkTypeT >::write ( Stream s  )  [inline, virtual]

template<class ChunkTypeT>
void AtlasResourceStub< ChunkTypeT >::purge (  )  [inline]

Forcibly purge our chunk.


Member Data Documentation

template<class ChunkTypeT>
ChunkType* AtlasResourceStub< ChunkTypeT >::mChunk

template<class ChunkTypeT>
U32 AtlasResourceStub< ChunkTypeT >::offset

Position relative to file start, in bytes, for this stub's chunk.

template<class ChunkTypeT>
U32 AtlasResourceStub< ChunkTypeT >::length

Length of the chunk.

template<class ChunkTypeT>
U32 AtlasResourceStub< ChunkTypeT >::generation

fancy pants generation number.

.. let's say this always gets tracked so we can see how many generations went into this.

template<class ChunkTypeT>
U32 AtlasResourceStub< ChunkTypeT >::stubOffset

Offset of this stub in the file.

NOT serialized; used for updating the stub.

template<class ChunkTypeT>
U32 AtlasResourceStub< ChunkTypeT >::optimizeOrder

When writing optimized, we can provide an optimization order which allows us to optimize for write order, e.g.

on an optical disk for a console. This order is applied across all TOCs, in order of the TOCs in the the file. If the same ID is encountered in multiple places, ties are broken with that rule.

Zero is considered a non-order; zeros are written after every other number.

enum { ... } AtlasResourceStub< ChunkTypeT >::mState

Track the current state of this stub's paged data.

template<class ChunkTypeT>
F32 AtlasResourceStub< ChunkTypeT >::mPriority

template<class ChunkTypeT>
F32 AtlasResourceStub< ChunkTypeT >::mHeat

template<class ChunkTypeT>
AtlasRequestHeader AtlasResourceStub< ChunkTypeT >::mRequests