Copyright header update, 2015 edition
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.core / src / org / eclipse / tracecompass / tmf / core / trace / ITmfContext.java
CommitLineData
8c8bf09f 1/*******************************************************************************
ed902a2b 2 * Copyright (c) 2009, 2014 Ericsson
1e1bef82 3 *
8c8bf09f
ASL
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
1e1bef82 8 *
8c8bf09f
ASL
9 * Contributors:
10 * Francois Chouinard - Initial API and implementation
cbdacf03 11 * Francois Chouinard - Updated as per TMF Trace Model 1.0
ea271da6 12 * Patrick Tasse - Updated for removal of context clone
8c8bf09f
ASL
13 *******************************************************************************/
14
2bdf0193 15package org.eclipse.tracecompass.tmf.core.trace;
8c8bf09f 16
2bdf0193 17import org.eclipse.tracecompass.tmf.core.trace.location.ITmfLocation;
a3db8436 18
8c8bf09f 19/**
cbdacf03 20 * The basic trace context structure in TMF. The purpose of the context is to
a0a4901e 21 * associate a trace location to an event at a specific rank (order).
cbdacf03
FC
22 * <p>
23 * The context should be sufficient to allow the trace to position itself so
a0a4901e
FC
24 * that performing a trace read operation will yield the corresponding 'nth'
25 * event.
1e1bef82 26 *
f7703ed6
FC
27 * @version 1.0
28 * @author Francois Chouinard
29 *
30 * @see ITmfLocation
8c8bf09f 31 */
ea271da6 32public interface ITmfContext {
8c8bf09f 33
cbdacf03
FC
34 // ------------------------------------------------------------------------
35 // Constants
36 // ------------------------------------------------------------------------
37
cbdacf03
FC
38 /**
39 * The unknown event rank
40 */
2352aed9 41 public long UNKNOWN_RANK = -1L;
cbdacf03
FC
42
43 // ------------------------------------------------------------------------
44 // Getters
45 // ------------------------------------------------------------------------
8c8bf09f 46
cbdacf03 47 /**
a0a4901e 48 * @return the rank of the event at the context location
cbdacf03 49 */
57a2a5ca 50 long getRank();
cbdacf03
FC
51
52 /**
a0a4901e 53 * @return the location of the event at the context rank
a3db8436 54 * @since 3.0
cbdacf03 55 */
57a2a5ca 56 ITmfLocation getLocation();
cbdacf03
FC
57
58 /**
59 * @return indicates if the context rank is valid (!= UNKNOWN_RANK)
60 */
57a2a5ca 61 boolean hasValidRank();
8c8bf09f 62
cbdacf03
FC
63 // ------------------------------------------------------------------------
64 // Operations
65 // ------------------------------------------------------------------------
948b0607 66
cbdacf03
FC
67 /**
68 * @param location the new location
a3db8436 69 * @since 3.0
cbdacf03 70 */
57a2a5ca 71 void setLocation(ITmfLocation location);
cbdacf03
FC
72
73 /**
74 * @param rank the new rank
75 */
57a2a5ca 76 void setRank(long rank);
948b0607 77
cbdacf03
FC
78 /**
79 * Increment the context rank
80 */
57a2a5ca 81 void increaseRank();
948b0607 82
cbdacf03
FC
83 /**
84 * Cleanup hook
85 */
57a2a5ca 86 void dispose();
948b0607 87
8c8bf09f 88}
This page took 0.071553 seconds and 5 git commands to generate.