CppCMS
cppcms/session_api.h
00001 
00002 //                                                                             
00003 //  Copyright (C) 2008-2012  Artyom Beilis (Tonkikh) <artyomtnk@yahoo.com>     
00004 //                                                                             
00005 //  See accompanying file COPYING.TXT file for licensing details.
00006 //
00008 #ifndef CPPCMS_SESSION_API_H
00009 #define CPPCMS_SESSION_API_H
00010 
00011 #include <cppcms/defs.h>
00012 #include <booster/noncopyable.h>
00013 #include <booster/shared_ptr.h>
00014 #include <string>
00015 
00016 namespace cppcms {
00017 
00018 class session_interface;
00019 
00020 
00032 class session_api : public booster::noncopyable
00033 {
00034 public:
00044         virtual void save(session_interface &iface,std::string const &data,time_t timeout, bool new_data, bool on_server) = 0;
00045 
00053         virtual bool load(session_interface &iface,std::string &data,time_t &timeout) = 0;
00059         virtual void clear(session_interface &iface) = 0;
00060 
00064         virtual bool is_blocking() = 0;
00065 
00069         virtual ~session_api() {}
00070 };
00071 
00072 
00076 class session_api_factory {
00077 public:
00082         virtual bool requires_gc() = 0; 
00086         virtual void gc() = 0;
00087 
00091         virtual booster::shared_ptr<session_api> get() = 0;
00092 
00096         virtual ~session_api_factory() {}
00097 };
00098 
00099 
00100 } // cppcms
00101 
00102 #endif