This keeps an instance of ResourceCollection eventually sharing it. More...
Public Member Functions | |
ResourceCollectionHolder () | |
Constructor. More... | |
ResourceCollectionHolder (const ResourceCollectionHolder &other) throw () | |
Copy constructor. More... | |
~ResourceCollectionHolder () throw () | |
Destructor. More... | |
ResourceCollection & | operator* () const throw () |
Overload of the dereference operator. More... | |
ResourceCollection * | operator-> () const throw () |
Overload of the dereference operator (->) More... | |
ResourceCollectionHolder & | operator= (const ResourceCollectionHolder &other) throw () |
Copy operator. More... | |
bool | operator== (const ResourceCollectionHolder &other) const throw () |
Comparison operator. More... | |
void | setUseLock (bool useLock) throw () |
Sets whether locks should be used or not. More... | |
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.
ResourceCollectionHolder | ( | const ResourceCollectionHolder & | other | ) | |
throw | ( | ||||
) |
Copy constructor.
Copies of ResourceCollectionHolder share the same internal ResourceCollection object. m_useLocks is NOT copied
- Parameters
-
other the 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
|
inline |
Overload of the dereference operator.
- Returns
- the instance of the the resource collection
Definition at line 673 of file resource.h.
|
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
-
other the object to copy
- Note
- m_useLocks is NOT copied
Definition at line 229 of file resource.cpp.
References ResourceCollection::getLock().
|
inline |
Comparison operator.
Two instances of this class are equal if they refer to the same ResourceCollection object
- Parameters
-
other the object to compare with us
- Returns
- true if this instance is equal to other
Definition at line 663 of file resource.h.
|
inline |
Sets whether locks should be used or not.
- Parameters
-
useLock if 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:
- configuration/include/resource.h
- configuration/src/resource.cpp