Minor updates
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / event / ITmfEvent.java
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
15 import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
16
17 /**
18 * <b><u>ITmfEvent</u></b>
19 * <p>
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 // Constants
37 // ------------------------------------------------------------------------
38
39 /**
40 * Pre-defined event attributes
41 */
42 public static final String EVENT_FIELD_TIMESTAMP = ":timestamp:"; //$NON-NLS-1$
43 public static final String EVENT_FIELD_SOURCE = ":source:"; //$NON-NLS-1$
44 public static final String EVENT_FIELD_TYPE = ":type:"; //$NON-NLS-1$
45 public static final String EVENT_FIELD_CONTENT = ":content:"; //$NON-NLS-1$
46 public static final String EVENT_FIELD_REFERENCE = ":reference:"; //$NON-NLS-1$
47
48 // ------------------------------------------------------------------------
49 // Getters
50 // ------------------------------------------------------------------------
51
52 /**
53 * @return the trace that 'owns' the event
54 */
55 public ITmfTrace<?> getTrace();
56
57 /**
58 * @return the event rank within the parent trace
59 */
60 public long getRank();
61
62 /**
63 * @return the event timestamp
64 */
65 public ITmfTimestamp getTimestamp();
66
67 /**
68 * @return the event source
69 */
70 public String getSource();
71
72 /**
73 * @return the event type
74 */
75 public ITmfEventType getType();
76
77 /**
78 * @return the event content
79 */
80 public ITmfEventField getContent();
81
82 /**
83 * @return the event reference
84 */
85 public String getReference();
86
87 // ------------------------------------------------------------------------
88 // Cloneable
89 // ------------------------------------------------------------------------
90
91 /**
92 * @return a clone of the event
93 */
94 public ITmfEvent clone();
95
96 }
This page took 0.038223 seconds and 6 git commands to generate.