ResourceCollectionHolder Class Reference

This keeps an instance of ResourceCollection eventually sharing it. More...

Public Member Functions

 ResourceCollectionHolder ()
 Constructor.
 
 ResourceCollectionHolder (const ResourceCollectionHolder &other) throw ()
 Copy constructor.
 
 ~ResourceCollectionHolder () throw ()
 Destructor.
 
ResourceCollectionoperator* () const throw ()
 Overload of the dereference operator.
 
ResourceCollectionoperator-> () const throw ()
 Overload of the dereference operator (->)
 
ResourceCollectionHolderoperator= (const ResourceCollectionHolder &other) throw ()
 Copy operator.
 
bool operator== (const ResourceCollectionHolder &other) const throw ()
 Comparison operator.
 
void setUseLock (bool useLock) throw ()
 Sets whether locks should be used or not.
 

Detailed Description

This keeps an instance of ResourceCollection eventually sharing it.

This class is used to share an instance of ResourceCollection among different objects. This also destroys the instance if no one is referring it. Locks are acquired ony if m_useLocks is true (by default it is false, use setUseLock() to change it). setUseLock() is NOT thread-safe!

Definition at line 612 of file resource.h.

Constructor & Destructor Documentation

Constructor.

Definition at line 203 of file resource.cpp.

Copy constructor.

Copies of ResourceCollectionHolder share the same internal ResourceCollection object. m_useLocks is NOT copied

Parameters
otherthe object to copy

Definition at line 213 of file resource.cpp.

~ResourceCollectionHolder ( ) throw ()

Destructor.

Definition at line 265 of file resource.cpp.

References ResourceCollection::decrementReferenceCounter(), and ResourceCollection::getLock().

Member Function Documentation

ResourceCollection& operator* ( ) const throw ()
inline

Overload of the dereference operator.

Returns
the instance of the the resource collection

Definition at line 673 of file resource.h.

ResourceCollection* operator-> ( ) const throw ()
inline

Overload of the dereference operator (->)

Returns
the pointer (the language then knows that that pointer should be dereferenced)

Definition at line 684 of file resource.h.

ResourceCollectionHolder & operator= ( const ResourceCollectionHolder other) throw ()

Copy operator.

Copies of ResourceCollectionHolder share the same internal ResourceCollection object.

Parameters
otherthe object to copy
Note
m_useLocks is NOT copied

Definition at line 229 of file resource.cpp.

References ResourceCollection::getLock().

bool operator== ( const ResourceCollectionHolder other) const throw ()
inline

Comparison operator.

Two instances of this class are equal if they refer to the same ResourceCollection object

Parameters
otherthe object to compare with us
Returns
true if this instance is equal to other

Definition at line 663 of file resource.h.

void setUseLock ( bool  useLock) throw ()
inline

Sets whether locks should be used or not.

Parameters
useLockif true locks are acquired and released when needed
Note
this function is NOT thread-safe!

Definition at line 650 of file resource.h.

Referenced by ConcurrentResourcesUser::ConcurrentResourcesUser(), and ConcurrentResourcesUser::shareResourcesWith().


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