blob: 11dd29ab79875c2b2adfeac6aba30ed0806dc518 [file] [log] [blame]
akmhoque66e66182014-02-21 17:56:03 -06001/* -*- 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>
Vince Lehman0a7da612014-10-29 14:39:29 -050020 * Alexander Afanasyev <alexander.afanasyev@ucla.edu>
akmhoque66e66182014-02-21 17:56:03 -060021 */
22
23#ifndef SYNC_LOGIC_EVENT_CONTAINER_H
24#define SYNC_LOGIC_EVENT_CONTAINER_H
25
26#include "sync-event.h"
27
akmhoque66e66182014-02-21 17:56:03 -060028#include <boost/date_time/posix_time/posix_time_types.hpp>
29
30#include <boost/multi_index_container.hpp>
31// #include <boost/multi_index/tag.hpp>
32#include <boost/multi_index/ordered_index.hpp>
33// #include <boost/multi_index/composite_key.hpp>
34// #include <boost/multi_index/hashed_index.hpp>
35// #include <boost/multi_index/random_access_index.hpp>
36#include <boost/multi_index/member.hpp>
37// #include <boost/multi_index/mem_fun.hpp>
38
39namespace mi = boost::multi_index;
40
41namespace Sync
42{
43
44struct LogicEvent
45{
46 LogicEvent (const boost::system_time &_time, Event _event, uint32_t _label)
47 : time (_time)
48 , event (_event)
49 , lbl (_label)
50 { }
Vince Lehman0a7da612014-10-29 14:39:29 -050051
akmhoque66e66182014-02-21 17:56:03 -060052 boost::system_time time;
53 Event event;
54 uint32_t lbl;
55};
56
57/// @cond include_hidden
58struct byLabel { } ;
59/// @endcond
60
61/**
62 * \ingroup sync
63 * @brief ???
64 */
65struct EventsContainer : public mi::multi_index_container<
66 LogicEvent,
67 mi::indexed_by<
68
69 mi::ordered_non_unique<
70 mi::member<LogicEvent, boost::system_time, &LogicEvent::time>
71 >,
72
73 mi::ordered_non_unique<
74 mi::tag<byLabel>,
75 mi::member<LogicEvent, uint32_t, &LogicEvent::lbl>
76 >
77 >
78 >
79{
80};
81
82} // Sync
83
84#endif // SYNC_LOGIC_EVENT_CONTAINER_H