openMSX
Event.cc
Go to the documentation of this file.
1 #include "Event.hh"
2 #include "TclObject.hh"
3 
4 namespace openmsx {
5 
6 // class Event
7 
9  : type(type_)
10 {
11 }
12 
14 {
15 }
16 
18 {
19  return type;
20 }
21 
22 std::string Event::toString() const
23 {
24  TclObject result;
25  toStringImpl(result);
26  return result.getString().str();
27 }
28 
29 bool Event::operator<(const Event& other) const
30 {
31  return (getType() != other.getType())
32  ? (getType() < other.getType())
33  : lessImpl(other);
34 }
35 
36 bool Event::operator==(const Event& other) const
37 {
38  return !(*this < other) && !(other < *this);
39 }
40 bool Event::operator!=(const Event& other) const
41 {
42  return !(*this == other);
43 }
44 
46 {
47  result.addListElement("simple");
48  result.addListElement(int(getType()));
49 }
50 
51 bool SimpleEvent::lessImpl(const Event& /*other*/) const
52 {
53  return false;
54 }
55 
56 } // namespace openmsx