Patch for Bug287563
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf / src / org / eclipse / linuxtools / tmf / stream / ITmfEventStream.java
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.stream;
14
15 import java.util.Map;
16
17 import org.eclipse.linuxtools.tmf.event.TmfEvent;
18 import org.eclipse.linuxtools.tmf.event.TmfTimeRange;
19 import org.eclipse.linuxtools.tmf.event.TmfTimestamp;
20 import org.eclipse.linuxtools.tmf.trace.TmfTrace;
21
22 /**
23 * <b><u>ITmfEventStream</u></b>
24 * <p>
25 * TODO: Implement me. Please.
26 */
27 public interface ITmfEventStream {
28
29 public class StreamContext {
30 Object location;
31 public StreamContext(Object loc) {
32 location = loc;
33 }
34 }
35
36 public int getNbEvents();
37
38 public TmfTimeRange getTimeRange();
39
40 public Map<String, Object> getAttributes();
41
42 /**
43 * Positions the stream at the first event with timestamp.
44 *
45 * @param timestamp
46 * @return a context object for subsequent reads
47 */
48 public StreamContext seekEvent(TmfTimestamp timestamp);
49
50 /**
51 * Positions the stream on the event at the wanted position.
52 *
53 * @param index
54 * @return a context object for subsequent reads
55 */
56 public StreamContext seekEvent(int index);
57
58 /**
59 * Reads and the next event on the stream and updates the context.
60 * If there is no event left, return null.
61 *
62 * @return the next event in the stream
63 */
64 public TmfEvent getNextEvent(StreamContext context);
65
66 public TmfEvent getEvent(StreamContext context, TmfTimestamp timestamp);
67 public TmfEvent getEvent(StreamContext context, int index);
68
69 /**
70 * Parse the stream and creates the checkpoint structure.
71 * Normally performed once at the creation of the event stream.
72 */
73 public void indexStream(boolean waitForCompletion);
74
75 public Object getCurrentLocation();
76 public StreamContext seekLocation(Object location);
77
78 public void addListener(TmfTrace tmfEventLog);
79 public void removeListener(TmfTrace tmfEventLog);
80 }
This page took 0.038081 seconds and 5 git commands to generate.