Commit | Line | Data |
---|---|---|
8c8bf09f | 1 | /******************************************************************************* |
cbdacf03 | 2 | * Copyright (c) 2009, 2010, 2012 Ericsson |
8c8bf09f ASL |
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 | |
cbdacf03 | 11 | * Francois Chouinard - Updated as per TMF Trace Model 1.0 |
8c8bf09f ASL |
12 | *******************************************************************************/ |
13 | ||
6c13869b | 14 | package org.eclipse.linuxtools.tmf.core.trace; |
8c8bf09f ASL |
15 | |
16 | /** | |
cbdacf03 | 17 | * The basic trace context structure in TMF. The purpose of the context is to |
a0a4901e | 18 | * associate a trace location to an event at a specific rank (order). |
cbdacf03 FC |
19 | * <p> |
20 | * The context should be sufficient to allow the trace to position itself so | |
a0a4901e FC |
21 | * that performing a trace read operation will yield the corresponding 'nth' |
22 | * event. | |
f7703ed6 | 23 | * |
f7703ed6 FC |
24 | * @version 1.0 |
25 | * @author Francois Chouinard | |
26 | * | |
27 | * @see ITmfLocation | |
8c8bf09f | 28 | */ |
0316808c | 29 | public interface ITmfContext { |
8c8bf09f | 30 | |
cbdacf03 FC |
31 | // ------------------------------------------------------------------------ |
32 | // Constants | |
33 | // ------------------------------------------------------------------------ | |
34 | ||
cbdacf03 FC |
35 | /** |
36 | * The unknown event rank | |
37 | */ | |
2352aed9 | 38 | public long UNKNOWN_RANK = -1L; |
cbdacf03 FC |
39 | |
40 | // ------------------------------------------------------------------------ | |
41 | // Getters | |
42 | // ------------------------------------------------------------------------ | |
8c8bf09f | 43 | |
cbdacf03 | 44 | /** |
a0a4901e | 45 | * @return the rank of the event at the context location |
cbdacf03 FC |
46 | */ |
47 | public long getRank(); | |
48 | ||
49 | /** | |
a0a4901e | 50 | * @return the location of the event at the context rank |
cbdacf03 FC |
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(); | |
8c8bf09f | 58 | |
cbdacf03 FC |
59 | // ------------------------------------------------------------------------ |
60 | // Operations | |
61 | // ------------------------------------------------------------------------ | |
948b0607 | 62 | |
cbdacf03 FC |
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 | */ | |
948b0607 FC |
71 | public void setRank(long rank); |
72 | ||
cbdacf03 FC |
73 | /** |
74 | * Increment the context rank | |
75 | */ | |
76 | public void increaseRank(); | |
948b0607 | 77 | |
cbdacf03 FC |
78 | /** |
79 | * Cleanup hook | |
80 | */ | |
81 | public void dispose(); | |
948b0607 | 82 | |
cbdacf03 FC |
83 | /** |
84 | * @return a clone of the context | |
85 | */ | |
a1440d1f FC |
86 | public ITmfContext clone(); |
87 | ||
8c8bf09f | 88 | } |