winix/core/sessionmanager.h

67 lines
1.2 KiB
C++
Executable File

/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2008-2010, Tomasz Sowa
* All rights reserved.
*
*/
#ifndef headerfilecmslucoresessionmanager
#define headerfilecmslucoresessionmanager
#include <set>
#include <ctime>
#include "sessioncontainer.h"
#include "config.h"
#include "request.h"
#include "lastcontainer.h"
#include "system.h"
#include "synchro.h"
class SessionManager
{
Config * config;
Request * request;
System * system;
SessionContainer session_tab;
bool IsSession(long s);
long CreateSessionId();
void CreateTemporarySession();
void CreateSession();
bool SetSessionFromCookie(const std::string & cookie);
public:
SessionManager();
void SetRequest(Request * prequest);
void SetConfig(Config * pconfig);
void SetSystem(System * psystem);
void SetLastContainer(LastContainer * plast_container);
void SetSynchro(Synchro * psynchro);
void SetSession();
void DeleteSessions(); // deleting all sessions
void StartGC();
void PrepareToStopGC();
void WaitForGC();
void LoadSessions();
void SaveSessions();
SessionContainer::Iterator SessionBegin();
SessionContainer::Iterator SessionEnd();
size_t Size();
};
#endif