Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | List of all members
om::resources::ResourceTypeSet< DataType > Class Template Reference

The base class for a set of resources of a templated type. More...

#include <omResourceTypeSet.h>

Inheritance diagram for om::resources::ResourceTypeSet< DataType >:
om::resources::ResourceTypeSetBase

Public Member Functions

 ResourceTypeSet ()
 Create a new resource set that is empty and has no resources. More...
 
virtual ResourceTypeSet< DataType > * copy () const
 Create and return a copy of the concrete type of this resource set. More...
 
virtual const ResourceTypegetResourceType () const
 Return a reference to the resource type for this resource set. More...
 
virtual Size getResourceCount () const
 Return the number of resources that this resource set stores. More...
 
Resource< DataType > * getResource (ResourceLocalID localID)
 Return a pointer to the resource in this resource set at the given local ID (index). More...
 
const Resource< DataType > * getResource (ResourceLocalID localID) const
 Return a pointer to the resource in this resource set at the given local ID (index). More...
 
virtual OpaqueResource getOpaqueResource (ResourceLocalID localID) const
 Return an opaque resource with the specified local ID. More...
 
virtual void * getResourceData (ResourceLocalID localID) const
 Return an opaque pointer to the resource object data for the given local ID (index). More...
 
Resource< DataType > * getResource (const data::UTF8String &name)
 Return a pointer to the resource in this resource set with the given name. More...
 
const Resource< DataType > * getResource (const data::UTF8String &name) const
 Return a pointer to the resource in this resource set with the given name. More...
 
Resource< DataType > * getResource (const ResourceID &identifier)
 Return a pointer to the resource in this resource set with the given identifier. More...
 
const Resource< DataType > * getResource (const ResourceID &identifier) const
 Find the resource in this resource set with the given identifier. More...
 
virtual const ResourceIDgetResourceID (const void *resourceData) const
 Return a pointer to the ID for the resource with the given raw data pointer. More...
 
virtual Bool getResourceLocalID (const void *resourceData, ResourceLocalID &localID) const
 Get the local ID (e.g. index) for the resource with the given raw data pointer in the output parameter. More...
 
virtual void copyResources (ResourceSet &resourceSet) const
 Add all of the resources of this type to the specified resource set. More...
 
Resource< DataType > * getResources ()
 Return a pointer to the internal array of resources that this resource set stores. More...
 
const Resource< DataType > * getResources () const
 Return a const pointer to the internal array of resources that this resource set stores. More...
 
Bool addResource (const Resource< DataType > &resource)
 Add a new resource to this resource set. More...
 
Bool removeResource (const DataType *resource)
 Remove a resource with a specific pointer from this resource set. More...
 
Bool removeResource (const Resource< DataType > &resource)
 Remove a specific resource from this resource set. More...
 
Bool removeResource (const data::UTF8String &name)
 Remove an resource with the given name from this resource set. More...
 
virtual Bool removeResource (const void *resourceData)
 Remove the specified resource from this resource type set. More...
 
virtual void clearResources ()
 Remove all resources from this resource set. More...
 
- Public Member Functions inherited from om::resources::ResourceTypeSetBase
virtual ~ResourceTypeSetBase ()
 Destroy this base resource set. More...
 

Detailed Description

template<typename DataType>
class om::resources::ResourceTypeSet< DataType >

The base class for a set of resources of a templated type.

Constructor & Destructor Documentation

template<typename DataType >
om::resources::ResourceTypeSet< DataType >::ResourceTypeSet ( )
inline

Create a new resource set that is empty and has no resources.

Member Function Documentation

template<typename DataType >
virtual ResourceTypeSet<DataType>* om::resources::ResourceTypeSet< DataType >::copy ( ) const
inlinevirtual

Create and return a copy of the concrete type of this resource set.

This enables copies of an resource set to be made without knowing its concrete type. The caller is responsible for destructing the new resource set.

Implements om::resources::ResourceTypeSetBase.

template<typename DataType >
virtual const ResourceType& om::resources::ResourceTypeSet< DataType >::getResourceType ( ) const
inlinevirtual

Return a reference to the resource type for this resource set.

Implements om::resources::ResourceTypeSetBase.

template<typename DataType >
virtual Size om::resources::ResourceTypeSet< DataType >::getResourceCount ( ) const
inlinevirtual

Return the number of resources that this resource set stores.

Implements om::resources::ResourceTypeSetBase.

template<typename DataType >
Resource<DataType>* om::resources::ResourceTypeSet< DataType >::getResource ( ResourceLocalID  localID)
inline

Return a pointer to the resource in this resource set at the given local ID (index).

template<typename DataType >
const Resource<DataType>* om::resources::ResourceTypeSet< DataType >::getResource ( ResourceLocalID  localID) const
inline

Return a pointer to the resource in this resource set at the given local ID (index).

template<typename DataType >
virtual OpaqueResource om::resources::ResourceTypeSet< DataType >::getOpaqueResource ( ResourceLocalID  localID) const
inlinevirtual

Return an opaque resource with the specified local ID.

Implements om::resources::ResourceTypeSetBase.

template<typename DataType >
virtual void* om::resources::ResourceTypeSet< DataType >::getResourceData ( ResourceLocalID  localID) const
inlinevirtual

Return an opaque pointer to the resource object data for the given local ID (index).

Implements om::resources::ResourceTypeSetBase.

template<typename DataType >
Resource<DataType>* om::resources::ResourceTypeSet< DataType >::getResource ( const data::UTF8String name)
inline

Return a pointer to the resource in this resource set with the given name.

The method returns a NULL pointer if there is no resource with that name.

template<typename DataType >
const Resource<DataType>* om::resources::ResourceTypeSet< DataType >::getResource ( const data::UTF8String name) const
inline

Return a pointer to the resource in this resource set with the given name.

The method returns a NULL pointer if there is no resource with that name.

template<typename DataType >
Resource<DataType>* om::resources::ResourceTypeSet< DataType >::getResource ( const ResourceID identifier)
inline

Return a pointer to the resource in this resource set with the given identifier.

The method returns a NULL pointer if there is no resource with that ID.

template<typename DataType >
const Resource<DataType>* om::resources::ResourceTypeSet< DataType >::getResource ( const ResourceID identifier) const
inline

Find the resource in this resource set with the given identifier.

The method returns a NULL pointer if there is no resource with that ID.

template<typename DataType >
virtual const ResourceID* om::resources::ResourceTypeSet< DataType >::getResourceID ( const void *  resourceData) const
inlinevirtual

Return a pointer to the ID for the resource with the given raw data pointer.

If the resource set does not contain the given resource, the method fails and NULL is returned.

Implements om::resources::ResourceTypeSetBase.

template<typename DataType >
virtual Bool om::resources::ResourceTypeSet< DataType >::getResourceLocalID ( const void *  resourceData,
ResourceLocalID localID 
) const
inlinevirtual

Get the local ID (e.g. index) for the resource with the given raw data pointer in the output parameter.

If the resource set does not contain the given resource, the method fails and FALSE is returned.

Implements om::resources::ResourceTypeSetBase.

template<typename DataType >
void om::resources::ResourceTypeSet< DataType >::copyResources ( ResourceSet resourceSet) const
virtual

Add all of the resources of this type to the specified resource set.

Implements om::resources::ResourceTypeSetBase.

template<typename DataType >
Resource<DataType>* om::resources::ResourceTypeSet< DataType >::getResources ( )
inline

Return a pointer to the internal array of resources that this resource set stores.

template<typename DataType >
const Resource<DataType>* om::resources::ResourceTypeSet< DataType >::getResources ( ) const
inline

Return a const pointer to the internal array of resources that this resource set stores.

template<typename DataType >
Bool om::resources::ResourceTypeSet< DataType >::addResource ( const Resource< DataType > &  resource)
inline

Add a new resource to this resource set.

The method returns whether or not the resource was able to be added.

template<typename DataType >
Bool om::resources::ResourceTypeSet< DataType >::removeResource ( const DataType *  resource)
inline

Remove a resource with a specific pointer from this resource set.

The method returns whether or not the resource was successfully removed.

template<typename DataType >
Bool om::resources::ResourceTypeSet< DataType >::removeResource ( const Resource< DataType > &  resource)
inline

Remove a specific resource from this resource set.

The method returns whether or not the resource was successfully removed.

template<typename DataType >
Bool om::resources::ResourceTypeSet< DataType >::removeResource ( const data::UTF8String name)
inline

Remove an resource with the given name from this resource set.

The method returns whether or not the resource was successfully removed.

template<typename DataType >
virtual Bool om::resources::ResourceTypeSet< DataType >::removeResource ( const void *  resourceData)
inlinevirtual

Remove the specified resource from this resource type set.

The method returns whether or not the resource was successfully removed.

Implements om::resources::ResourceTypeSetBase.

template<typename DataType >
virtual void om::resources::ResourceTypeSet< DataType >::clearResources ( )
inlinevirtual

Remove all resources from this resource set.

Implements om::resources::ResourceTypeSetBase.


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