Nuria Framework - Core
Core module of the NuriaProject Framework
 All Classes Functions Typedefs Enumerations Enumerator Groups
abstractsessionmanager.hpp
1 /* Copyright (c) 2014, The Nuria Project
2  * This software is provided 'as-is', without any express or implied
3  * warranty. In no event will the authors be held liable for any damages
4  * arising from the use of this software.
5  * Permission is granted to anyone to use this software for any purpose,
6  * including commercial applications, and to alter it and redistribute it
7  * freely, subject to the following restrictions:
8  * 1. The origin of this software must not be misrepresented; you must not
9  * claim that you wrote the original software. If you use this software
10  * in a product, an acknowledgment in the product documentation would be
11  * appreciated but is not required.
12  * 2. Altered source versions must be plainly marked as such, and must not be
13  * misrepresented as being the original software.
14  * 3. This notice may not be removed or altered from any source
15  * distribution.
16  */
17 
18 #ifndef NURIA_ABSTRACTSESSIONMANAGER_HPP
19 #define NURIA_ABSTRACTSESSIONMANAGER_HPP
20 
21 #include "essentials.hpp"
22 #include "session.hpp"
23 #include <QObject>
24 
25 namespace Nuria {
26 
55 class NURIA_CORE_EXPORT AbstractSessionManager : public QObject {
56  Q_OBJECT
57 public:
58  explicit AbstractSessionManager (QObject *parent = nullptr);
59 
66  virtual Session create ();
67 
71  virtual bool exists (const QByteArray &id) = 0;
72 
83  virtual Session get (const QByteArray &id) = 0;
84 
85 protected:
94  virtual QByteArray generateNewId ();
95 
97  Session createSession (const QByteArray& id);
98 
99 public slots:
101  virtual void removeSession (const QByteArray &id) = 0;
102 
103 };
104 
105 } // namespace Nuria
106 
107 #endif // NURIA_ABSTRACTSESSIONMANAGER_HPP
Interface for a session manager.
Definition: abstractsessionmanager.hpp:55
A data storage managed by an AbstractSessionManager.
Definition: session.hpp:45