blob: 3b99d765ea6403d33afa65ae896dea743e3b6406 [file] [log] [blame]
Alexander Afanasyev45fba082012-03-12 18:05:24 -07001/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
2/*
3 * Copyright (c) 2012 University of California, Los Angeles
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
19 * 卞超轶 Chaoyi Bian <bcy@pku.edu.cn>
20 * Alexander Afanasyev <alexander.afanasyev@ucla.edu>
21 */
22
23#ifndef SYNC_LOGIC_EVENT_CONTAINER_H
24#define SYNC_LOGIC_EVENT_CONTAINER_H
25
26#include <boost/function.hpp>
27#include <boost/date_time/posix_time/posix_time_types.hpp>
28
29#include <boost/multi_index_container.hpp>
30// #include <boost/multi_index/tag.hpp>
31#include <boost/multi_index/ordered_index.hpp>
32// #include <boost/multi_index/composite_key.hpp>
33// #include <boost/multi_index/hashed_index.hpp>
34// #include <boost/multi_index/random_access_index.hpp>
35#include <boost/multi_index/member.hpp>
36// #include <boost/multi_index/mem_fun.hpp>
37
38namespace mi = boost::multi_index;
39
40namespace Sync
41{
42
43typedef boost::function< void ( ) > Event;
44
45struct LogicEvent
46{
47 LogicEvent (const boost::system_time &_time, Event _event)
48 : time (_time)
49 , event (_event)
50 { }
51
52 boost::system_time time;
53 Event event;
54};
55
56/**
57 * \ingroup sync
58 * @brief ???
59 */
60struct EventsContainer : public mi::multi_index_container<
61 LogicEvent,
62 mi::indexed_by<
63
64 mi::ordered_non_unique<
65 mi::member<LogicEvent, boost::system_time, &LogicEvent::time>
66 >
67 >
68 >
69{
70};
71
72} // Sync
73
74#endif // SYNC_LOGIC_EVENT_CONTAINER_H