Commit | Line | Data |
---|---|---|
8c8bf09f | 1 | /******************************************************************************* |
ea271da6 | 2 | * Copyright (c) 2009, 2010, 2012, 2013 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 | ||
6c13869b | 15 | package org.eclipse.linuxtools.tmf.core.trace; |
8c8bf09f ASL |
16 | |
17 | /** | |
cbdacf03 | 18 | * The basic trace context structure in TMF. The purpose of the context is to |
a0a4901e | 19 | * associate a trace location to an event at a specific rank (order). |
cbdacf03 FC |
20 | * <p> |
21 | * The context should be sufficient to allow the trace to position itself so | |
a0a4901e FC |
22 | * that performing a trace read operation will yield the corresponding 'nth' |
23 | * event. | |
1e1bef82 | 24 | * |
f7703ed6 FC |
25 | * @version 1.0 |
26 | * @author Francois Chouinard | |
27 | * | |
28 | * @see ITmfLocation | |
8c8bf09f | 29 | */ |
ea271da6 | 30 | public interface ITmfContext { |
8c8bf09f | 31 | |
cbdacf03 FC |
32 | // ------------------------------------------------------------------------ |
33 | // Constants | |
34 | // ------------------------------------------------------------------------ | |
35 | ||
cbdacf03 FC |
36 | /** |
37 | * The unknown event rank | |
38 | */ | |
2352aed9 | 39 | public long UNKNOWN_RANK = -1L; |
cbdacf03 FC |
40 | |
41 | // ------------------------------------------------------------------------ | |
42 | // Getters | |
43 | // ------------------------------------------------------------------------ | |
8c8bf09f | 44 | |
cbdacf03 | 45 | /** |
a0a4901e | 46 | * @return the rank of the event at the context location |
cbdacf03 FC |
47 | */ |
48 | public long getRank(); | |
49 | ||
50 | /** | |
a0a4901e | 51 | * @return the location of the event at the context rank |
cbdacf03 | 52 | */ |
1e1bef82 | 53 | public ITmfLocation getLocation(); |
cbdacf03 FC |
54 | |
55 | /** | |
56 | * @return indicates if the context rank is valid (!= UNKNOWN_RANK) | |
57 | */ | |
58 | public boolean hasValidRank(); | |
8c8bf09f | 59 | |
cbdacf03 FC |
60 | // ------------------------------------------------------------------------ |
61 | // Operations | |
62 | // ------------------------------------------------------------------------ | |
948b0607 | 63 | |
cbdacf03 FC |
64 | /** |
65 | * @param location the new location | |
66 | */ | |
1e1bef82 | 67 | public void setLocation(ITmfLocation location); |
cbdacf03 FC |
68 | |
69 | /** | |
70 | * @param rank the new rank | |
71 | */ | |
948b0607 FC |
72 | public void setRank(long rank); |
73 | ||
cbdacf03 FC |
74 | /** |
75 | * Increment the context rank | |
76 | */ | |
77 | public void increaseRank(); | |
948b0607 | 78 | |
cbdacf03 FC |
79 | /** |
80 | * Cleanup hook | |
81 | */ | |
82 | public void dispose(); | |
948b0607 | 83 | |
8c8bf09f | 84 | } |