19 #ifndef CUTELYSTMEMCACHED_H
20 #define CUTELYSTMEMCACHED_H
22 #include <Cutelyst/cutelyst_global.h>
23 #include <Cutelyst/plugin.h>
25 #include <QDataStream>
26 #include <QVersionNumber>
31 class MemcachedPrivate;
203 ServerTemporaryDisabled,
204 ServerMemoryAllocationFailure,
208 Q_ENUM(MemcachedReturnType)
214 void setDefaultConfig(const QVariantMap &defaultConfig);
227 static
bool set(const
QString &key, const
QByteArray &value, time_t expiration, MemcachedReturnType *returnType =
nullptr);
242 template< typename T>
243 static
bool set(const
QString &key, const T &value, time_t expiration, MemcachedReturnType *returnType =
nullptr);
260 static
bool setByKey(const
QString &groupKey, const
QString &key, const
QByteArray &value, time_t expiration, MemcachedReturnType *returnType =
nullptr);
278 template< typename T>
279 static
bool setByKey(const
QString &groupKey, const
QString &key, const T &value, time_t expiration, MemcachedReturnType *returnType =
nullptr);
295 static
bool add(const
QString &key, const
QByteArray &value, time_t expiration, MemcachedReturnType *returnType =
nullptr);
313 template< typename T>
314 static
bool add(const
QString &key, const T &value, time_t expiration, MemcachedReturnType *returnType =
nullptr);
334 static
bool addByKey(const
QString &groupKey, const
QString &key, const
QByteArray &value, time_t expiration, MemcachedReturnType *returnType =
nullptr);
356 template< typename T>
357 static
bool addByKey(const
QString &groupKey, const
QString &key, const T &value, time_t expiration, MemcachedReturnType *returnType =
nullptr);
373 static
bool replace(const
QString &key, const
QByteArray &value, time_t expiration, MemcachedReturnType *returnType =
nullptr);
391 template< typename T>
392 static
bool replace(const
QString &key, const T &value, time_t expiration, MemcachedReturnType *returnType =
nullptr);
412 static
bool replaceByKey(const
QString &groupKey, const
QString &key, const
QByteArray &value, time_t expiration, MemcachedReturnType *returnType =
nullptr);
434 template< typename T>
435 static
bool replaceByKey(const
QString &groupKey, const
QString &key, const T &value, time_t expiration, MemcachedReturnType *returnType =
nullptr);
451 static
QByteArray get(const
QString &key, uint64_t *cas =
nullptr, MemcachedReturnType *returnType =
nullptr);
481 template< typename T>
482 static T get(const
QString &key, uint64_t *cas =
nullptr, MemcachedReturnType *returnType =
nullptr);
502 static
QByteArray getByKey(const
QString &groupKey, const
QString &key, uint64_t *cas =
nullptr, MemcachedReturnType *returnType =
nullptr);
536 template< typename T>
537 static T getByKey(const
QString &groupKey, const
QString &key, uint64_t *cas =
nullptr, MemcachedReturnType *returnType =
nullptr);
546 static
bool remove(const
QString &key, MemcachedReturnType *returnType =
nullptr);
559 static
bool removeByKey(const
QString &groupKey, const
QString &key, MemcachedReturnType *returnType =
nullptr);
567 static
bool exist(const
QString &key, MemcachedReturnType *returnType =
nullptr);
579 static
bool existByKey(const
QString &groupKey, const
QString &key, MemcachedReturnType *returnType =
nullptr);
585 static const time_t expirationNotAdd;
601 static
bool increment(const
QString &key, uint32_t offset, uint64_t *value =
nullptr,
MemcachedReturnType *returnType =
nullptr);
644 static
bool incrementWithInitial(const
QString &key, uint64_t offset, uint64_t initial, time_t expiration, uint64_t *value =
nullptr,
MemcachedReturnType *returnType =
nullptr);
673 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);
689 static
bool decrement(const
QString &key, uint32_t offset, uint64_t *value =
nullptr,
MemcachedReturnType *returnType =
nullptr);
732 static
bool decrementWithInitial(const
QString &key, uint64_t offset, uint64_t initial, time_t expiration, uint64_t *value =
nullptr,
MemcachedReturnType *returnType =
nullptr);
761 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);
789 template< typename T>
790 static
bool cas(const
QString &key, const T &value, time_t expiration, uint64_t cas,
MemcachedReturnType *returnType =
nullptr);
828 template< typename T>
880 template< typename T>
921 template< typename T>
932 static
bool touch(const QString &key, time_t expiration,
MemcachedReturnType *returnType =
nullptr);
947 static
bool touchByKey(const QString &groupKey, const QString &key, time_t expiration,
MemcachedReturnType *returnType =
nullptr);
968 template< typename T>
977 template<
typename T>
986 template<
typename T>
995 template<
typename T>
1004 template<
typename T>
1013 template<
typename T>
1022 template<
typename T>
1034 template<
typename T>
1046 template<
typename T>
1055 template<
typename T>
1064 template<
typename T>
1069 if (!_data.
empty()) {
1075 hash.
insert(i.key(), retVal);
1082 template<
typename T>
1087 if (!_data.
empty()) {
1093 hash.
insert(i.key(), retVal);
1102 #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)
static QHash< QString, QByteArray > mgetByKey(const QString &groupKey, const QStringList &keys, QHash< QString, uint64_t > *casValues=nullptr, MemcachedReturnType *returnType=nullptr)
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
static bool setByKey(const QString &groupKey, const QString &key, const QByteArray &value, time_t expiration, MemcachedReturnType *returnType=nullptr)
const_iterator constBegin() 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)