session_storage.h
//
// Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) <artyomtnk@yahoo.com>
//
// See accompanying file COPYING.TXT file for licensing details.
//
#ifndef CPPCMS_SESSION_STORAGE_H
#define CPPCMS_SESSION_STORAGE_H
#include <cppcms/defs.h>
#include <booster/noncopyable.h>
#include <booster/shared_ptr.h>
#include <string>
namespace cppcms {
namespace json {
class value;
}
namespace sessions {
class session_storage : public booster::noncopyable
{
public:
virtual void save(std::string const &sid,time_t timeout,std::string const &in) = 0;
virtual bool load(std::string const &sid,time_t &timeout,std::string &out) = 0;
virtual void remove(std::string const &sid) = 0;
virtual bool is_blocking() = 0;
virtual ~session_storage()
{
}
};
class session_storage_factory {
public:
virtual booster::shared_ptr<session_storage> get() = 0;
virtual bool requires_gc() = 0;
virtual void gc_job() {}
virtual ~session_storage_factory() {}
};
extern "C" {
typedef session_storage_factory *(*cppcms_session_storage_generator_type)(cppcms::json::value const &options);
}
} // sessions
} // cppcms
#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:142
cppcms::sessions::session_storage::save
virtual void save(std::string const &sid, time_t timeout, std::string const &in)=0
cppcms::sessions::session_storage_factory::gc_job
virtual void gc_job()
Definition: session_storage.h:85
cppcms::sessions::session_storage::load
virtual bool load(std::string const &sid, time_t &timeout, std::string &out)=0
booster::shared_ptr
Definition: log.h:25
cppcms::sessions::session_storage_factory::requires_gc
virtual bool requires_gc()=0
cppcms::sessions::session_storage::~session_storage
virtual ~session_storage()
Definition: session_storage.h:61
cppcms::sessions::session_storage::is_blocking
virtual bool is_blocking()=0
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