resourcesuser.h
138 virtual void notifyResourceChange(ResourceHandler* resource, ResourceChangeType changeType) = 0;
286 // Now setting the resource. If this throws an exception we could have simply created a non-existing
287 // resource above that doesn't modify the external behaviour of this and other classes (so we can say
378 throw ResourceTypeMismatchException(m_notifiedResourceHandler->name().toLatin1().data(), typeid(T).name());
736 // Now we have to get the resource (creating it if necessary) and then acquire the lock on the resource
750 // Now setting the resource (the lock on the resource has been acquired here and will be released after
779 if ((m_lockAcquired == 0) && ((!m_beingNotified) || (m_notifiedResourceHandler->name() != name))) {
891 throw ResourceTypeMismatchException(m_notifiedResourceHandler->name().toLatin1().data(), typeid(T).name());
975 ResourcesMutexesLocker(ConcurrentResourcesUser *resourcesUser, const QList<ResourceHandler *>& resources) :
This file contains the common type defitions used on the whole framework.
A simple class to access/declare resources (not thread-safe)
Definition: resourcesuser.h:227
A class to access/declare resources in a thread-safe way.
Definition: resourcesuser.h:592
void declareResource(QString name, T *resource, QString lockBuddy="")
Declares the name for a resource.
Definition: resourcesuser.h:727
The exception thrown when requesting a resource that hasn't been declared as usable.
Definition: configurationexceptions.h:1373
The exception thrown when a resource has different type from requested type.
Definition: configurationexceptions.h:1475
void shareLockWith(ResourceHandler *other)
Shares the lock with the other resource.
Definition: resource.cpp:80
Definition: configurationhelper.cpp:24
T * getResource()
Returns a pointer to the resource whose change we have been notified of.
Definition: resourcesuser.h:875
ResourceCollectionHolder m_resources
The object holding the shared resources.
Definition: resourcesuser.h:143
The exception thrown when requesting a resource never declared.
Definition: configurationexceptions.h:1268
Resource is a class representing a generic resource addable into ResourceCollection.
Definition: resource.h:56
T * getResource()
Returns a pointer to the resource whose change we have been notified of.
Definition: resourcesuser.h:366
The exception thrown when an operation is performed on a ConcurrentResourcesUser object but the lock ...
Definition: configurationexceptions.h:1733
void declareResource(QString name, T *resource)
Declares the name for a resource.
Definition: resourcesuser.h:281
Resource::ResourceChangeType ResourceChangeType
The change that happened to a resource.
Definition: resourcesuser.h:78
T * getResource(QString name, bool *resourceExists=NULL)
Returns a pointer to the resource declared with the specified name.
Definition: resourcesuser.h:777
The class to use to acquire the lock on resources.
Definition: resourcesuser.h:1098
bool hasResource(QString name) const
Returns true if a resource with name specified has been declared.
Definition: resourcesuser.h:334
T * getResource(QString name)
Returns a pointer to the resource declared with the specified name.
Definition: resourcesuser.h:302
This keeps an instance of ResourceCollection eventually sharing it.
Definition: resource.h:612