cutelyst 4.3.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
|
Cutelyst Memcached plugin. More...
#include <Cutelyst/Plugins/Memcached/Memcached>
Public Types | |
enum class | ReturnType { Success , Failure , HostLookupFailure , ConnectionFailure , WriteFailure , ReadFailure , UnknownReadFailure , ProtocolError , ClientError , ServerError , Error , DataExists , DataDoesNotExist , NotStored , Stored , NotFound , MemoryAllocationFailure , PartialRead , SomeErrors , NoServers , End , Deleted , Stat , Errno , NotSupported , FetchNotFinished , Timeout , Buffered , BadKeyProvided , InvalidHostProtocol , ServerMarkedDead , UnknownStatKey , E2Big , InvalidArguments , KeyTooBig , AuthProblem , AuthFailure , AuthContinue , ParseError , ParseUserError , Deprecated , InProgress , ServerTemporaryDisabled , ServerMemoryAllocationFailure , MaximumReturn , PluginNotRegisterd } |
Public Member Functions | |
Memcached (Application *parent) | |
Memcached (Application *parent, const QVariantMap &defaultConfig) | |
~Memcached () override | |
void | setDefaultConfig (const QVariantMap &defaultConfig) |
Public Member Functions inherited from Cutelyst::Plugin | |
Plugin (Application *parent) | |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
bool | blockSignals (bool block) |
const QObjectList & | children () const const |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
bool | disconnect (const QObject *receiver, const char *method) const const |
void | dumpObjectInfo () const const |
void | dumpObjectTree () const const |
QList< QByteArray > | dynamicPropertyNames () const const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (Qt::FindChildOptions options) const const |
bool | inherits (const char *className) const const |
void | installEventFilter (QObject *filterObj) |
bool | isQuickItemType () const const |
bool | isWidgetType () const const |
bool | isWindowType () const const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const const |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
QVariant | property (const char *name) const const |
Q_CLASSINFO (Name, Value) | |
Q_DISABLE_COPY (Class) | |
Q_DISABLE_COPY_MOVE (Class) | |
Q_EMIT Q_EMIT | |
Q_ENUM (...) | |
Q_ENUM_NS (...) | |
Q_ENUMS (...) | |
Q_FLAG (...) | |
Q_FLAG_NS (...) | |
Q_FLAGS (...) | |
Q_GADGET Q_GADGET | |
Q_GADGET_EXPORT (EXPORT_MACRO) | |
Q_INTERFACES (...) | |
Q_INVOKABLE Q_INVOKABLE | |
Q_MOC_INCLUDE Q_MOC_INCLUDE | |
Q_NAMESPACE Q_NAMESPACE | |
Q_NAMESPACE_EXPORT (EXPORT_MACRO) | |
Q_OBJECT Q_OBJECT | |
Q_PROPERTY (...) | |
Q_REVISION Q_REVISION | |
Q_SET_OBJECT_NAME (Object) | |
Q_SIGNAL Q_SIGNAL | |
Q_SIGNALS Q_SIGNALS | |
Q_SLOT Q_SLOT | |
Q_SLOTS Q_SLOTS | |
T | qobject_cast (const QObject *object) |
T | qobject_cast (QObject *object) |
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
void | removeEventFilter (QObject *obj) |
void | setObjectName (const QString &name) |
void | setObjectName (QAnyStringView name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const const |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType) |
QThread * | thread () const const |
Static Public Member Functions | |
static bool | add (QByteArrayView key, const QByteArray &value, std::chrono::seconds expiration, ReturnType *returnType=nullptr) |
static bool | add (QByteArrayView key, const QByteArray &value, time_t expiration, ReturnType *returnType=nullptr) |
template<typename T > | |
static bool | add (QByteArrayView key, const T &value, std::chrono::seconds expiration, ReturnType *returnType=nullptr) |
template<typename T > | |
static bool | add (QByteArrayView key, const T &value, time_t expiration, ReturnType *returnType=nullptr) |
static bool | addByKey (QByteArrayView groupKey, QByteArrayView key, const QByteArray &value, std::chrono::seconds expiration, ReturnType *returnType=nullptr) |
static bool | addByKey (QByteArrayView groupKey, QByteArrayView key, const QByteArray &value, time_t expiration, ReturnType *returnType=nullptr) |
template<typename T > | |
static bool | addByKey (QByteArrayView groupKey, QByteArrayView key, const T &value, std::chrono::seconds expiration, ReturnType *returnType=nullptr) |
template<typename T > | |
static bool | addByKey (QByteArrayView groupKey, QByteArrayView key, const T &value, time_t expiration, ReturnType *returnType=nullptr) |
static bool | cas (QByteArrayView key, const QByteArray &value, std::chrono::seconds expiration, uint64_t cas, ReturnType *returnType=nullptr) |
static bool | cas (QByteArrayView key, const QByteArray &value, time_t expiration, uint64_t cas, ReturnType *returnType=nullptr) |
template<typename T > | |
static bool | cas (QByteArrayView key, const T &value, std::chrono::seconds expiration, uint64_t cas, ReturnType *returnType=nullptr) |
template<typename T > | |
static bool | cas (QByteArrayView key, const T &value, time_t expiration, uint64_t cas, ReturnType *returnType=nullptr) |
static bool | casByKey (QByteArrayView groupKey, QByteArrayView key, const QByteArray &value, std::chrono::seconds expiration, uint64_t cas, ReturnType *returnType=nullptr) |
static bool | casByKey (QByteArrayView groupKey, QByteArrayView key, const QByteArray &value, time_t expiration, uint64_t cas, ReturnType *returnType=nullptr) |
template<typename T > | |
static bool | casByKey (QByteArrayView groupKey, QByteArrayView key, const T &value, std::chrono::seconds expiration, uint64_t cas, ReturnType *returnType=nullptr) |
template<typename T > | |
static bool | casByKey (QByteArrayView groupKey, QByteArrayView key, const T &value, time_t expiration, uint64_t cas, ReturnType *returnType=nullptr) |
static bool | decrement (QByteArrayView key, uint32_t offset, uint64_t *value=nullptr, ReturnType *returnType=nullptr) |
static bool | decrementByKey (QByteArrayView groupKey, QByteArrayView key, uint64_t offset, uint64_t *value=nullptr, ReturnType *returnType=nullptr) |
static bool | decrementWithInitial (QByteArrayView key, uint64_t offset, uint64_t initial, std::chrono::seconds expiration, uint64_t *value=nullptr, ReturnType *returnType=nullptr) |
static bool | decrementWithInitial (QByteArrayView key, uint64_t offset, uint64_t initial, time_t expiration, uint64_t *value=nullptr, ReturnType *returnType=nullptr) |
static bool | decrementWithInitialByKey (QByteArrayView groupKey, QByteArrayView key, uint64_t offset, uint64_t initial, std::chrono::seconds expiration, uint64_t *value=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 QString | errorString (Context *c, ReturnType rt) |
static bool | exist (QByteArrayView key, ReturnType *returnType=nullptr) |
static bool | existByKey (QByteArrayView groupKey, QByteArrayView key, ReturnType *returnType=nullptr) |
static bool | flush (std::chrono::seconds expiration, ReturnType *returnType=nullptr) |
static bool | flush (time_t expiration, ReturnType *returnType=nullptr) |
static bool | flushBuffers (ReturnType *returnType=nullptr) |
static QByteArray | get (QByteArrayView key, uint64_t *cas=nullptr, ReturnType *returnType=nullptr) |
template<typename T > | |
static T | get (QByteArrayView key, uint64_t *cas=nullptr, ReturnType *returnType=nullptr) |
static QByteArray | getByKey (QByteArrayView groupKey, QByteArrayView key, uint64_t *cas=nullptr, ReturnType *returnType=nullptr) |
template<typename T > | |
static T | getByKey (QByteArrayView groupKey, QByteArrayView key, uint64_t *cas=nullptr, ReturnType *returnType=nullptr) |
static bool | increment (QByteArrayView key, uint32_t offset, uint64_t *value=nullptr, ReturnType *returnType=nullptr) |
static bool | incrementByKey (QByteArrayView groupKey, QByteArrayView key, uint64_t offset, uint64_t *value=nullptr, ReturnType *returnType=nullptr) |
static bool | incrementWithInitial (QByteArrayView key, uint64_t offset, uint64_t initial, std::chrono::seconds 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 bool | incrementWithInitialByKey (QByteArrayView groupKey, QByteArrayView key, uint64_t offset, uint64_t initial, std::chrono::seconds expiration, uint64_t *value=nullptr, 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 QVersionNumber | libMemcachedVersion () |
Returns the version of the currently used libmemcached. | |
static QHash< QByteArray, QByteArray > | mget (const QByteArrayList &keys, QHash< QByteArray, uint64_t > *casValues=nullptr, ReturnType *returnType=nullptr) |
template<typename T > | |
static QHash< QByteArray, T > | mget (const QByteArrayList &keys, QHash< QByteArray, uint64_t > *casValues=nullptr, ReturnType *returnType=nullptr) |
static QHash< QByteArray, QByteArray > | mgetByKey (QByteArrayView groupKey, const QByteArrayList &keys, QHash< QByteArray, uint64_t > *casValues=nullptr, ReturnType *returnType=nullptr) |
template<typename T > | |
static QHash< QByteArray, T > | mgetByKey (QByteArrayView groupKey, const QByteArrayList &keys, QHash< QByteArray, uint64_t > *casValues=nullptr, ReturnType *returnType=nullptr) |
static bool | remove (QByteArrayView key, ReturnType *returnType=nullptr) |
static bool | removeByKey (QByteArrayView groupKey, QByteArrayView key, ReturnType *returnType=nullptr) |
static bool | replace (QByteArrayView key, const QByteArray &value, std::chrono::seconds expiration, ReturnType *returnType=nullptr) |
static bool | replace (QByteArrayView key, const QByteArray &value, time_t expiration, ReturnType *returnType=nullptr) |
template<typename T > | |
static bool | replace (QByteArrayView key, const T &value, std::chrono::seconds expiration, ReturnType *returnType=nullptr) |
template<typename T > | |
static bool | replace (QByteArrayView key, const T &value, time_t expiration, ReturnType *returnType=nullptr) |
static bool | replaceByKey (QByteArrayView groupKey, QByteArrayView key, const QByteArray &value, std::chrono::seconds expiration, ReturnType *returnType=nullptr) |
static bool | replaceByKey (QByteArrayView groupKey, QByteArrayView key, const QByteArray &value, time_t expiration, ReturnType *returnType=nullptr) |
template<typename T > | |
static bool | replaceByKey (QByteArrayView groupKey, QByteArrayView key, const T &value, std::chrono::seconds expiration, ReturnType *returnType=nullptr) |
template<typename T > | |
static bool | replaceByKey (QByteArrayView groupKey, QByteArrayView key, const T &value, time_t expiration, ReturnType *returnType=nullptr) |
static bool | set (QByteArrayView key, const QByteArray &value, std::chrono::seconds expiration, ReturnType *returnType=nullptr) |
static bool | set (QByteArrayView key, const QByteArray &value, time_t expiration, ReturnType *returnType=nullptr) |
template<typename T > | |
static bool | set (QByteArrayView key, const T &value, std::chrono::seconds expiration, ReturnType *returnType=nullptr) |
template<typename T > | |
static bool | set (QByteArrayView key, const T &value, time_t expiration, ReturnType *returnType=nullptr) |
static bool | setByKey (QByteArrayView groupKey, QByteArrayView key, const QByteArray &value, std::chrono::seconds expiration, ReturnType *returnType=nullptr) |
static bool | setByKey (QByteArrayView groupKey, QByteArrayView key, const QByteArray &value, time_t expiration, ReturnType *returnType=nullptr) |
template<typename T > | |
static bool | setByKey (QByteArrayView groupKey, QByteArrayView key, const T &value, std::chrono::seconds expiration, ReturnType *returnType=nullptr) |
template<typename T > | |
static bool | setByKey (QByteArrayView groupKey, QByteArrayView key, const T &value, time_t expiration, ReturnType *returnType=nullptr) |
static bool | touch (QByteArrayView key, std::chrono::seconds expiration, ReturnType *returnType=nullptr) |
static bool | touch (QByteArrayView key, time_t expiration, ReturnType *returnType=nullptr) |
static bool | touchByKey (QByteArrayView groupKey, QByteArrayView key, std::chrono::seconds expiration, ReturnType *returnType=nullptr) |
static bool | touchByKey (QByteArrayView groupKey, QByteArrayView key, time_t expiration, ReturnType *returnType=nullptr) |
Static Public Member Functions inherited from QObject | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
Static Public Attributes | |
static const time_t | expirationNotAdd |
static const std::chrono::seconds | expirationNotAddDuration |
Protected Member Functions | |
bool | setup (Application *app) override |
Protected Member Functions inherited from QObject | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
bool | isSignalConnected (const QMetaMethod &signal) const const |
int | receivers (const char *signal) const const |
QObject * | sender () const const |
int | senderSignalIndex () const const |
virtual void | timerEvent (QTimerEvent *event) |
Additional Inherited Members | |
Public Attributes inherited from QObject | |
typedef | QObjectList |
Properties inherited from QObject | |
objectName | |
The Memcached plugin for Cutelyst can be used to store, retrieve, delete and modify data on a memcached general-purpose distributed memory caching system. It uses libmemcached to connect to a pool of memcached servers and to perform the caching operations. In order to build this plugin, the libmemcached development and header files have to be present at build time.
Basically all values are stored as QByteArray. So, to store simple types, simply convert them into a QByteArray and vice versa on retrieval. For more complex or custom types you can use QDataStream to serialize them into a QByteArray. For most methods in this plugin there are template functions for convenience that perform this serialization. The requirement to use them is that the types to store and get provide stream operators for QDataStream.
The Memcached plugin can be configured in the application configuration file in the Cutelyst_Memcached_Plugin
section. It uses the same configuration strings as libmemcached but in lowercase and without the dashes in front and for consistence '-'
replaced by '_'
. So --BINARY-PROTOCOL
will be binary_protocol
. To add servers and/or sockets use the servers
configuration key. Servers can be added with name, port and weight, separated by ','
- multiple servers are separated by a ';'
. To add sockets, use a full path as name. If no configuration has been set or if the servers configuration key is empty, a default server at localhost on port 11211 will be used.
Additional to the configuration options of libmemcached there are some plugin specific options:
Type: bool
Default: fase
Enables compression of input values based on qCompress / zlib.
Type: integer
Default: -1
The compression level used by qCompress(). Valid values are between 0 and 9, with 9 corresponding to the greatest compression. The value 0 corresponds to no compression at all. The default value is -1, which specifies zlib’s default compression.
Type: integer
Default: 100
The compression size threshold in bytes. Only input values bigger than the threshold will be compressed.
Type: string
Default: empty
If set and not empty, AES encryption will be enabled for storing data on the memcached servers.
Type: string
Default: empty
If set and not empty, SASL authentication will be used to authenticate with the memcached server(s). Note that SASL support has to be enabled when building libmemcached.
Type: string
Default: empty
Password used for the SASL authentication with the memcached server(s).
To set default values directly in your application, use setDefaultConfig() or the overloaded constructor taking default values. Configuration values that can not be found in the application configuration file will be looked up for default values in that QVariantMap.
Expiration times are set in seconds. If the value is bigger than 30 days, it is interpreted as a unix timestamp.
Messages from this plugin are logged to the logging category cutelyst.plugin.memcached. All methods provide the possibility to specify a pointer to a Memcached::ReturnType variable that can provide further information about occurred errors if methods return false
or empty results.
To build this plugin you need the development and header files for libmemcached and run cmake with -DPLUGIN_MEMCACHED:BOOL=ON
.
Enabling the build of the Memcached plugin will also enable the unit tests for this plugin. By default, the unit test will start its own memcached instance. Alternatively you can set the CUTELYST_MEMCACHED_TEST_SERVERS
environment variable in your build environment to define different servers that you have to start by yourself. The syntax is the same as for adding servers in the configuration file. If you have for examble two servers, one on default location and another one on a unix socket, export the following environment variable befor running the tests:
Definition at line 166 of file memcached.h.
|
strong |
Return types for memcached operations.
Definition at line 196 of file memcached.h.
Memcached::Memcached | ( | Application * | parent | ) |
Constructs a new Memcached object with the given parent.
Definition at line 25 of file memcached.cpp.
Memcached::Memcached | ( | Application * | parent, |
const QVariantMap & | defaultConfig | ||
) |
Contructs a new Memcached object with the given parent and defaultConfig.
Use the defaultConfig to set default values for the configuration entries from the configuration file.
Definition at line 31 of file memcached.cpp.
|
overridedefault |
Deconstructs the Memcached object.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1489 of file memcached.h.
References add().
|
static |
Adds the value to the memcached server using key. If the object is found on the server an error occurs and this method returns false
, otherwise the value is stored.
As this method returns false
if the key has already been set on the server, you can use the value of the returnType to determine the reason. Other than with other errors, failing because of already existing key will not be logged.
[in] | key | key of object whose value to add |
[in] | value | value of object to add to server |
[in] | expiration | time in seconds to keep the object stored in the server |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 329 of file memcached.cpp.
References QByteArray::constData(), QByteArrayView::constData(), QByteArray::size(), and QByteArrayView::size().
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1507 of file memcached.h.
|
static |
Adds the value of type T to the memcached server using key. If the object is found on the server an error occurs and this method returns false
, otherwise the value is stored.
Type T has to be serializable into a QByteArray using QDataStream.
As this method returns false
if the key has already been set on the server, you can use the value of the returnType to determine the reason. Other than with other errors, failing because of already existing key will not be logged.
[in] | key | key of object whose value to add |
[in] | value | value of type T of object to add to server |
[in] | expiration | time in seconds to keep the object stored in the server |
[out] | returnType | optional pointer to ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 1498 of file memcached.h.
References add(), and QIODeviceBase::WriteOnly.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1515 of file memcached.h.
References addByKey().
|
static |
Adds the value to the memcached server using key. If the object is found on the server an error occurs and this method returns false
, otherwise the value is stored. This method is functionally equivalent to Memcached::add(), except that the free-form groupKey can be used to map the key to a specific server. This allows related items to be grouped together on a single server for efficiency.
As this method returns false
if the key has already been set on the server, you can use the value of the returnType to determine the reason. Other than with other errors, failing because of already existing key will not be logged.
[in] | groupKey | key that specifies the server to write to |
[in] | key | key of object whose value to add |
[in] | value | value of object to add to server |
[in] | expiration | time in seconds to keep the object stored in the server |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 361 of file memcached.cpp.
References QByteArray::constData(), QByteArrayView::constData(), QByteArray::size(), and QByteArrayView::size().
Referenced by addByKey(), and addByKey().
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1538 of file memcached.h.
|
static |
Adds the value of type T to the memcached server using key. If the object is found on the server an error occurs and this method returns false
, otherwise the value is stored. This method is functionally equivalent to Memcached::add(), except that the free-form groupKey can be used to map the key to a specific server. This allows related items to be grouped together on a single server for efficiency.
Type T has to be serializable into a QByteArray using QDataStream.
As this method returns false
if the key has already been set on the server, you can use the value of the returnType to determine the reason. Other than with other errors, failing because of already existing key will not be logged.
[in] | groupKey | key that specifies the server to write to |
[in] | key | key of object whose value to add |
[in] | value | value of object to add to server |
[in] | expiration | time in seconds to keep the object stored in the server |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 1525 of file memcached.h.
References addByKey(), and QIODeviceBase::WriteOnly.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1681 of file memcached.h.
References cas().
|
static |
Overwrites data for key in the server as long as the cas value is still the same in the server. You can get the cas value by using the cas return value of Memcached::get()
[in] | key | key of object whose value to compare and set |
[in] | value | value of object to write to server |
[in] | expiration | time in seconds to keep the object stored in the server |
[in] | cas | the cas value to compare |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 877 of file memcached.cpp.
References cas(), QByteArray::constData(), QByteArrayView::constData(), QByteArray::size(), and QByteArrayView::size().
Referenced by cas(), cas(), cas(), cas(), casByKey(), casByKey(), casByKey(), casByKey(), get(), and getByKey().
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1704 of file memcached.h.
References cas().
|
static |
Overwrites data for key in the server as long as the cas value is still the same in the server. You can get the cas value by using the cas return value of Memcached::get()
Type T has to be serializable into a QByteArray using QDataStream.
[in] | key | key of object whose value to compare and set |
[in] | value | value of type T of object to write to server |
[in] | expiration | time in seconds to keep the object stored in the server |
[in] | cas | the cas value to compare |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 1691 of file memcached.h.
References cas(), and QIODeviceBase::WriteOnly.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1713 of file memcached.h.
References cas(), and casByKey().
|
static |
Overwrites data for key in groupKey in the server as long as the cas value is still the same in the server. You can get the cas value by using the cas return value of Memcached::getByKey().
This method behaves in a similar nature as Memcached::cas(). The difference is that it takes a groupKey that is used for determining which server an object was stored if key partitioning was used for storage.
[in] | groupKey | key that specifies the server to write to |
[in] | key | key of object whose value to compare and set |
[in] | value | value of object to write to server |
[in] | expiration | time in seconds to keep the object stored in the server |
[in] | cas | the cas value to compare |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 911 of file memcached.cpp.
References cas(), QByteArray::constData(), QByteArrayView::constData(), QByteArray::size(), and QByteArrayView::size().
Referenced by casByKey(), and casByKey().
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1738 of file memcached.h.
References cas().
|
static |
Overwrites data for key in groupKey in the server as long as the cas value is still the same in the server. You can get the cas value by using the cas return value of Memcached::getByKey()
Type T has to be serializable into a QByteArray using QDataStream.
This method behaves in a similar nature as Memcached::cas(). The difference is that it takes a groupKey that is used for determining which server an object was stored if key partitioning was used for storage.
[in] | groupKey | key that specifies the server to write to |
[in] | key | key of object whose value to compare and set |
[in] | value | value of type T of object to write to server |
[in] | expiration | time in seconds to keep the object stored in the server |
[in] | cas | the cas value to compare |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 1724 of file memcached.h.
References cas(), casByKey(), and QIODeviceBase::WriteOnly.
|
static |
Decrements the value of key by offset. If there is a valid pointer to value, the decremented value will be returned to it.
[in] | key | key to decrement |
[in] | offset | offset for decrement |
[out] | value | optional pointer to a variable that takes the decremented value |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 760 of file memcached.cpp.
References QByteArrayView::constData(), and QByteArrayView::size().
|
static |
Drecrements the value of key in groupKey by offset. If there is a valid pointer to value, the decremented value will be returned to it. This method behaves in a similar nature as Memcached::decrement(). The difference is that it takes a groupKey that is used for determining which server an object was stored if key partitioning was used for storage.
[in] | groupKey | key that specifies the server to decrement the key on |
[in] | key | key to decrement |
[in] | offset | offset for decrement |
[out] | value | optional pointer to a variable that takes the decremented value |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 784 of file memcached.cpp.
References QByteArrayView::constData(), and QByteArrayView::size().
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1631 of file memcached.h.
References QByteArrayView::count(), and decrementWithInitial().
|
static |
Decrements the value of key by offset. If the object specified by key does not exist, one of two things will happen: if the expiration value is Memcached::expirationNotAdd, the operation will fail. For all other expiration values, the operation will succeed by seeding the value for that key with a initial value to expire with the provided expiration time. The flags will be set to zero. If there is a valid pointer to value, the created or decremented value will be returned to it.
[in] | key | key to decrement or initialize |
[in] | offset | offset for decrement |
[in] | initial | initial value if key does not exist |
[in] | expiration | expiration time in seconds |
[out] | value | optional pointer to a variable that takes the decremented or initialized value |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 815 of file memcached.cpp.
References QByteArrayView::constData(), and QByteArrayView::size().
Referenced by decrementWithInitial().
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1642 of file memcached.h.
References QByteArrayView::count(), and decrementWithInitialByKey().
|
static |
Decrements the value of key in groupKey by offset. If the object specified by key does not exist, one of two things will happen: if the expiration value is Memcached::expirationNotAdd, the operation will fail. For all other expiration values, the operation will succeed by seeding the value for that key with a initial value to expire with the provided expiration time. The flags will be set to zero. If there is a valid pointer to value, the created or decremented value will be returned to it.
This method behaves in a similar nature as Memcached::decrementWithInitial(). The difference is that it takes a groupKey that is used for determining which server an object was stored if key partitioning was used for storage.
[in] | groupKey | key that specifies the server to decrement or initialize the key on |
[in] | key | key to decrement or initialize |
[in] | offset | offset for decrement |
[in] | initial | initial value if key does not exist |
[in] | expiration | expiration time in seconds |
[out] | value | optional pointer to a variable that takes the decremented or initialized value |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 842 of file memcached.cpp.
References QByteArrayView::constData(), and QByteArrayView::size().
Referenced by decrementWithInitialByKey().
|
static |
Converts the return type rt into human readable error string.
Definition at line 1184 of file memcached.cpp.
References AuthContinue, AuthFailure, AuthProblem, BadKeyProvided, Buffered, ClientError, ConnectionFailure, DataDoesNotExist, DataExists, Deleted, Deprecated, E2Big, End, Errno, Error, Failure, FetchNotFinished, HostLookupFailure, InvalidArguments, InvalidHostProtocol, KeyTooBig, MemoryAllocationFailure, NoServers, NotFound, NotStored, NotSupported, ParseError, ParseUserError, PartialRead, PluginNotRegisterd, ProtocolError, Cutelyst::Context::qtTrId(), ReadFailure, ServerError, ServerMarkedDead, SomeErrors, Stat, Stored, Success, Timeout, UnknownReadFailure, UnknownStatKey, and WriteFailure.
|
static |
Checks if the key exists.
[in] | key | key to check |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
if the key exists; false
otherwise Definition at line 601 of file memcached.cpp.
References QByteArrayView::constData(), and QByteArrayView::size().
|
static |
Checks if the key exists in groupKey. This method behaves in a similar nature as Memcached::exist(). The difference is that it takes a groupKey that is used for determining which server an object was stored if key partitioning was used for storage.
groupKey | key that specifies the server to check on |
key | key to check |
returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
if the key exists; false
otherwise Definition at line 621 of file memcached.cpp.
References QByteArrayView::constData(), and QByteArrayView::size().
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1748 of file memcached.h.
References flush().
|
static |
Wipe cleans the contents of memcached servers. It will either do this immediately or expire the content based on the expiration time passed to the method (a value of zero causes an immediate flush). The operation is not atomic to multiple servers, just atomic to a single server. That is, it will flush the servers in the order that they were added.
[in] | expiration | time in seconds |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 969 of file memcached.cpp.
Referenced by flush().
|
static |
Used in conjunction with buffer requests enabled to flush all buffers by sending the buffered commands to the server for processing.
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 949 of file memcached.cpp.
|
static |
Fetch an individial value from the server identified by key. The returned QByteArray will contain the data fetched from the server. If an error occurred or if the key could not be found, the returned QByteArray will be null
. Use QByteArray::isNull() to check for this.
As this method returns a null
byte array if an error occurred as well if the key could not be found, you can use the value of the returnType to determine the reason. Other than with other errors, failing because of not found key will not be logged.
[in] | key | key of object whose value to fecth |
[out] | cas | optional pointer to a variable that takes the CAS value |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
null
. Definition at line 464 of file memcached.cpp.
References cas(), QByteArrayView::constData(), QByteArray::push_back(), and QByteArrayView::size().
Referenced by get().
|
static |
Fetch an individial value of type T from the server identified by key. The returned type T will contain the data fetched from the server. If an error occurred or if the key could not be found, the returned type T will be default constructed.
Type T has to be deserializable from a QByteArray using QDataStream.
As this method returns a default constructed type T if an error occurred as well if the key could not be found, you can use the value of the returnType to determine the reason. Other than with other errors, failing because of not found key will not be logged.
[in] | key | key of object whose value to fecth |
[out] | cas | optional pointer to a quint32 variable that takes the CAS value |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
Definition at line 1655 of file memcached.h.
References cas(), get(), QByteArray::isEmpty(), and QIODeviceBase::ReadOnly.
|
static |
Fetch an individial value from the server identified by key. The returned QByteArray will contain the data fetched from the server. If an error occurred or if the key could not be found, the returned QByteArray will be null
. Use QByteArray::isNull() to check for this. This method behaves in a similar nature as Memcached::get(). The difference is that it takes a groupKey that is used for determining which server an object was stored if key partitioning was used for storage.
As this method returns a null
byte array if an error occurred as well if the key could not be found, you can use the value of the returnType to determine the reason. Other than with other errors, failing because of not found key will not be logged.
[in] | groupKey | key that specifies the server to fetch from |
[in] | key | key of object whose value to fecth |
[out] | cas | optional pointer to a variable that takes the CAS value |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
null
. Definition at line 509 of file memcached.cpp.
References cas(), QByteArrayView::constData(), QByteArray::push_back(), and QByteArrayView::size().
Referenced by getByKey().
|
static |
Fetch an individial value from the server identified by key. The returned type T will contain the data fetched from the server. If an error occurred or if the key could not be found, the returned type T will be default constructed. This method behaves in a similar nature as Memcached::get(). The difference is that it takes a groupKey that is used for determining which server an object was stored if key partitioning was used for storage.
Type T has to be deserializable from a QByteArray using QDataStream.
As this method returns a default constructed type T if an error occurred as well if the key could not be found, you can use the value of the returnType to determine the reason. Other than with other errors, failing because of not found key will not be logged.
[in] | groupKey | key that specifies the server to fetch from |
[in] | key | key of object whose value to fecth |
[out] | cas | optional pointer to a variable that takes the CAS value |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
Definition at line 1667 of file memcached.h.
References cas(), getByKey(), QByteArray::isEmpty(), and QIODeviceBase::ReadOnly.
|
static |
Increments the value of key by offset. If there is a valid pointer to value, the incremented value will be returned to it.
[in] | key | key to increment |
[in] | offset | offset for increment |
[out] | value | optional pointer to a variable that takes the incremented value |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 643 of file memcached.cpp.
References QByteArrayView::constData(), and QByteArrayView::size().
|
static |
Increments the value of key in groupKey by offset. If there is a valid pointer to value, the incremented value will be returned to it. This method behaves in a similar nature as Memcached::increment(). The difference is that it takes a groupKey that is used for determining which server an object was stored if key partitioning was used for storage.
[in] | groupKey | key that specifies the server to increment the key on |
[in] | key | key to increment |
[in] | offset | offset for increment |
[out] | value | optional pointer to a variable that takes the incremented value |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 667 of file memcached.cpp.
References QByteArrayView::constData(), and QByteArrayView::size().
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1608 of file memcached.h.
References QByteArrayView::count(), and incrementWithInitial().
|
static |
Increments the value of key by offset. If the object specified by key does not exist, one of two things will happen: if the expiration value is Memcached::expirationNotAdd, the operation will fail. For all other expiration values, the operation will succeed by seeding the value for that key with a initial value to expire with the provided expiration time. The flags will be set to zero. If there is a valid pointer to value, the created or incremented value will be returned to it.
[in] | key | key to increment or initialize |
[in] | offset | offset for increment |
[in] | initial | initial value if key does not exist |
[in] | expiration | expiration time in seconds |
[out] | value | optional pointer to a variable that takes the incremented or initialized value |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 698 of file memcached.cpp.
References QByteArrayView::constData(), and QByteArrayView::size().
Referenced by incrementWithInitial().
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1619 of file memcached.h.
References QByteArrayView::count(), and incrementWithInitialByKey().
|
static |
Increments the value of key in groupKey by offset. If the object specified by key does not exist, one of two things will happen: if the expiration value is Memcached::expirationNotAdd, the operation will fail. For all other expiration values, the operation will succeed by seeding the value for that key with a initial value to expire with the provided expiration time. The flags will be set to zero. If there is a valid pointer to value, the created or incremented value will be returned to it.
This method behaves in a similar nature as Memcached::incrementWithInitial(). The difference is that it takes a groupKey that is used for determining which server an object was stored if key partitioning was used for storage.
[in] | groupKey | key that specifies the server to increment the key on |
[in] | key | key to increment or initialize |
[in] | offset | offset for increment |
[in] | initial | initial value if key does not exist |
[in] | expiration | expiration time in seconds |
[out] | value | optional pointer to a variable that takes the incremented or initialized value |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 725 of file memcached.cpp.
References QByteArrayView::constData(), and QByteArrayView::size().
Referenced by incrementWithInitialByKey().
|
static |
Definition at line 1326 of file memcached.cpp.
References QVersionNumber::fromString().
|
static |
Fetch multiple values from the server identified by a list of keys. If a pointer for the casValues is provided, keys and their cas values will be written to it.
As this might return an empty QHash if nothing has been found or if an error occurred, you can use the returnType pointer to determine the reason.
[in] | keys | list of keys to fetch from the server |
[out] | casValues | optional pointer to a QHash that will contain keys and their cas values |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
Definition at line 989 of file memcached.cpp.
References BadKeyProvided, QList::empty(), QHash::insert(), QHash::reserve(), and QList::size().
Referenced by mget().
|
static |
Fetch multiple values of type T from the server identified by a list of keys. If a pointer for the casValues is provided, keys and their cas values are written to it.
As this might return an empty QHash if nothing has been found or if an error occurred, you can use the returnType pointer to determine the reason.
Type T has to be deserializable from a QByteArray using QDataStream.
[in] | keys | list of keys to fetch from the server |
[out] | casValues | optional pointer to a QHash that will contain keys and their cas values |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
Definition at line 1754 of file memcached.h.
References QHash::constBegin(), QHash::constEnd(), QHash::empty(), QHash::insert(), and mget().
|
static |
Fetch multiple values from the server specified by groupKey identified by a list of keys. If a pointer for the casValues is provided, keys and their cas values will be written to it.
As this might return an empty QHash if nothing has been found or if an error occurred, you can use the returnType pointer to determine the reason.
This method behaves in a similar nature as Memcached::mget(). The difference is that it takes a groupKey that is used for determining which server an object was stored if key partitioning was used for storage.
[in] | groupKey | key to specify the server to fetch values from |
[in] | keys | list of keys to fetch from the server |
[out] | casValues | optional pointer to a QHash that will contain keys and their cas values |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
Definition at line 1053 of file memcached.cpp.
References BadKeyProvided, QByteArrayView::constData(), QList::empty(), QHash::insert(), QByteArrayView::isEmpty(), QHash::reserve(), QByteArrayView::size(), and QList::size().
Referenced by mgetByKey().
|
static |
Fetch multiple values of type T from the server specified by groupKey identified by a list of keys. If a pointer for the casValues is provided, keys and their cas values will be written to it.
As this might return an empty QHash if nothing has been found or if an error occurred, you can use the returnType pointer to determine the reason.
Type T has to be deserializable from a QByteArray using QDataStream.
This method behaves in a similar nature as Memcached::mget(). The difference is that it takes a groupKey that is used for determining which server an object was stored if key partitioning was used for storage.
[in] | groupKey | key to specify the server to fetch values from |
[in] | keys | list of keys to fetch from the server |
[out] | casValues | optional pointer to a QHash that will contain keys and their cas values |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
Definition at line 1774 of file memcached.h.
References QHash::constBegin(), QHash::constEnd(), QHash::empty(), QHash::insert(), and mgetByKey().
|
static |
Directly deletes a particular key.
[in] | key | key of object to delete |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 558 of file memcached.cpp.
References QByteArrayView::constData(), and QByteArrayView::size().
|
static |
Directly deletes a particular key in groupKey. This method behaves in a similar nature as Memcached::remove(). The difference is that it takes a groupKey that is used for determining which server an object was stored if key partitioning was used for storage.
[in] | groupKey | key that specifies the server to delete from |
[in] | key | key of object to delete |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 579 of file memcached.cpp.
References QByteArrayView::constData(), and QByteArrayView::size().
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1547 of file memcached.h.
References replace().
|
static |
Replaces the data of key on the server with value. If the key ist not found on the server an error occures and false
will be returned.
As this method returns false
if the key can not be found on the server, you can use the value of the returnType to determine the reason. Other than with other errors, failing because of not found key will not be logged.
[in] | key | key of object whose value to replace |
[in] | value | value to replace object on server with |
[in] | expiration | time in seconds to keep the object stored in the server |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 396 of file memcached.cpp.
References QByteArray::constData(), QByteArrayView::constData(), QByteArray::size(), and QByteArrayView::size().
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1568 of file memcached.h.
|
static |
Replaces the data of key on the server with value of type T. If the key ist not found on the server an error occures and false
will be returned.
Type T has to be serializable into a QByteArray using QDataStream.
As this method returns false
if the key can not be found on the server, you can use the value of the returnType to determine the reason. Other than with other errors, failing because of not found key will not be logged.
[in] | key | key of object whose value to replace |
[in] | value | value to replace object on server with |
[in] | expiration | time in seconds to keep the object stored in the server |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 1556 of file memcached.h.
References replace(), and QIODeviceBase::WriteOnly.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1576 of file memcached.h.
References replaceByKey().
|
static |
Replaces the data of key on the server with value. If the key ist not found on the server an error occures and false
will be returned. This method is functionally equivalent to Memcached::replace(), except that the free-form groupKey can be used to map the key to a specific server. This allows related items to be grouped together on a single server for efficiency.
As this method returns false
if the key can not be found on the server, you can use the value of the returnType to determine the reason. Other than with other errors, failing because of not found key will not be logged.
[in] | groupKey | key that specifies the server to write to |
[in] | key | key of object whose value to replace |
[in] | value | value to replace object on server with |
[in] | expiration | time in seconds to keep the object stored in the server |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 428 of file memcached.cpp.
References QByteArray::constData(), QByteArrayView::constData(), QByteArray::size(), and QByteArrayView::size().
Referenced by replaceByKey(), and replaceByKey().
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1599 of file memcached.h.
|
static |
Replaces the data of key on the server with value of Type T. If the key ist not found on the server an error occures and false
will be returned. This method is functionally equivalent to Memcached::replace(), except that the free-form groupKey can be used to map the key to a specific server. This allows related items to be grouped together on a single server for efficiency.
Type T has to be serializable into a QByteArray using QDataStream.
As this method returns false
if the key can not be found on the server, you can use the value of the returnType to determine the reason. Other than with other errors, failing because of not found key will not be logged.
[in] | groupKey | key that specifies the server to write to |
[in] | key | key of object whose value to replace |
[in] | value | value to replace object on server with |
[in] | expiration | time in seconds to keep the object stored in the server |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 1586 of file memcached.h.
References replaceByKey(), and QIODeviceBase::WriteOnly.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1431 of file memcached.h.
References set().
|
static |
Writes the value to the memcached server using key. If the key already exists it will overwrite what is on the server. If the object does not exist it will be written.
[in] | key | key of object whose value to set |
[in] | value | value of object to write to server |
[in] | expiration | time in seconds to keep the object stored in the server |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 261 of file memcached.cpp.
References QByteArray::constData(), QByteArrayView::constData(), QByteArray::size(), and QByteArrayView::size().
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1449 of file memcached.h.
|
static |
Writes the value of type T to the memcached server using key. If the key already exists it will overwrite what is on the server. If the object does not exist it will be written.
Type T has to be serializable into a QByteArray using QDataStream.
[in] | key | key of object whose value to set |
[in] | value | value of type T of object to write to server |
[in] | expiration | time in seconds to keep the object stored in the server |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 1440 of file memcached.h.
References set(), and QIODeviceBase::WriteOnly.
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1457 of file memcached.h.
References setByKey().
|
static |
Writes the value to the memcached server using key. If the key already exists it will overwrite what is on the server. If the object does not exist it will be written. This method is functionally equivalent to Memcached::set(), except that the free-form groupKey can be used to map the key to a specific server. This allows related items to be grouped together on a single server for efficiency.
[in] | groupKey | key that specifies the server to write to |
[in] | key | key of object whose value to set |
[in] | value | value of object to write to server |
[in] | expiration | time in seconds to keep the object stored in the server |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 293 of file memcached.cpp.
References QByteArray::constData(), QByteArrayView::constData(), QByteArray::size(), and QByteArrayView::size().
Referenced by setByKey(), and setByKey().
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1480 of file memcached.h.
|
static |
Writes the value of type T to the memcached server using key. If the key already exists it will overwrite what is on the server. If the object does not exist it will be written. This method is functionally equivalent to Memcached::set(), except that the free-form groupKey can be used to map the key to a specific server. This allows related items to be grouped together on a single server for efficiency.
Type T has to be serializable into a QByteArray using QDataStream.
[in] | groupKey | key that specifies the server to write to |
[in] | key | key of object whose value to set |
[in] | value | value of type T of object to write to server |
[in] | expiration | time in seconds to keep the object stored in the server |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 1467 of file memcached.h.
References setByKey(), and QIODeviceBase::WriteOnly.
void Memcached::setDefaultConfig | ( | const QVariantMap & | defaultConfig | ) |
Sets default configuration values for configuration keys that are not set in the Cutelyst configuratoin file.
Definition at line 39 of file memcached.cpp.
|
overrideprotectedvirtual |
Reads the configuration and sets up the plugin.
Reimplemented from Cutelyst::Plugin.
Definition at line 45 of file memcached.cpp.
References QString::at(), Cutelyst::Engine::config(), QObject::connect(), QByteArray::constData(), QList::empty(), Cutelyst::Application::engine(), QString::isEmpty(), QStringList::join(), Cutelyst::Application::loadTranslations(), Cutelyst::Application::postForked(), QList::push_back(), QString::replace(), QByteArray::size(), QStringView::split(), QString::startsWith(), QString::toUpper(), and QString::toUtf8().
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1796 of file memcached.h.
References QByteArrayView::count(), and touch().
|
static |
Updates the expiration time on an existing key.
[in] | key | key whose expiration time to update |
[in] | expiration | new expiration time in seconds |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 1132 of file memcached.cpp.
References QByteArrayView::constData(), and QByteArrayView::size().
Referenced by touch().
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1801 of file memcached.h.
References QByteArrayView::count(), and touchByKey().
|
static |
Updates the expiration time on an existing key in group groupKey.
This method behaves in a similar nature as Memcached::touch(). The difference is that it takes a groupKey that is used for determining which server an object was stored if key partitioning was used for storage.
[in] | groupKey | key to specify the server to update the key on |
[in] | key | key whose expiration time to update |
[in] | expiration | new expiration time in seconds |
[out] | returnType | optional pointer to a ReturnType variable that takes the return type of the operation |
true
on success; false
otherwise Definition at line 1154 of file memcached.cpp.
References QByteArrayView::constData(), and QByteArrayView::size().
Referenced by touchByKey().
|
static |
Expiration time constant that can be used in the increment/decrement with initial methods.
Definition at line 830 of file memcached.h.
|
static |
Expiration duration constant that can be used in the increment/decrement with initial methods.
Definition at line 839 of file memcached.h.