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 | ||
8c8bf09f ASL |
15 | import org.eclipse.linuxtools.tmf.event.TmfEvent; |
16 | import org.eclipse.linuxtools.tmf.event.TmfTimeRange; | |
17 | import org.eclipse.linuxtools.tmf.event.TmfTimestamp; | |
18 | ||
19 | /** | |
146a887c | 20 | * <b><u>ITmfTrace</u></b> |
8c8bf09f ASL |
21 | * <p> |
22 | */ | |
62d1696a | 23 | public interface ITmfTrace { |
377f1ad8 WB |
24 | |
25 | public ITmfTrace createTraceCopy(); | |
26 | ||
27 | ||
b0a282fb FC |
28 | /** |
29 | * @return the trace path | |
30 | */ | |
31 | public String getPath(); | |
32 | ||
8c8bf09f | 33 | /** |
146a887c | 34 | * @return the trace name |
8c8bf09f ASL |
35 | */ |
36 | public String getName(); | |
b0a282fb | 37 | |
8c8bf09f | 38 | /** |
146a887c | 39 | * @return the number of events in the trace |
8c8bf09f | 40 | */ |
4e3aa37d | 41 | public long getNbEvents(); |
8c8bf09f ASL |
42 | |
43 | /** | |
4e3aa37d | 44 | * Trace time range accessors |
8c8bf09f | 45 | */ |
146a887c FC |
46 | public TmfTimeRange getTimeRange(); |
47 | public TmfTimestamp getStartTime(); | |
48 | public TmfTimestamp getEndTime(); | |
62d1696a FC |
49 | |
50 | /** | |
146a887c | 51 | * Positions the trace at the first event with the specified |
4e3aa37d FC |
52 | * timestamp or index (i.e. the nth event in the trace). |
53 | * | |
54 | * Returns a context which can later be used to read the event. | |
8c8bf09f | 55 | * |
8d2e2848 FC |
56 | * @param data.timestamp |
57 | * @param data.index | |
8c8bf09f ASL |
58 | * @return a context object for subsequent reads |
59 | */ | |
452ad365 | 60 | public TmfContext seekLocation(ITmfLocation<?> location); |
9f584e4c FC |
61 | public TmfContext seekEvent(TmfTimestamp timestamp); |
62 | public TmfContext seekEvent(long rank); | |
146a887c FC |
63 | |
64 | /** | |
8d2e2848 FC |
65 | * Return the event pointed by the supplied context (or null if |
66 | * no event left) and updates the context to the next event. | |
8c8bf09f ASL |
67 | * |
68 | * @return the next event in the stream | |
69 | */ | |
9f584e4c | 70 | public TmfEvent getNextEvent(TmfContext context); |
62d1696a | 71 | |
e31e01e8 FC |
72 | /** |
73 | * Return the event pointed by the supplied context (or null if | |
74 | * no event left) and *does not* update the context. | |
75 | * | |
76 | * @return the next event in the stream | |
77 | */ | |
9f584e4c | 78 | public TmfEvent parseEvent(TmfContext context); |
e31e01e8 | 79 | |
8c8bf09f | 80 | } |