OverSim
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
I3Trigger.cc
Go to the documentation of this file.
1
// Copyright (C) 2006 Institut fuer Telematik, Universitaet Karlsruhe (TH)
2
//
3
// This program is free software; you can redistribute it and/or
4
// modify it under the terms of the GNU General Public License
5
// as published by the Free Software Foundation; either version 2
6
// of the License, or (at your option) any later version.
7
//
8
// This program is distributed in the hope that it will be useful,
9
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
// GNU General Public License for more details.
12
//
13
// You should have received a copy of the GNU General Public License
14
// along with this program; if not, write to the Free Software
15
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16
//
17
23
#include "
I3Trigger.h
"
24
25
I3Trigger::I3Trigger
() :
26
insertionTime(0)
27
{
28
}
29
30
int
I3Trigger::compareTo
(
const
I3Trigger
&t)
const
31
{
32
int
cmp =
identifier
.
compareTo
(t.
identifier
);
33
return
(cmp != 0) ? cmp :
identifierStack
.
compareTo
(t.
identifierStack
);
34
}
35
36
bool
I3Trigger::operator <
(
const
I3Trigger
&t)
const
37
{
38
return
compareTo
(t) < 0;
39
}
40
41
bool
I3Trigger::operator >
(
const
I3Trigger
&t)
const
42
{
43
return
compareTo
(t) > 0;
44
}
45
46
bool
I3Trigger::operator ==
(
const
I3Trigger
&t)
const
47
{
48
return
compareTo
(t) == 0;
49
}
50
51
52
void
I3Trigger::setIdentifier
(
const
I3Identifier
&
id
)
53
{
54
identifier
= id;
55
}
56
57
void
I3Trigger::setInsertionTime
(simtime_t time)
58
{
59
insertionTime
= time;
60
}
61
62
void
I3Trigger::setIdentifierStack
(
I3IdentifierStack
&stack)
63
{
64
identifierStack
= stack;
65
}
66
67
I3Identifier
&
I3Trigger::getIdentifier
()
68
{
69
return
identifier
;
70
}
71
72
const
I3Identifier
&
I3Trigger::getIdentifier
()
const
73
{
74
return
identifier
;
75
}
76
77
simtime_t
I3Trigger::getInsertionTime
()
const
78
{
79
return
insertionTime
;
80
}
81
82
void
I3Trigger::clear
()
83
{
84
identifier
.
clear
();
85
identifierStack
.
clear
();
86
}
87
88
I3IdentifierStack
&
I3Trigger::getIdentifierStack
()
89
{
90
return
identifierStack
;
91
}
92
93
const
I3IdentifierStack
&
I3Trigger::getIdentifierStack
()
const
94
{
95
return
identifierStack
;
96
}
97
98
int
I3Trigger::length
()
const
{
99
/* insertionTime is an internal variable and doesn't count as part of the message */
100
return
identifier
.
length
() +
identifierStack
.
length
();
101
}
102
103
std::ostream&
operator<<
(std::ostream& os,
const
I3Trigger
&t)
104
{
105
os <<
"("
<< t.
identifier
<<
", {"
<< t.
identifierStack
<<
"})"
;
106
return
os;
107
}
108
src
applications
i3
I3Trigger.cc
Generated on Fri Dec 7 2012 13:37:52 for OverSim by
1.8.1.2