6 #ifndef CUTELYSTMEMCACHED_H 7 #define CUTELYSTMEMCACHED_H 9 #include <Cutelyst/cutelyst_global.h> 10 #include <Cutelyst/plugin.h> 12 #include <QDataStream> 13 #include <QVersionNumber> 18 class MemcachedPrivate;
226 ServerTemporaryDisabled,
227 ServerMemoryAllocationFailure,
232 Q_ENUM(MemcachedReturnType)
238 void setDefaultConfig(
const QVariantMap &defaultConfig);
252 static bool set(
const QString &key,
255 MemcachedReturnType *returnType =
nullptr);
271 template <
typename T>
272 static bool set(
const QString &key,
275 MemcachedReturnType *returnType =
nullptr);
293 static bool setByKey(
const QString &groupKey,
297 MemcachedReturnType *returnType =
nullptr);
316 template <
typename T>
317 static bool setByKey(
const QString &groupKey,
321 MemcachedReturnType *returnType =
nullptr);
338 static bool add(
const QString &key,
341 MemcachedReturnType *returnType =
nullptr);
361 template <
typename T>
362 static bool add(
const QString &key,
365 MemcachedReturnType *returnType =
nullptr);
386 static bool addByKey(
const QString &groupKey,
390 MemcachedReturnType *returnType =
nullptr);
413 template <
typename T>
414 static bool addByKey(
const QString &groupKey,
418 MemcachedReturnType *returnType =
nullptr);
435 static bool replace(
const QString &key,
438 MemcachedReturnType *returnType =
nullptr);
457 template <
typename T>
458 static bool replace(
const QString &key,
461 MemcachedReturnType *returnType =
nullptr);
482 static bool replaceByKey(
const QString &groupKey,
486 MemcachedReturnType *returnType =
nullptr);
509 template <
typename T>
510 static bool replaceByKey(
const QString &groupKey,
514 MemcachedReturnType *returnType =
nullptr);
534 get(
const QString &key, uint64_t *cas =
nullptr, MemcachedReturnType *returnType =
nullptr);
566 template <
typename T>
568 get(
const QString &key, uint64_t *cas =
nullptr, MemcachedReturnType *returnType =
nullptr);
592 uint64_t *cas =
nullptr,
593 MemcachedReturnType *returnType =
nullptr);
630 template <
typename T>
631 static T getByKey(
const QString &groupKey,
633 uint64_t *cas =
nullptr,
634 MemcachedReturnType *returnType =
nullptr);
644 static bool remove(
const QString &key, MemcachedReturnType *returnType =
nullptr);
658 static bool removeByKey(
const QString &groupKey,
660 MemcachedReturnType *returnType =
nullptr);
669 static bool exist(
const QString &key, MemcachedReturnType *returnType =
nullptr);
682 static bool existByKey(
const QString &groupKey,
684 MemcachedReturnType *returnType =
nullptr);
708 static bool increment(
const QString &key,
710 uint64_t *value =
nullptr,
731 static bool incrementByKey(
const QString &groupKey,
734 uint64_t *value =
nullptr,
761 static bool incrementWithInitial(
const QString &key,
765 uint64_t *value =
nullptr,
797 static bool incrementWithInitialByKey(
const QString &groupKey,
802 uint64_t *value =
nullptr,
820 static bool decrement(
const QString &key,
822 uint64_t *value =
nullptr,
843 static bool decrementByKey(
const QString &groupKey,
846 uint64_t *value =
nullptr,
873 static bool decrementWithInitial(
const QString &key,
877 uint64_t *value =
nullptr,
909 static bool decrementWithInitialByKey(
const QString &groupKey,
914 uint64_t *value =
nullptr,
929 static bool cas(
const QString &key,
949 template <
typename T>
950 static bool cas(
const QString &key,
974 static bool casByKey(
const QString &groupKey,
1001 template <
typename T>
1002 static bool casByKey(
const QString &groupKey,
1064 template <
typename T>
1114 template <
typename T>
1146 static bool touchByKey(
const QString &groupKey,
1170 template <
typename T>
1177 #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) 1186 template <
typename T>
1194 #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) 1203 template <
typename T>
1210 #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) 1219 template <
typename T>
1227 #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) 1236 template <
typename T>
1243 #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) 1252 template <
typename T>
1260 #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) 1269 template <
typename T>
1275 #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) 1285 template <
typename T>
1294 #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) 1304 template <
typename T>
1312 #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) 1321 template <
typename T>
1330 #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) 1339 template <
typename T>
1346 if (!_data.
empty()) {
1352 hash.
insert(i.key(), retVal);
1359 template <
typename T>
1367 if (!_data.
empty()) {
1373 hash.
insert(i.key(), retVal);
1382 #endif // CUTELYSTMEMCACHED_H
static bool addByKey(const QString &groupKey, const QString &key, const QByteArray &value, time_t expiration, MemcachedReturnType *returnType=nullptr)
static bool replace(const QString &key, const QByteArray &value, time_t expiration, MemcachedReturnType *returnType=nullptr)
iterator insert(const Key &key, const T &value)
static bool replaceByKey(const QString &groupKey, const QString &key, const QByteArray &value, time_t expiration, MemcachedReturnType *returnType=nullptr)
static bool casByKey(const QString &groupKey, const QString &key, const QByteArray &value, time_t expiration, uint64_t cas, MemcachedReturnType *returnType=nullptr)
bool isEmpty() const const
static QHash< QString, QByteArray > mgetByKey(const QString &groupKey, const QStringList &keys, QHash< QString, uint64_t > *casValues=nullptr, MemcachedReturnType *returnType=nullptr)
static const time_t expirationNotAdd
static QByteArray get(const QString &key, uint64_t *cas=nullptr, MemcachedReturnType *returnType=nullptr)
static QHash< QString, QByteArray > mget(const QStringList &keys, QHash< QString, uint64_t > *casValues=nullptr, MemcachedReturnType *returnType=nullptr)
const_iterator constEnd() const const
The Cutelyst namespace holds all public Cutelyst API.
static bool setByKey(const QString &groupKey, const QString &key, const QByteArray &value, time_t expiration, MemcachedReturnType *returnType=nullptr)
const_iterator constBegin() const const
static bool cas(const QString &key, const QByteArray &value, time_t expiration, uint64_t cas, MemcachedReturnType *returnType=nullptr)
The Cutelyst Application.
static QByteArray getByKey(const QString &groupKey, const QString &key, uint64_t *cas=nullptr, MemcachedReturnType *returnType=nullptr)
Cutelyst Memcached plugin.
static bool add(const QString &key, const QByteArray &value, time_t expiration, MemcachedReturnType *returnType=nullptr)
static bool set(const QString &key, const QByteArray &value, time_t expiration, MemcachedReturnType *returnType=nullptr)