-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBoundedEvent.cxx
109 lines (91 loc) · 2.21 KB
/
BoundedEvent.cxx
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*ckwg +5
* Copyright 2010 by Kitware, Inc. All Rights Reserved. Please refer to
* KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
* Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
*/
#include <BoundedEvent.h>
#include <EventManager.h>
#include <RightTrackDefs.h>
namespace RightTrack {
// ----------------------------------------------------------------
/** Constructor.
*
* @param[in] name - descriptive name for this event. A method or
* function name is good for events that cover the whole function or
* method.
*
* @param[in] group - name for logically grouping events. Method
* events that all relate to the same class could be grouped under the
* class name. Groups can be hierarchically composed using
* '.'separated names, such as "foo.bar".
*
* @param[in] color - a 24 bit value specifying the RGB components
* using the HTML color encoding scheme. You can use a set of
* predefined color names or just encode them as a literal.
*/
BoundedEvent::
BoundedEvent(vcl_string name, vcl_string group, int color)
: Event(name, group, color)
{
Manager()->RegisterEvent(this);
}
BoundedEvent::
~BoundedEvent()
{
// Terminate event if still running
if (m_started)
{
End();
m_started = false;
}
}
// ----------------------------------------------------------------
/** Start bounded event;
*
*
*/
void BoundedEvent::
Start( ::RightTrack::EventData_t val )
{
// See if the event is still running
if (m_started)
{
// TBD
}
Manager()->StartEvent( this, val );
m_started = true;
}
// ----------------------------------------------------------------
/** End bounded event.
*
*
*/
void BoundedEvent::
End( ::RightTrack::EventData_t val )
{
// Test for eventrunning
if (m_started)
{
Manager()->EndEvent( this, val );
}
m_started = false;
}
// ----------------------------------------------------------------
/** Return our event type.
*
*
*/
Internal::Event::EventType_t BoundedEvent::
EventType() const
{
return ::RightTrack::Internal::Event::ET_BOUNDED_EVENT;
}
} // end namespace
// Local Variables:
// mode: c++
// fill-column: 70
// c-tab-width: 2
// c-basic-offset: 2
// c-basic-indent: 2
// c-indent-tabs-mode: nil
// end: