torque Torque Game Engine Documentation
TGE Version 1.5.2

ResDictionary Class Reference

#include <resManager.h>


Detailed Description

Resource Dictionary.

Maps of names and object IDs to objects.

Provides fast lookup for name->object, id->object and for fast removal of an object given a pointer to it.

See also:
ResManager


Hash Table

enum  { DefaultTableSize = 1029 }
ResourceObject ** hashTable
S32 entryCount
S32 hashTableSize
DataChunker memPool
S32 hash (StringTableEntry path, StringTableEntry name)
S32 hash (ResourceObject *obj)

Public Member Functions

 ResDictionary ()
 ~ResDictionary ()
void insert (ResourceObject *obj, StringTableEntry path, StringTableEntry file)
 Add a ResourceObject to the dictionary.
void pushBehind (ResourceObject *obj, S32 mask)
 Move a previously added resource object to be in the list after everything that matches the specified mask.
void remove (ResourceObject *obj)
 Remove a resource object from the dictionary.
Find
These functions search the hash table for an individual resource.

If the resource has already been loaded, it will find the resource and return its object. If not, it will return NULL.

ResourceObjectfind (StringTableEntry path, StringTableEntry file)
ResourceObjectfind (StringTableEntry path, StringTableEntry file, StringTableEntry filePath, StringTableEntry fileName)
ResourceObjectfind (StringTableEntry path, StringTableEntry file, U32 flags)


Member Enumeration Documentation

anonymous enum [private]

Enumerator:
DefaultTableSize 


Constructor & Destructor Documentation

ResDictionary::ResDictionary (  ) 

ResDictionary::~ResDictionary (  ) 


Member Function Documentation

S32 ResDictionary::hash ( StringTableEntry  path,
StringTableEntry  name 
) [private]

S32 ResDictionary::hash ( ResourceObject obj  )  [inline, private]

void ResDictionary::insert ( ResourceObject obj,
StringTableEntry  path,
StringTableEntry  file 
)

Add a ResourceObject to the dictionary.

ResourceObject* ResDictionary::find ( StringTableEntry  path,
StringTableEntry  file 
)

ResourceObject* ResDictionary::find ( StringTableEntry  path,
StringTableEntry  file,
StringTableEntry  filePath,
StringTableEntry  fileName 
)

ResourceObject* ResDictionary::find ( StringTableEntry  path,
StringTableEntry  file,
U32  flags 
)

void ResDictionary::pushBehind ( ResourceObject obj,
S32  mask 
)

Move a previously added resource object to be in the list after everything that matches the specified mask.

void ResDictionary::remove ( ResourceObject obj  ) 

Remove a resource object from the dictionary.


Field Documentation




All Rights Reserved GarageGames.com, Inc. 1999-2005
Auto-magically Generated with Doxygen