-
Notifications
You must be signed in to change notification settings - Fork 0
/
event_container.cpp
45 lines (35 loc) · 1.13 KB
/
event_container.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "event_container.h"
using mtm::EventContainer;
using mtm::BaseEvent;
EventContainer::EventContainer(): events(){}
void EventContainer::add(const BaseEvent& event)
{
this->events.add(event.clone());
}
EventContainer::EventIterator EventContainer::begin() const
{
return EventIterator(this->events.begin());
}
EventContainer::EventIterator EventContainer::end() const
{
return EventIterator(this->events.end());
}
EventContainer::EventIterator::EventIterator(const mtm::PointerList::ListIterator& listIter): listIter(listIter){}
EventContainer::EventIterator EventContainer::EventIterator::operator++()
{
return ++(this->listIter);
}
const BaseEvent& EventContainer::EventIterator::operator*() const{
return *(this->listIter);
}
BaseEvent& EventContainer::EventIterator::operator*(){
return *(this->listIter);
}
bool EventContainer::EventIterator::operator==(const EventContainer::EventIterator& iterator) const
{
return this->listIter == iterator.listIter;
}
bool EventContainer::EventIterator::operator!=(const EventContainer::EventIterator& iterator) const
{
return this->listIter != iterator.listIter;
}