Merge branch 'master'
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / trace / ITmfContext.java
1 /*******************************************************************************
2 * Copyright (c) 2009, 2010, 2012 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 * Francois Chouinard - Updated as per TMF Trace Model 1.0
12 *******************************************************************************/
13
14 package org.eclipse.linuxtools.tmf.core.trace;
15
16 /**
17 * The basic trace context structure in TMF. The purpose of the context is to
18 * associate a trace location to an event at a specific rank (order).
19 * <p>
20 * The context should be sufficient to allow the trace to position itself so
21 * that performing a trace read operation will yield the corresponding 'nth'
22 * event.
23 *
24 * @version 1.0
25 * @author Francois Chouinard
26 *
27 * @see ITmfLocation
28 */
29 public interface ITmfContext {
30
31 // ------------------------------------------------------------------------
32 // Constants
33 // ------------------------------------------------------------------------
34
35 /**
36 * The unknown event rank
37 */
38 public long UNKNOWN_RANK = -1L;
39
40 // ------------------------------------------------------------------------
41 // Getters
42 // ------------------------------------------------------------------------
43
44 /**
45 * @return the rank of the event at the context location
46 */
47 public long getRank();
48
49 /**
50 * @return the location of the event at the context rank
51 */
52 public ITmfLocation<? extends Comparable<?>> getLocation();
53
54 /**
55 * @return indicates if the context rank is valid (!= UNKNOWN_RANK)
56 */
57 public boolean hasValidRank();
58
59 // ------------------------------------------------------------------------
60 // Operations
61 // ------------------------------------------------------------------------
62
63 /**
64 * @param location the new location
65 */
66 public void setLocation(ITmfLocation<? extends Comparable<?>> location);
67
68 /**
69 * @param rank the new rank
70 */
71 public void setRank(long rank);
72
73 /**
74 * Increment the context rank
75 */
76 public void increaseRank();
77
78 /**
79 * Cleanup hook
80 */
81 public void dispose();
82
83 /**
84 * @return a clone of the context
85 */
86 public ITmfContext clone();
87
88 }
This page took 0.032729 seconds and 6 git commands to generate.