CppCMS
session_api.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_API_H
9 #define CPPCMS_SESSION_API_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 
18 class session_interface;
19 
20 
33 {
34 public:
44  virtual void save(session_interface &iface,std::string const &data,time_t timeout, bool new_data, bool on_server) = 0;
45 
53  virtual bool load(session_interface &iface,std::string &data,time_t &timeout) = 0;
59  virtual void clear(session_interface &iface) = 0;
60 
64  virtual bool is_blocking() = 0;
65 
69  virtual ~session_api() {}
70 };
71 
72 
77 public:
82  virtual bool requires_gc() = 0;
86  virtual void gc() = 0;
87 
91  virtual booster::shared_ptr<session_api> get() = 0;
92 
96  virtual ~session_api_factory() {}
97 };
98 
99 
100 } // cppcms
101 
102 #endif
virtual void save(session_interface &iface, std::string const &data, time_t timeout, bool new_data, bool on_server)=0
virtual bool load(session_interface &iface, std::string &data, time_t &timeout)=0
virtual void clear(session_interface &iface)=0
This class provides an access to an application for session management.
Definition: session_interface.h:107
virtual ~session_api()
Definition: session_api.h:69
This is the namespace where all CppCMS functionality is placed.
Definition: application.h:19
virtual ~session_api_factory()
Definition: session_api.h:96
Definition: log.h:25
the factory object that generates custom implemented session_api objects
Definition: session_api.h:76
This class represents the most generic implementation of session storage device.
Definition: session_api.h:32
virtual bool is_blocking()=0
This class makes impossible to copy any class derived from this one.
Definition: noncopyable.h:15