session_api.h
//
// Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) <artyomtnk@yahoo.com>
//
// See accompanying file COPYING.TXT file for licensing details.
//
#ifndef CPPCMS_SESSION_API_H
#define CPPCMS_SESSION_API_H
#include <cppcms/defs.h>
#include <booster/noncopyable.h>
#include <booster/shared_ptr.h>
#include <string>
namespace cppcms {
class session_interface;
class session_api : public booster::noncopyable
{
public:
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;
virtual bool is_blocking() = 0;
virtual ~session_api() {}
};
class session_api_factory {
public:
virtual bool requires_gc() = 0;
virtual void gc() = 0;
virtual booster::shared_ptr<session_api> get() = 0;
virtual ~session_api_factory() {}
};
} // cppcms
#endif
cppcms::session_api::save
virtual void save(session_interface &iface, std::string const &data, time_t timeout, bool new_data, bool on_server)=0
cppcms::session_api::load
virtual bool load(session_interface &iface, std::string &data, time_t &timeout)=0
cppcms::session_api_factory::gc
virtual void gc()=0
cppcms::session_api_factory::requires_gc
virtual bool requires_gc()=0
cppcms::session_api::clear
virtual void clear(session_interface &iface)=0
cppcms::session_interface
This class provides an access to an application for session management.
Definition: session_interface.h:69
cppcms::session_api::~session_api
virtual ~session_api()
Definition: session_api.h:69
cppcms::session_api_factory::~session_api_factory
virtual ~session_api_factory()
Definition: session_api.h:96
booster::shared_ptr
Definition: log.h:25
cppcms::session_api_factory
the factory object that generates custom implemented session_api objects
Definition: session_api.h:76
cppcms::session_api
This class represents the most generic implementation of session storage device.
Definition: session_api.h:32
cppcms::session_api::is_blocking
virtual bool is_blocking()=0
booster::noncopyable
This class makes impossible to copy any class derived from this one.
Definition: noncopyable.h:15