changed: added Cur structure
we have there two pointers: Request * request; Session * session; these are the current request and the current session the session GC was moved to SessionManager (was in SessionContainer) git-svn-id: svn://ttmath.org/publicrep/winix/trunk@708 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucoresessionmanager
|
||||
#define headerfilecmslucoresessionmanager
|
||||
#ifndef headerfile_winix_core_sessionmanager
|
||||
#define headerfile_winix_core_sessionmanager
|
||||
|
||||
#include <set>
|
||||
#include <ctime>
|
||||
@@ -19,39 +19,29 @@
|
||||
#include "lastcontainer.h"
|
||||
#include "system.h"
|
||||
#include "synchro.h"
|
||||
#include "basethread.h"
|
||||
|
||||
|
||||
|
||||
class SessionManager
|
||||
class SessionManager : public BaseThread
|
||||
{
|
||||
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 SetCur(Cur * pcur);
|
||||
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 InitTmpSession();
|
||||
void UninitTmpSession();
|
||||
|
||||
Session * GetTmpSession();
|
||||
Session * GetCurSession();
|
||||
|
||||
void LoadSessions();
|
||||
void SaveSessions();
|
||||
@@ -60,6 +50,40 @@ public:
|
||||
SessionContainer::Iterator SessionEnd();
|
||||
|
||||
size_t Size();
|
||||
|
||||
private:
|
||||
|
||||
Config * config;
|
||||
Cur * cur;
|
||||
System * system;
|
||||
|
||||
LastContainer * last_container;
|
||||
|
||||
// current session - set by SetSession()
|
||||
Session * session;
|
||||
|
||||
SessionContainer session_tab;
|
||||
|
||||
// session with id 0
|
||||
Session temporary_session;
|
||||
|
||||
// for adding a new session to the container
|
||||
Session new_session;
|
||||
|
||||
bool IsSession(long s);
|
||||
|
||||
long CreateSessionId();
|
||||
void CreateSession();
|
||||
bool SetSessionFromCookie(const std::string & cookie);
|
||||
|
||||
|
||||
// second thread
|
||||
int deleted;
|
||||
virtual void Work();
|
||||
void CheckSession(SessionContainer::IndexId::iterator & i);
|
||||
bool IsSessionOutdated(const Session & s) const;
|
||||
void DeleteSession(SessionContainer::IdIterator i);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user