cutelyst  4.5.1
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
memcachedsessionstore.h
1 /*
2  * SPDX-FileCopyrightText: (C) 2017-2023 Matthias Fehring <mf@huessenbergnetz.de>
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 #ifndef CUTELYSTMEMCACHEDSESSIONSTORE_H
6 #define CUTELYSTMEMCACHEDSESSIONSTORE_H
7 
8 #include <Cutelyst/Plugins/Session/session.h>
9 #include <Cutelyst/Plugins/memcachedsessionstore_export.h>
10 
11 namespace Cutelyst {
12 
13 class Application;
14 class MemcachedSessionStorePrivate;
15 
77 class CUTELYST_PLUGIN_MEMCACHEDSESSIONSTORE_EXPORT MemcachedSessionStore final : public SessionStore
78 {
79  Q_OBJECT
80  Q_DECLARE_PRIVATE(MemcachedSessionStore) // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
81  Q_DISABLE_COPY(MemcachedSessionStore)
82 public:
88  MemcachedSessionStore(Application *app, QObject *parent = nullptr);
89 
93  ~MemcachedSessionStore() override;
94 
95  QVariant getSessionData(Context *c,
96  const QByteArray &sid,
97  const QString &key,
98  const QVariant &defaultValue) override;
99 
100  bool storeSessionData(Context *c,
101  const QByteArray &sid,
102  const QString &key,
103  const QVariant &value) override;
104 
105  bool deleteSessionData(Context *c, const QByteArray &sid, const QString &key) override;
106 
107  bool deleteExpiredSessions(Context *c, quint64 expires) override;
108 
113  void setGroupKey(const QByteArray &groupKey);
114 
115 private:
116  std::unique_ptr<MemcachedSessionStorePrivate> d_ptr;
117 };
118 
119 } // namespace Cutelyst
120 
121 #endif // CUTELYSTMEMCACHEDSESSIONSTORE_H
The Cutelyst application.
Definition: application.h:66
The Cutelyst Context.
Definition: context.h:42
Memcached based session store.
Abstract class to create a session store.
Definition: session.h:36
The Cutelyst namespace holds all public Cutelyst API.