Commit | Line | Data |
---|---|---|
5179fc01 FC |
1 | /******************************************************************************* |
2 | * Copyright (c) 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 | *******************************************************************************/ | |
12 | ||
13 | package org.eclipse.linuxtools.tmf.core.event; | |
14 | ||
4c564a2d FC |
15 | import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; |
16 | ||
5179fc01 FC |
17 | /** |
18 | * <b><u>ITmfEvent</u></b> | |
19 | * <p> | |
4c564a2d FC |
20 | * The basic event structure in the TMF. In its canonical form, a data item has: |
21 | * <ul> | |
22 | * <li> a parent trace | |
23 | * <li> a rank (order within the trace) | |
24 | * <li> a timestamp | |
25 | * <li> a source (reporting component) | |
26 | * <li> a type | |
27 | * <li> a content (payload) | |
28 | * </ul> | |
29 | * For convenience, a free-form reference field is also provided. It could be | |
30 | * used as e.g. a location marker (filename:lineno) to indicate where the event | |
31 | * was generated. | |
32 | */ | |
33 | public interface ITmfEvent extends Cloneable { | |
34 | ||
35 | /** | |
36 | * Pre-defined event attributes | |
37 | */ | |
38 | public String EVENT_FIELD_TIMESTAMP = ":timestamp:"; //$NON-NLS-1$ | |
39 | public String EVENT_FIELD_SOURCE = ":source:"; //$NON-NLS-1$ | |
40 | public String EVENT_FIELD_TYPE = ":type:"; //$NON-NLS-1$ | |
41 | public String EVENT_FIELD_CONTENT = ":content:"; //$NON-NLS-1$ | |
42 | public String EVENT_FIELD_REFERENCE = ":reference:"; //$NON-NLS-1$ | |
43 | ||
44 | /** | |
45 | * @return the trace that 'owns' the event | |
46 | */ | |
47 | public ITmfTrace<?> getTrace(); | |
48 | ||
49 | /** | |
50 | * @return the event rank within the parent trace | |
51 | */ | |
52 | public long getRank(); | |
5179fc01 FC |
53 | |
54 | /** | |
55 | * @return the event timestamp | |
56 | */ | |
57 | public ITmfTimestamp getTimestamp(); | |
58 | ||
4c564a2d FC |
59 | /** |
60 | * @return the event source | |
61 | */ | |
62 | public String getSource(); | |
63 | ||
64 | /** | |
65 | * @return the event type | |
66 | */ | |
67 | public ITmfEventType getType(); | |
68 | ||
69 | /** | |
70 | * @return the event content | |
71 | */ | |
72 | public ITmfEventField getContent(); | |
73 | ||
74 | /** | |
75 | * @return the event reference | |
76 | */ | |
77 | public String getReference(); | |
78 | ||
79 | /** | |
80 | * @return a clone of the data item | |
81 | */ | |
82 | public ITmfEvent clone(); | |
83 | ||
5179fc01 | 84 | } |