Commit | Line | Data |
---|---|---|
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 | 15 | package org.eclipse.tracecompass.tmf.core.trace; |
8c8bf09f | 16 | |
2bdf0193 | 17 | import 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 | 32 | public 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 |
cbdacf03 | 54 | */ |
57a2a5ca | 55 | ITmfLocation getLocation(); |
cbdacf03 FC |
56 | |
57 | /** | |
58 | * @return indicates if the context rank is valid (!= UNKNOWN_RANK) | |
59 | */ | |
57a2a5ca | 60 | boolean hasValidRank(); |
8c8bf09f | 61 | |
cbdacf03 FC |
62 | // ------------------------------------------------------------------------ |
63 | // Operations | |
64 | // ------------------------------------------------------------------------ | |
948b0607 | 65 | |
cbdacf03 FC |
66 | /** |
67 | * @param location the new location | |
68 | */ | |
57a2a5ca | 69 | void setLocation(ITmfLocation location); |
cbdacf03 FC |
70 | |
71 | /** | |
72 | * @param rank the new rank | |
73 | */ | |
57a2a5ca | 74 | void setRank(long rank); |
948b0607 | 75 | |
cbdacf03 FC |
76 | /** |
77 | * Increment the context rank | |
78 | */ | |
57a2a5ca | 79 | void increaseRank(); |
948b0607 | 80 | |
cbdacf03 FC |
81 | /** |
82 | * Cleanup hook | |
83 | */ | |
57a2a5ca | 84 | void dispose(); |
948b0607 | 85 | |
8c8bf09f | 86 | } |