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,22 +7,20 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucoresessioncontainer
|
||||
#define headerfilecmslucoresessioncontainer
|
||||
#ifndef headerfile_winix_core_sessioncontainer
|
||||
#define headerfile_winix_core_sessioncontainer
|
||||
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <ctime>
|
||||
|
||||
#include "session.h"
|
||||
#include "lastcontainer.h"
|
||||
#include "request.h"
|
||||
#include "basethread.h"
|
||||
#include "cur.h"
|
||||
#include "config.h"
|
||||
|
||||
|
||||
|
||||
class SessionContainer : public BaseThread
|
||||
class SessionContainer
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -33,13 +31,14 @@ public:
|
||||
typedef std::list<Session> Table;
|
||||
typedef Table::iterator Iterator;
|
||||
typedef std::map<long, Iterator> IndexId;
|
||||
typedef IndexId::iterator IdIterator;
|
||||
|
||||
|
||||
SessionContainer();
|
||||
|
||||
void SetRequest(Request * prequest);
|
||||
void SetCur(Cur * pcur);
|
||||
void SetConfig(Config * pconfig);
|
||||
void SetLastContainer(LastContainer * plast_container);
|
||||
void SetTmpSession(Session * psession);
|
||||
|
||||
void Clear();
|
||||
|
||||
@@ -50,20 +49,19 @@ public:
|
||||
bool PushBack(const Session & session);
|
||||
Iterator FindById(long);
|
||||
|
||||
IdIterator IdBegin();
|
||||
IdIterator IdEnd();
|
||||
|
||||
void EraseById(IdIterator i);
|
||||
|
||||
private:
|
||||
|
||||
LastContainer * last_container;
|
||||
|
||||
Table table;
|
||||
IndexId index_id;
|
||||
|
||||
Request * request;
|
||||
Config * config;
|
||||
//void DelFromIdIndex(Iterator iter);
|
||||
virtual void Work();
|
||||
bool IsSessionOutdated(const Session & s) const;
|
||||
void DeleteSession(IndexId::iterator i);
|
||||
Cur * cur;
|
||||
Config * config;
|
||||
Session * tmp_session;
|
||||
|
||||
// in FreeBSD implementation (GCC) list::size() has linear complexity
|
||||
// so we use our own table_size with O(1)
|
||||
|
Reference in New Issue
Block a user