7#include <Cutelyst/cutelyst_global.h>
8#include <Cutelyst/plugin.h>
12#include <QVersionNumber>
17class MemcachedPrivate;
216 MemoryAllocationFailure,
248 ServerTemporaryDisabled,
249 ServerMemoryAllocationFailure,
260 void setDefaultConfig(
const QVariantMap &defaultConfig);
277 ReturnType *returnType =
nullptr);
285 std::chrono::seconds expiration,
286 ReturnType *returnType =
nullptr);
302 template <
typename T>
306 ReturnType *returnType =
nullptr);
312 template <
typename T>
315 std::chrono::seconds expiration,
316 ReturnType *returnType =
nullptr);
338 ReturnType *returnType =
nullptr);
347 std::chrono::seconds expiration,
348 ReturnType *returnType =
nullptr);
367 template <
typename T>
372 ReturnType *returnType =
nullptr);
378 template <
typename T>
382 std::chrono::seconds expiration,
383 ReturnType *returnType =
nullptr);
403 ReturnType *returnType =
nullptr);
411 std::chrono::seconds expiration,
412 ReturnType *returnType =
nullptr);
432 template <
typename T>
436 ReturnType *returnType =
nullptr);
442 template <
typename T>
445 std::chrono::seconds expiration,
446 ReturnType *returnType =
nullptr);
471 ReturnType *returnType =
nullptr);
480 std::chrono::seconds expiration,
481 ReturnType *returnType =
nullptr);
504 template <
typename T>
509 ReturnType *returnType =
nullptr);
515 template <
typename T>
519 std::chrono::seconds expiration,
520 ReturnType *returnType =
nullptr);
540 ReturnType *returnType =
nullptr);
548 std::chrono::seconds expiration,
549 ReturnType *returnType =
nullptr);
568 template <
typename T>
572 ReturnType *returnType =
nullptr);
578 template <
typename T>
581 std::chrono::seconds expiration,
582 ReturnType *returnType =
nullptr);
607 ReturnType *returnType =
nullptr);
616 std::chrono::seconds expiration,
617 ReturnType *returnType =
nullptr);
640 template <
typename T>
645 ReturnType *returnType =
nullptr);
651 template <
typename T>
655 std::chrono::seconds expiration,
656 ReturnType *returnType =
nullptr);
676 get(
QByteArrayView key, uint64_t *cas =
nullptr, ReturnType *returnType =
nullptr);
708 template <
typename T>
709 static T get(
QByteArrayView key, uint64_t *cas =
nullptr, ReturnType *returnType =
nullptr);
733 uint64_t *cas =
nullptr,
734 ReturnType *returnType =
nullptr);
771 template <
typename T>
774 uint64_t *cas =
nullptr,
775 ReturnType *returnType =
nullptr);
785 static bool remove(
QByteArrayView key, ReturnType *returnType =
nullptr);
809 static bool exist(
QByteArrayView key, ReturnType *returnType =
nullptr);
858 uint64_t *value =
nullptr,
882 uint64_t *value =
nullptr,
913 uint64_t *value =
nullptr,
923 std::chrono::seconds expiration,
924 uint64_t *value =
nullptr,
961 uint64_t *value =
nullptr,
968 inline static bool incrementWithInitialByKey(
QByteArrayView groupKey,
972 std::chrono::seconds expiration,
973 uint64_t *value =
nullptr,
993 uint64_t *value =
nullptr,
1017 uint64_t *value =
nullptr,
1048 uint64_t *value =
nullptr,
1058 std::chrono::seconds expiration,
1059 uint64_t *value =
nullptr,
1096 uint64_t *value =
nullptr,
1103 inline static bool decrementWithInitialByKey(
QByteArrayView groupKey,
1107 std::chrono::seconds expiration,
1108 uint64_t *value =
nullptr,
1135 std::chrono::seconds expiration,
1153 template <
typename T>
1164 template <
typename T>
1167 std::chrono::seconds expiration,
1203 std::chrono::seconds expiration,
1227 template <
typename T>
1239 template <
typename T>
1243 std::chrono::seconds expiration,
1255 static bool flushBuffers(
ReturnType *returnType =
nullptr);
1268 static bool flush(time_t expiration,
ReturnType *returnType =
nullptr);
1274 inline static bool flush(std::chrono::seconds expiration,
ReturnType *returnType =
nullptr);
1308 template <
typename T>
1358 template <
typename T>
1380 std::chrono::seconds expiration,
1408 std::chrono::seconds expiration,
1428 const std::unique_ptr<MemcachedPrivate> d_ptr;
1433 std::chrono::seconds expiration,
1436 return Memcached::set(key, value, expiration.count(), returnType);
1439template <
typename T>
1448template <
typename T>
1451 std::chrono::seconds expiration,
1454 return Memcached::set<T>(key, value, expiration.count(), returnType);
1460 std::chrono::seconds expiration,
1466template <
typename T>
1479template <
typename T>
1483 std::chrono::seconds expiration,
1486 return Memcached::setByKey<T>(groupKey, key, value, expiration.count(), returnType);
1491 std::chrono::seconds expiration,
1494 return Memcached::add(key, value, expiration.count(), returnType);
1497template <
typename T>
1506template <
typename T>
1509 std::chrono::seconds expiration,
1512 return Memcached::add<T>(key, value, expiration.count(), returnType);
1518 std::chrono::seconds expiration,
1524template <
typename T>
1537template <
typename T>
1541 std::chrono::seconds expiration,
1544 return Memcached::addByKey<T>(groupKey, key, value, expiration.count(), returnType);
1549 std::chrono::seconds expiration,
1555template <
typename T>
1567template <
typename T>
1570 std::chrono::seconds expiration,
1573 return Memcached::replace<T>(key, value, expiration.count(), returnType);
1579 std::chrono::seconds expiration,
1585template <
typename T>
1598template <
typename T>
1602 std::chrono::seconds expiration,
1605 return Memcached::replaceByKey<T>(groupKey, key, value, expiration.count(), returnType);
1611 std::chrono::seconds expiration,
1616 key, offset, initial, expiration.
count(), value, returnType);
1623 std::chrono::seconds expiration,
1628 groupKey, key, offset, initial, expiration.
count(), value, returnType);
1634 std::chrono::seconds expiration,
1639 key, offset, initial, expiration.
count(), value, returnType);
1646 std::chrono::seconds expiration,
1651 groupKey, key, offset, initial, expiration.
count(), value, returnType);
1654template <
typename T>
1666template <
typename T>
1683 std::chrono::seconds expiration,
1690template <
typename T>
1703template <
typename T>
1706 std::chrono::seconds expiration,
1710 return Memcached::cas<T>(key, value, expiration.count(),
cas, returnType);
1716 std::chrono::seconds expiration,
1723template <
typename T>
1737template <
typename T>
1741 std::chrono::seconds expiration,
1745 return Memcached::casByKey<T>(groupKey, key, value, expiration.count(),
cas, returnType);
1753template <
typename T>
1760 if (!_data.
empty()) {
1766 hash.
insert(i.key(), retVal);
1773template <
typename T>
1782 if (!_data.
empty()) {
1788 hash.
insert(i.key(), retVal);
1803 std::chrono::seconds expiration,
The Cutelyst application.
Cutelyst Memcached plugin.
static bool touch(QByteArrayView key, time_t expiration, ReturnType *returnType=nullptr)
static bool flush(time_t expiration, ReturnType *returnType=nullptr)
static bool touchByKey(QByteArrayView groupKey, QByteArrayView key, time_t expiration, ReturnType *returnType=nullptr)
static const std::chrono::seconds expirationNotAddDuration
static bool decrementWithInitial(QByteArrayView key, uint64_t offset, uint64_t initial, time_t expiration, uint64_t *value=nullptr, ReturnType *returnType=nullptr)
static bool incrementWithInitial(QByteArrayView key, uint64_t offset, uint64_t initial, time_t expiration, uint64_t *value=nullptr, ReturnType *returnType=nullptr)
static QHash< QByteArray, QByteArray > mgetByKey(QByteArrayView groupKey, const QByteArrayList &keys, QHash< QByteArray, uint64_t > *casValues=nullptr, ReturnType *returnType=nullptr)
static bool cas(QByteArrayView key, const QByteArray &value, time_t expiration, uint64_t cas, ReturnType *returnType=nullptr)
static bool replace(QByteArrayView key, const QByteArray &value, time_t expiration, ReturnType *returnType=nullptr)
static bool set(QByteArrayView key, const QByteArray &value, time_t expiration, ReturnType *returnType=nullptr)
static bool replaceByKey(QByteArrayView groupKey, QByteArrayView key, const QByteArray &value, time_t expiration, ReturnType *returnType=nullptr)
static bool casByKey(QByteArrayView groupKey, QByteArrayView key, const QByteArray &value, time_t expiration, uint64_t cas, ReturnType *returnType=nullptr)
static QHash< QByteArray, QByteArray > mget(const QByteArrayList &keys, QHash< QByteArray, uint64_t > *casValues=nullptr, ReturnType *returnType=nullptr)
static bool decrementWithInitialByKey(QByteArrayView groupKey, QByteArrayView key, uint64_t offset, uint64_t initial, time_t expiration, uint64_t *value=nullptr, ReturnType *returnType=nullptr)
static QByteArray getByKey(QByteArrayView groupKey, QByteArrayView key, uint64_t *cas=nullptr, ReturnType *returnType=nullptr)
static const time_t expirationNotAdd
static bool addByKey(QByteArrayView groupKey, QByteArrayView key, const QByteArray &value, time_t expiration, ReturnType *returnType=nullptr)
static bool incrementWithInitialByKey(QByteArrayView groupKey, QByteArrayView key, uint64_t offset, uint64_t initial, time_t expiration, uint64_t *value=nullptr, ReturnType *returnType=nullptr)
static bool setByKey(QByteArrayView groupKey, QByteArrayView key, const QByteArray &value, time_t expiration, ReturnType *returnType=nullptr)
static QByteArray get(QByteArrayView key, uint64_t *cas=nullptr, ReturnType *returnType=nullptr)
static bool add(QByteArrayView key, const QByteArray &value, time_t expiration, ReturnType *returnType=nullptr)
Base class for Cutelyst Plugins.
The Cutelyst namespace holds all public Cutelyst API.
bool isEmpty() const const
qsizetype count(QByteArrayView bv) const const
QHash::const_iterator constBegin() const const
QHash::const_iterator constEnd() const const
QHash::iterator insert(const Key &key, const T &value)