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 FC |
23 | public interface ITmfTrace { |
24 | ||
b0a282fb FC |
25 | /** |
26 | * @return the trace path | |
27 | */ | |
28 | public String getPath(); | |
29 | ||
8c8bf09f | 30 | /** |
146a887c | 31 | * @return the trace name |
8c8bf09f ASL |
32 | */ |
33 | public String getName(); | |
b0a282fb | 34 | |
8c8bf09f | 35 | /** |
146a887c | 36 | * @return the number of events in the trace |
8c8bf09f | 37 | */ |
4e3aa37d | 38 | public long getNbEvents(); |
8c8bf09f ASL |
39 | |
40 | /** | |
4e3aa37d | 41 | * Trace time range accessors |
8c8bf09f | 42 | */ |
146a887c FC |
43 | public TmfTimeRange getTimeRange(); |
44 | public TmfTimestamp getStartTime(); | |
45 | public TmfTimestamp getEndTime(); | |
62d1696a FC |
46 | |
47 | /** | |
146a887c | 48 | * Positions the trace at the first event with the specified |
4e3aa37d FC |
49 | * timestamp or index (i.e. the nth event in the trace). |
50 | * | |
51 | * Returns a context which can later be used to read the event. | |
8c8bf09f | 52 | * |
8d2e2848 FC |
53 | * @param data.timestamp |
54 | * @param data.index | |
8c8bf09f ASL |
55 | * @return a context object for subsequent reads |
56 | */ | |
146a887c | 57 | public TmfTraceContext seekLocation(Object location); |
4e3aa37d FC |
58 | public TmfTraceContext seekEvent(TmfTimestamp timestamp); |
59 | public TmfTraceContext seekEvent(long index); | |
146a887c FC |
60 | |
61 | /** | |
8d2e2848 FC |
62 | * Return the event pointed by the supplied context (or null if |
63 | * no event left) and updates the context to the next event. | |
8c8bf09f ASL |
64 | * |
65 | * @return the next event in the stream | |
66 | */ | |
146a887c | 67 | public TmfEvent getNextEvent(TmfTraceContext context); |
62d1696a | 68 | |
8c8bf09f | 69 | } |