CppCMS

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

session_storage.h
1 //
3 // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) <artyomtnk@yahoo.com>
4 //
5 // See accompanying file COPYING.TXT file for licensing details.
6 //
8 #ifndef CPPCMS_SESSION_STORAGE_H
9 #define CPPCMS_SESSION_STORAGE_H
10
11 #include <cppcms/defs.h>
12 #include <booster/noncopyable.h>
13 #include <booster/shared_ptr.h>
14 #include <string>
15
16 namespace cppcms {
17 namespace json {
18 class value;
19 }
20 namespace sessions {
21
30
31 class session_storage : public booster::noncopyable
32 {
33 public:
37
38 virtual void save(std::string const &sid,time_t timeout,std::string const &in) = 0;
39
44 virtual bool load(std::string const &sid,time_t &timeout,std::string &out) = 0;
45
49
50 virtual void remove(std::string const &sid) = 0;
51
55 virtual bool is_blocking() = 0;
56
57
61 virtual ~session_storage()
62 {
63 }
64 };
65
69 class session_storage_factory {
70 public:
75 virtual booster::shared_ptr<session_storage> get() = 0;
76
80 virtual bool requires_gc() = 0;
85 virtual void gc_job() {}
89 virtual ~session_storage_factory() {}
90 };
91
92 extern "C" {
93 typedef session_storage_factory *(*cppcms_session_storage_generator_type)(cppcms::json::value const &options);
94 }
95
96
97 } // sessions
98 } // cppcms
99
100
101 #endif
cppcms::sessions::session_storage_factory::~session_storage_factory
virtual ~session_storage_factory()
Definition: session_storage.h:89
cppcms::json::value
This class is central representation of json objects.
Definition: json.h:140
cppcms
This is the namespace where all CppCMS functionality is placed.
Definition: application.h:19
cppcms::sessions::session_storage_factory::gc_job
virtual void gc_job()
Definition: session_storage.h:85
booster::shared_ptr
Definition: log.h:25
cppcms::sessions::session_storage::~session_storage
virtual ~session_storage()
Definition: session_storage.h:61
cppcms::sessions::session_storage
session_server_storage is an abstract class that allows user to implements custom session storage dev...
Definition: session_storage.h:31
booster::noncopyable
This class makes impossible to copy any class derived from this one.
Definition: noncopyable.h:15
cppcms::sessions::session_storage_factory
The factory is an interface to a factory that creates session_storage objects, it should be thread sa...
Definition: session_storage.h:69