6#ifndef CUTELYSTMEMCACHED_H
7#define CUTELYSTMEMCACHED_H
9#include <Cutelyst/cutelyst_global.h>
10#include <Cutelyst/plugin.h>
13#include <QVersionNumber>
18class 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);
710 uint64_t *value =
nullptr,
734 uint64_t *value =
nullptr,
765 uint64_t *value =
nullptr,
802 uint64_t *value =
nullptr,
822 uint64_t *value =
nullptr,
846 uint64_t *value =
nullptr,
877 uint64_t *value =
nullptr,
914 uint64_t *value =
nullptr,
949 template <
typename T>
1001 template <
typename T>
1064 template <
typename T>
1114 template <
typename T>
1170template <
typename T>
1177#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
1186template <
typename T>
1194#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
1203template <
typename T>
1210#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
1219template <
typename T>
1227#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
1236template <
typename T>
1243#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
1252template <
typename T>
1260#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
1269template <
typename T>
1275#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
1285template <
typename T>
1294#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
1304template <
typename T>
1312#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
1321template <
typename T>
1330#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
1339template <
typename T>
1346 if (!_data.
empty()) {
1352 hash.
insert(i.key(), retVal);
1359template <
typename T>
1367 if (!_data.
empty()) {
1373 hash.
insert(i.key(), retVal);
The Cutelyst Application.
static bool replaceByKey(const QString &groupKey, const QString &key, const QByteArray &value, time_t expiration, MemcachedReturnType *returnType=nullptr)
static bool incrementByKey(const QString &groupKey, const QString &key, uint64_t offset, uint64_t *value=nullptr, MemcachedReturnType *returnType=nullptr)
static bool add(const QString &key, const QByteArray &value, time_t expiration, MemcachedReturnType *returnType=nullptr)
@ MemoryAllocationFailure
static QByteArray get(const QString &key, uint64_t *cas=nullptr, MemcachedReturnType *returnType=nullptr)
static bool casByKey(const QString &groupKey, const QString &key, const QByteArray &value, time_t expiration, uint64_t cas, MemcachedReturnType *returnType=nullptr)
static bool increment(const QString &key, uint32_t offset, uint64_t *value=nullptr, MemcachedReturnType *returnType=nullptr)
virtual bool setup(Application *app) override
static bool flush(time_t expiration, MemcachedReturnType *returnType=nullptr)
static bool decrementByKey(const QString &groupKey, const QString &key, uint64_t offset, uint64_t *value=nullptr, MemcachedReturnType *returnType=nullptr)
static bool incrementWithInitial(const QString &key, uint64_t offset, uint64_t initial, time_t expiration, uint64_t *value=nullptr, MemcachedReturnType *returnType=nullptr)
static bool cas(const QString &key, const QByteArray &value, time_t expiration, uint64_t cas, MemcachedReturnType *returnType=nullptr)
static bool touch(const QString &key, time_t expiration, MemcachedReturnType *returnType=nullptr)
static QHash< QString, QByteArray > mgetByKey(const QString &groupKey, const QStringList &keys, QHash< QString, uint64_t > *casValues=nullptr, MemcachedReturnType *returnType=nullptr)
static bool flushBuffers(MemcachedReturnType *returnType=nullptr)
static bool decrementWithInitialByKey(const QString &groupKey, const QString &key, uint64_t offset, uint64_t initial, time_t expiration, uint64_t *value=nullptr, MemcachedReturnType *returnType=nullptr)
static const time_t expirationNotAdd
static bool set(const QString &key, const QByteArray &value, time_t expiration, MemcachedReturnType *returnType=nullptr)
static bool incrementWithInitialByKey(const QString &groupKey, const QString &key, uint64_t offset, uint64_t initial, time_t expiration, uint64_t *value=nullptr, MemcachedReturnType *returnType=nullptr)
static bool decrement(const QString &key, uint32_t offset, uint64_t *value=nullptr, MemcachedReturnType *returnType=nullptr)
static QString errorString(Context *c, MemcachedReturnType rt)
static bool touchByKey(const QString &groupKey, const QString &key, time_t expiration, MemcachedReturnType *returnType=nullptr)
static bool decrementWithInitial(const QString &key, uint64_t offset, uint64_t initial, time_t expiration, uint64_t *value=nullptr, MemcachedReturnType *returnType=nullptr)
static bool setByKey(const QString &groupKey, const QString &key, const QByteArray &value, time_t expiration, MemcachedReturnType *returnType=nullptr)
static QHash< QString, QByteArray > mget(const QStringList &keys, QHash< QString, uint64_t > *casValues=nullptr, MemcachedReturnType *returnType=nullptr)
static bool replace(const QString &key, const QByteArray &value, time_t expiration, MemcachedReturnType *returnType=nullptr)
static bool addByKey(const QString &groupKey, const QString &key, const QByteArray &value, time_t expiration, MemcachedReturnType *returnType=nullptr)
static QByteArray getByKey(const QString &groupKey, const QString &key, uint64_t *cas=nullptr, MemcachedReturnType *returnType=nullptr)
Memcached(Application *parent)
static QVersionNumber libMemcachedVersion()
Returns the version of the currently used libmemcached.
Plugin(Application *parent)
The Cutelyst namespace holds all public Cutelyst API.
bool isEmpty() const const
const_iterator constBegin() const const
const_iterator constEnd() const const
iterator insert(const Key &key, const T &value)
QObject * parent() const const