2009-01-31 07:53:36 +01:00
|
|
|
/*
|
2010-02-28 01:08:10 +01:00
|
|
|
* This file is a part of Winix
|
2009-01-31 07:53:36 +01:00
|
|
|
* and is not publicly distributed
|
|
|
|
*
|
2010-02-28 22:33:06 +01:00
|
|
|
* Copyright (c) 2008-2010, Tomasz Sowa
|
2009-01-31 07:53:36 +01:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2009-04-21 22:50:55 +02:00
|
|
|
#ifndef headerfilecmslucoresessioncontainer
|
|
|
|
#define headerfilecmslucoresessioncontainer
|
2009-01-31 07:53:36 +01:00
|
|
|
|
|
|
|
|
|
|
|
#include <list>
|
|
|
|
#include <map>
|
|
|
|
#include <ctime>
|
2009-04-21 22:50:55 +02:00
|
|
|
|
2009-01-31 07:53:36 +01:00
|
|
|
#include "session.h"
|
2010-08-10 18:12:50 +02:00
|
|
|
#include "lastcontainer.h"
|
2009-04-21 22:50:55 +02:00
|
|
|
|
2009-01-31 07:53:36 +01:00
|
|
|
|
|
|
|
|
|
|
|
class SessionContainer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef std::list<Session> Table;
|
|
|
|
typedef Table::iterator Iterator;
|
2009-11-21 00:09:52 +01:00
|
|
|
typedef Table::size_type TableSize;
|
2009-01-31 07:53:36 +01:00
|
|
|
|
|
|
|
typedef std::map<long, Iterator> IndexId;
|
|
|
|
typedef std::multimap<time_t, Iterator> IndexTime;
|
|
|
|
|
2010-08-10 18:12:50 +02:00
|
|
|
void SetLastContainer(LastContainer * plast_container);
|
|
|
|
|
2009-01-31 07:53:36 +01:00
|
|
|
private:
|
|
|
|
|
2010-08-10 18:12:50 +02:00
|
|
|
LastContainer * last_container;
|
|
|
|
|
2009-01-31 07:53:36 +01:00
|
|
|
Table table;
|
|
|
|
IndexId index_id;
|
|
|
|
IndexTime index_time;
|
|
|
|
|
|
|
|
void DelFromIdIndex(Iterator iter);
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
void Clear();
|
2009-11-21 00:09:52 +01:00
|
|
|
|
|
|
|
TableSize Size();
|
|
|
|
|
2009-01-31 07:53:36 +01:00
|
|
|
Iterator Begin();
|
|
|
|
Iterator End();
|
|
|
|
|
|
|
|
Session & Back();
|
|
|
|
|
|
|
|
bool PushBack(const Session & session);
|
|
|
|
Iterator FindById(long);
|
|
|
|
|
2009-11-21 00:09:52 +01:00
|
|
|
void DelFirstByTimeInterval(time_t interval, bool skip_remember_flag = true);
|
|
|
|
|
2009-01-31 07:53:36 +01:00
|
|
|
void UpdateLastTime(Iterator iter, time_t new_time);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|