ResourceCollection Class Reference

The class keeping the resources. More...

Public Member Functions

 ResourceCollection ()
 Constructor. More...
 
 ~ResourceCollection ()
 Destructor. More...
 
int decrementReferenceCounter () throw ()
 Decrements the reference counter. More...
 
QMutex & getLock ()
 Returns the global resource lock for this instance. More...
 
int getReferenceCounter () throw ()
 Returns the current value of the reference counter. More...
 
ResourceHandlergetResource (QString name, bool create=false)
 Returns a pointer to the resource handler for the resource with the specified name. More...
 
QWaitCondition & getWaitCondition ()
 Returns the wait condition on the global resource lock. More...
 
bool hasResource (QString name) const
 Returns true if a resource with name specified has been declared. More...
 
int incrementReferenceCounter () throw ()
 Increments the reference counter. More...
 

Detailed Description

The class keeping the resources.

This is used internally by ResourcesUser subclasses and shared among different instances. The lock is not acquired by any function, so you have to acquire it externally

Definition at line 473 of file resource.h.

Constructor & Destructor Documentation

Constructor.

Definition at line 170 of file resource.cpp.

Destructor.

Definition at line 177 of file resource.cpp.

Member Function Documentation

int decrementReferenceCounter ( )
throw (
)
inline

Decrements the reference counter.

Returns
the new value of the reference counter

Definition at line 521 of file resource.h.

Referenced by ResourceCollectionHolder::~ResourceCollectionHolder().

int getReferenceCounter ( )
throw (
)
inline

Returns the current value of the reference counter.

Returns
the value of the reference counter

Definition at line 531 of file resource.h.

ResourceHandler * getResource ( QString  name,
bool  create = false 
)

Returns a pointer to the resource handler for the resource with the specified name.

Parameters
namethe name of the resource
createif true an non-existing ResourceHandler object is created if no resource with the given name exists
Returns
the pointer to the resource handler or NULL if no resource with the given name exists and create is false

Definition at line 185 of file resource.cpp.

Referenced by ConcurrentResourcesUser::addUsableResource(), ConcurrentResourcesUser::addUsableResources(), SimpleResourcesUser::deleteResource(), ConcurrentResourcesUser::deleteResource(), ConcurrentResourcesUser::removeUsableResource(), ConcurrentResourcesUser::removeUsableResources(), ConcurrentResourcesUser::shareResourcesWith(), and ConcurrentResourcesUser::usableResources().

QWaitCondition& getWaitCondition ( )
inline

Returns the wait condition on the global resource lock.

Returns
the wait condition on the global resource lock

Definition at line 501 of file resource.h.

bool hasResource ( QString  name) const
inline

Returns true if a resource with name specified has been declared.

Parameters
namethe name of the resource
Returns
true if the resource exists; false otherwise

Definition at line 555 of file resource.h.

Referenced by ConcurrentResourcesUser::hasResource().

int incrementReferenceCounter ( )
throw (
)
inline

Increments the reference counter.

Returns
the new value of the reference counter

Definition at line 511 of file resource.h.


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