diff options
Diffstat (limited to 'common/resourceaccess.h')
-rw-r--r-- | common/resourceaccess.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/common/resourceaccess.h b/common/resourceaccess.h index 4c10adb..3b03210 100644 --- a/common/resourceaccess.h +++ b/common/resourceaccess.h | |||
@@ -111,4 +111,20 @@ private: | |||
111 | Private * const d; | 111 | Private * const d; |
112 | }; | 112 | }; |
113 | 113 | ||
114 | /** | ||
115 | * A factory for resource access instances that caches the instance for some time. | ||
116 | * | ||
117 | * This avoids constantly recreating connections, and should allow a single process to have one connection per resource. | ||
118 | */ | ||
119 | class ResourceAccessFactory { | ||
120 | public: | ||
121 | static ResourceAccessFactory &instance(); | ||
122 | Sink::ResourceAccess::Ptr getAccess(const QByteArray &instanceIdentifier); | ||
123 | |||
124 | QHash<QByteArray, QWeakPointer<Sink::ResourceAccess> > mWeakCache; | ||
125 | QHash<QByteArray, Sink::ResourceAccess::Ptr> mCache; | ||
126 | QHash<QByteArray, QTimer*> mTimer; | ||
127 | }; | ||
128 | |||
129 | |||
114 | } | 130 | } |