Commit | Line | Data |
---|---|---|
8c8bf09f ASL |
1 | /******************************************************************************* |
2 | * Copyright (c) 2009 Ericsson | |
3 | * | |
4 | * All rights reserved. This program and the accompanying materials are | |
5 | * made available under the terms of the Eclipse Public License v1.0 which | |
6 | * accompanies this distribution, and is available at | |
7 | * http://www.eclipse.org/legal/epl-v10.html | |
8 | * | |
9 | * Contributors: | |
10 | * Francois Chouinard - Initial API and implementation | |
11 | *******************************************************************************/ | |
12 | ||
13 | package org.eclipse.linuxtools.tmf.trace; | |
14 | ||
ff4ed569 | 15 | import org.eclipse.linuxtools.tmf.component.ITmfComponent; |
8c8bf09f ASL |
16 | import org.eclipse.linuxtools.tmf.event.TmfEvent; |
17 | import org.eclipse.linuxtools.tmf.event.TmfTimeRange; | |
18 | import org.eclipse.linuxtools.tmf.event.TmfTimestamp; | |
19 | ||
20 | /** | |
146a887c | 21 | * <b><u>ITmfTrace</u></b> |
8c8bf09f ASL |
22 | * <p> |
23 | */ | |
ff4ed569 | 24 | public interface ITmfTrace extends ITmfComponent { |
377f1ad8 WB |
25 | |
26 | public ITmfTrace createTraceCopy(); | |
27 | ||
b0a282fb FC |
28 | /** |
29 | * @return the trace path | |
30 | */ | |
31 | public String getPath(); | |
32 | ||
8c8bf09f | 33 | /** |
146a887c | 34 | * @return the trace name |
8c8bf09f | 35 | */ |
d4011df2 | 36 | @Override |
8c8bf09f | 37 | public String getName(); |
b0a282fb | 38 | |
abfad0aa FC |
39 | /** |
40 | * @return the cache size | |
41 | */ | |
42 | public int getCacheSize(); | |
43 | ||
8c8bf09f | 44 | /** |
146a887c | 45 | * @return the number of events in the trace |
8c8bf09f | 46 | */ |
4e3aa37d | 47 | public long getNbEvents(); |
8c8bf09f ASL |
48 | |
49 | /** | |
4e3aa37d | 50 | * Trace time range accessors |
8c8bf09f | 51 | */ |
146a887c FC |
52 | public TmfTimeRange getTimeRange(); |
53 | public TmfTimestamp getStartTime(); | |
54 | public TmfTimestamp getEndTime(); | |
62d1696a | 55 | |
ff4ed569 | 56 | /** |
146a887c | 57 | * Positions the trace at the first event with the specified |
4e3aa37d FC |
58 | * timestamp or index (i.e. the nth event in the trace). |
59 | * | |
60 | * Returns a context which can later be used to read the event. | |
8c8bf09f | 61 | * |
8d2e2848 FC |
62 | * @param data.timestamp |
63 | * @param data.index | |
8c8bf09f ASL |
64 | * @return a context object for subsequent reads |
65 | */ | |
452ad365 | 66 | public TmfContext seekLocation(ITmfLocation<?> location); |
9f584e4c FC |
67 | public TmfContext seekEvent(TmfTimestamp timestamp); |
68 | public TmfContext seekEvent(long rank); | |
146a887c | 69 | |
c76c54bb FC |
70 | /** |
71 | * Positions the trace at the event located at the specified ratio. | |
72 | * | |
73 | * Returns a context which can later be used to read the event. | |
74 | * | |
75 | * @param ratio a floating-point number between 0.0 (beginning) and 1.0 (end) | |
76 | * @return a context object for subsequent reads | |
77 | */ | |
78 | public TmfContext seekLocation(double ratio); | |
79 | ||
80 | /** | |
81 | * Returns the ratio corresponding to the specified location. | |
82 | * | |
83 | * @param location a trace location | |
84 | * @return a floating-point number between 0.0 (beginning) and 1.0 (end) | |
85 | */ | |
86 | public double getLocationRatio(ITmfLocation<?> location); | |
87 | ||
88 | public ITmfLocation<?> getCurrentLocation(); | |
89 | ||
abfad0aa FC |
90 | /** |
91 | * Returns the rank of the first event with the requested timestamp. | |
92 | * If none, returns the index of the next event (if any). | |
93 | * | |
94 | * @param timestamp | |
95 | * @return | |
96 | */ | |
97 | public long getRank(TmfTimestamp timestamp); | |
98 | ||
146a887c | 99 | /** |
8d2e2848 FC |
100 | * Return the event pointed by the supplied context (or null if |
101 | * no event left) and updates the context to the next event. | |
8c8bf09f ASL |
102 | * |
103 | * @return the next event in the stream | |
104 | */ | |
9f584e4c | 105 | public TmfEvent getNextEvent(TmfContext context); |
62d1696a | 106 | |
e31e01e8 FC |
107 | /** |
108 | * Return the event pointed by the supplied context (or null if | |
109 | * no event left) and *does not* update the context. | |
110 | * | |
111 | * @return the next event in the stream | |
112 | */ | |
9f584e4c | 113 | public TmfEvent parseEvent(TmfContext context); |
e31e01e8 | 114 | |
8c8bf09f | 115 | } |