VR-Forces 4.0.4 Class Documentation
Public Member Functions | Protected Member Functions | Protected Attributes
DtSimResourceManager Class Reference

class DtSimResourceManager: More...

Inheritance diagram for DtSimResourceManager:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtSimResourceManager (const DtString &name, DtReaderWriterRegistry *parentRegistry=NULL)
 real constructor
 DtSimResourceManager (const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=NULL)
 DtSimResourceManager (const DtString &name, const DtSimResourceManager &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 copy constructor
 DtSimResourceManager (const DtSymbolString &name, const DtSimResourceManager &orig, DtReaderWriterRegistry *parentRegistry=NULL)
DtSimResourceManageroperator= (const DtSimResourceManager &orig)
 assignment operator
bool operator!= (const DtSimResourceManager &orig) const
bool operator== (const DtSimResourceManager &orig) const
virtual ~DtSimResourceManager ()
 destructor
virtual DtSimResourcelookupResource (const DtString &resourceName)
virtual DtSimResourcelookupResource (const DtBaseHashKey &resourceName)
virtual const DtSimResourcelookupResource (const DtString &resourceName) const
virtual const DtSimResourcelookupResource (const DtBaseHashKey &resourceName) const
virtual DtSimResourceaddResource (DtSimResource *resource)
 This does a clone of the resource and puts it on our main list, as well as adding the resource to the hash index.
virtual bool removeResource (DtSimResource *resource)
 Finds the specified resource wherever it is located in the resource hierarchy, and removes and deletes it.
virtual DtSimResourceManagerclone (const DtString &name, DtReaderWriterRegistry *parentRegistry=NULL) const
virtual DtSimResourceManagerclone (const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=NULL) const
virtual void addToHashIndex (DtSimResource *resource)
 The following 2 functions are provided for use by the addChildResource/ removeChildResource calls in DtSimResource.
virtual void removeFromHashIndex (DtSimResource *resource)
 This removes the resource from the index. The resource is NOT deleted.
const DtList * resources () const
 Returns a list of the resource keys for this manager.

Protected Member Functions

 DtSimResourceManager ()
 default constructor
virtual void removeResource (DtSimResource *resource, DtListItem *item)
 This removes just from the main list, not the index.
virtual DtlObjPtr getData (DtlObjPtr args, const DtFilename &searchPath, const DtVariableBindingsList &variableBindings)
 This method must be overridden by a subclass.

Protected Attributes

DtHashlist myHashIndex

Detailed Description

class DtSimResourceManager:

Instances of DtSimResourceManager are readable/writable lists of DtSimResources. It provides hash table lookup for all of an entity's resources, including sub-resources. During initialization, resource capacity and starting values specified in any DtLocalEntityParameters are copied to the DtSimResourceManager. Subresources should NOT be placed on the resource manager explicitly. That is done automatically by DtSimResource's addChildResource (and vice versa for removeChildResource).


Constructor & Destructor Documentation

default constructor

DtSimResourceManager::DtSimResourceManager ( const DtString name,
DtReaderWriterRegistry parentRegistry = NULL 
)

real constructor

DtSimResourceManager::DtSimResourceManager ( const DtSymbolString name,
DtReaderWriterRegistry parentRegistry = NULL 
)
DtSimResourceManager::DtSimResourceManager ( const DtString name,
const DtSimResourceManager orig,
DtReaderWriterRegistry parentRegistry = NULL 
)

copy constructor

DtSimResourceManager::DtSimResourceManager ( const DtSymbolString name,
const DtSimResourceManager orig,
DtReaderWriterRegistry parentRegistry = NULL 
)

destructor


Member Function Documentation

DtSimResourceManager& DtSimResourceManager::operator= ( const DtSimResourceManager orig)

assignment operator

bool DtSimResourceManager::operator!= ( const DtSimResourceManager orig) const [inline]
bool DtSimResourceManager::operator== ( const DtSimResourceManager orig) const
virtual DtSimResource* DtSimResourceManager::lookupResource ( const DtString resourceName) [virtual]
virtual DtSimResource* DtSimResourceManager::lookupResource ( const DtBaseHashKey resourceName) [virtual]
virtual const DtSimResource* DtSimResourceManager::lookupResource ( const DtString resourceName) const [virtual]
virtual const DtSimResource* DtSimResourceManager::lookupResource ( const DtBaseHashKey resourceName) const [virtual]

This does a clone of the resource and puts it on our main list, as well as adding the resource to the hash index.

virtual bool DtSimResourceManager::removeResource ( DtSimResource resource) [virtual]

Finds the specified resource wherever it is located in the resource hierarchy, and removes and deletes it.

Returns:
True if resource was found and removed.
virtual DtSimResourceManager* DtSimResourceManager::clone ( const DtString name,
DtReaderWriterRegistry parentRegistry = NULL 
) const [virtual]
virtual DtSimResourceManager* DtSimResourceManager::clone ( const DtSymbolString name,
DtReaderWriterRegistry parentRegistry = NULL 
) const [virtual]
virtual void DtSimResourceManager::addToHashIndex ( DtSimResource resource) [virtual]

The following 2 functions are provided for use by the addChildResource/ removeChildResource calls in DtSimResource.

They may eventually become protected (with access to DtSimResource provided by friend functions.) This adds the resource to our hash index, but no cloning is done.

virtual void DtSimResourceManager::removeFromHashIndex ( DtSimResource resource) [virtual]

This removes the resource from the index. The resource is NOT deleted.

const DtList* DtSimResourceManager::resources ( ) const [inline]

Returns a list of the resource keys for this manager.

Can be used to iterate through the resources

virtual void DtSimResourceManager::removeResource ( DtSimResource resource,
DtListItem *  item 
) [protected, virtual]

This removes just from the main list, not the index.

virtual DtlObjPtr DtSimResourceManager::getData ( DtlObjPtr  args,
const DtFilename &  searchPath,
const DtVariableBindingsList variableBindings 
) [protected, virtual]

This method must be overridden by a subclass.

Within this method, new instances of the DtReaderWriter subclass that is being handled by this list must be created, and then retrieved from the mtl stream, using the getSelf member of that item.

Here is some sample code that could be used to implement a override of this class: (This is used in the DtRwIntegerList::getData() method)
 DtlObjPtr nameObj = DtcCar(args);
 DtRwInt* value = new DtRwInt(nameObj->pname());
 value->getSelf(args, searchPath, variableBindings);
 this->add(value);
 return DtcCdr(DtcCdr(args));

Implements DtRwList.


Member Data Documentation


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

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)