session_pool.h
//
// Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) <artyomtnk@yahoo.com>
//
// See accompanying file COPYING.TXT file for licensing details.
//
#ifndef CPPCMS_SESSION_POOL_H
#define CPPCMS_SESSION_POOL_H
#include <cppcms/defs.h>
#include <booster/shared_ptr.h>
#include <booster/hold_ptr.h>
#include <cppcms/session_api.h>
#include <memory>
namespace cppcms {
class service;
namespace sessions {
class encryptor_factory;
class session_storage_factory;
};
class CPPCMS_API session_pool: public booster::noncopyable {
public:
session_pool(service &srv);
~session_pool();
void init();
booster::shared_ptr<session_api> get();
void backend(std::auto_ptr<session_api_factory> b);
void encryptor(std::auto_ptr<sessions::encryptor_factory> e);
void storage(std::auto_ptr<sessions::session_storage_factory> s);
private:
void after_fork();
struct cookies_factory;
struct dual_factory;
struct sid_factory;
class gc_job;
template<typename Encryptor>
struct enc_factory;
template<typename Encryptor>
struct enc_factory_param;
struct _data;
friend struct cookies_factory;
friend struct dual_factory;
friend struct sid_factory;
friend class gc_job;
booster::hold_ptr<_data> d;
std::auto_ptr<session_api_factory> backend_;
std::auto_ptr<sessions::encryptor_factory> encryptor_;
std::auto_ptr<sessions::session_storage_factory> storage_;
service *service_;
};
}
#endif
booster::hold_ptr< _data >
cppcms::service
This class represent the central event loop of the CppCMS applications.
Definition: service.h:59
booster::shared_ptr
Definition: log.h:25
cppcms::session_pool
This class provides an access to session management backends an allow customization.
Definition: session_pool.h:32
booster::noncopyable
This class makes impossible to copy any class derived from this one.
Definition: noncopyable.h:15