68 lines
1.1 KiB
C++
Executable File
68 lines
1.1 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 headerfilecmslucoresessioncontainer
|
|
#define headerfilecmslucoresessioncontainer
|
|
|
|
|
|
#include <list>
|
|
#include <map>
|
|
#include <ctime>
|
|
|
|
#include "session.h"
|
|
#include "lastcontainer.h"
|
|
|
|
|
|
|
|
class SessionContainer
|
|
{
|
|
public:
|
|
typedef std::list<Session> Table;
|
|
typedef Table::iterator Iterator;
|
|
typedef Table::size_type TableSize;
|
|
|
|
typedef std::map<long, Iterator> IndexId;
|
|
typedef std::multimap<time_t, Iterator> IndexTime;
|
|
|
|
void SetLastContainer(LastContainer * plast_container);
|
|
|
|
private:
|
|
|
|
LastContainer * last_container;
|
|
|
|
Table table;
|
|
IndexId index_id;
|
|
IndexTime index_time;
|
|
|
|
void DelFromIdIndex(Iterator iter);
|
|
|
|
|
|
public:
|
|
|
|
void Clear();
|
|
|
|
TableSize Size();
|
|
|
|
Iterator Begin();
|
|
Iterator End();
|
|
|
|
Session & Back();
|
|
|
|
bool PushBack(const Session & session);
|
|
Iterator FindById(long);
|
|
|
|
void DelFirstByTimeInterval(time_t interval, bool skip_remember_flag = true);
|
|
|
|
void UpdateLastTime(Iterator iter, time_t new_time);
|
|
|
|
};
|
|
|
|
|
|
#endif
|