550d86de3029cc14bc26c91b4c025b8c64721f02
[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 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 * @see ITmfTimestamp
34 * @see ITmfEventType
35 * @see ITmfEvetnField
36 * @see TmfEvent
37 */
38 public interface ITmfEvent extends Cloneable {
39
40 // ------------------------------------------------------------------------
41 // Constants
42 // ------------------------------------------------------------------------
43
44 /**
45 * Pre-defined event attributes
46 */
47 public static final String EVENT_FIELD_TIMESTAMP = ":timestamp:"; //$NON-NLS-1$
48 public static final String EVENT_FIELD_SOURCE = ":source:"; //$NON-NLS-1$
49 public static final String EVENT_FIELD_TYPE = ":type:"; //$NON-NLS-1$
50 public static final String EVENT_FIELD_CONTENT = ":content:"; //$NON-NLS-1$
51 public static final String EVENT_FIELD_REFERENCE = ":reference:"; //$NON-NLS-1$
52
53 // ------------------------------------------------------------------------
54 // Getters
55 // ------------------------------------------------------------------------
56
57 /**
58 * @return the trace that 'owns' the event
59 */
60 public ITmfTrace<?> getTrace();
61
62 /**
63 * @return the event rank within the parent trace
64 */
65 public long getRank();
66
67 /**
68 * @return the event timestamp
69 */
70 public ITmfTimestamp getTimestamp();
71
72 /**
73 * @return the event source
74 */
75 public String getSource();
76
77 /**
78 * @return the event type
79 */
80 public ITmfEventType getType();
81
82 /**
83 * @return the event content
84 */
85 public ITmfEventField getContent();
86
87 /**
88 * @return the event reference
89 */
90 public String getReference();
91
92 // ------------------------------------------------------------------------
93 // Cloneable
94 // ------------------------------------------------------------------------
95
96 /**
97 * @return a clone of the event
98 */
99 public ITmfEvent clone();
100
101 }
This page took 0.031804 seconds and 4 git commands to generate.