TalanSoft Toolkits  201707
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Member Functions | List of all members
iDeviceResourceManager Struct Referenceabstract
Inheritance diagram for iDeviceResourceManager:
iUnknown

Detailed Description

Device resource manager interface.

Remarks
When the inteface is released it invalidates all the device resources contained.

Public Member Functions

virtual iHStringGetType () const =0
 Resource type. {Property}. More...
 
virtual void Clear ()=0
 Clear the resource manager and invalidate all resources. More...
 
virtual tU32 GetSize () const =0
 Get the number of resources in the manager. {Property}. More...
 
virtual iDeviceResourceGetFromName (iHString *ahspName) const =0
 Get a resource in the manager. {Property}. More...
 
virtual iDeviceResourceGetFromIndex (tU32 anIndex) const =0
 Get the resource at the specified index. {Property}. More...
 
virtual tBool Register (iDeviceResource *apRes)=0
 Register a resource in the manager. More...
 
virtual tBool Unregister (iDeviceResource *apRes)=0
 Unregister a resource in the manager. More...
 
- Public Member Functions inherited from iUnknown
virtual tBool IsOK () const =0
 Check if the object is valid. More...
 
virtual tI32 AddRef ()=0
 Signal that one more reference of the object has been created. More...
 
virtual tI32 Release ()=0
 Release a reference of the object. More...
 
virtual void DeleteThis ()=0
 Bypass any reference counting and delete this object. More...
 
virtual void Invalidate ()=0
 Invalidate the object. More...
 
virtual iUnknownQueryInterface (const tUUID &aIID)=0
 Query an interface. More...
 
virtual void ListInterfaces (iMutableCollection *apLst, tU32 anFlags) const =0
 Fill a UUID list containing the UUIDs of the implemented interfaces. More...
 
virtual tI32 SetNumRefs (tI32 anNumRefs)=0
 Set the reference counter directly. More...
 
virtual tI32 GetNumRefs () const =0
 Get the number of references to this object. More...
 

Member Function Documentation

virtual iHString* GetType ( ) const
pure virtual

Resource type. {Property}.

virtual void Clear ( )
pure virtual

Clear the resource manager and invalidate all resources.

virtual tU32 GetSize ( ) const
pure virtual

Get the number of resources in the manager. {Property}.

virtual iDeviceResource* GetFromName ( iHString ahspName) const
pure virtual

Get a resource in the manager. {Property}.

virtual iDeviceResource* GetFromIndex ( tU32  anIndex) const
pure virtual

Get the resource at the specified index. {Property}.

virtual tBool Register ( iDeviceResource apRes)
pure virtual

Register a resource in the manager.

virtual tBool Unregister ( iDeviceResource apRes)
pure virtual

Unregister a resource in the manager.

Remarks
When you unregister a resource in an Invalidate method or destructor you need to prevent against double unregistrations which would lead to problems in unexpected places down the line. Two ways to do so are to set the device resource's name to null once unregistered, or better yet, to make sure that Unregister is never called twice even if the Invalidate method or destructor are called more than once. Note that just setting the device resource's name to null will still require the device resource manager to lookup the resource by pointer which is inefficient.