| 1 | /******************************************************************************* |
| 2 | * Copyright (c) 2012, 2015 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.tracecompass.tmf.core.event; |
| 14 | |
| 15 | import org.eclipse.core.runtime.IAdaptable; |
| 16 | import org.eclipse.jdt.annotation.NonNull; |
| 17 | import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp; |
| 18 | import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace; |
| 19 | |
| 20 | /** |
| 21 | * The generic event structure in TMF. In its canonical form, an event has: |
| 22 | * <ul> |
| 23 | * <li>a parent trace |
| 24 | * <li>a rank (order within the trace) |
| 25 | * <li>a timestamp |
| 26 | * <li>a type |
| 27 | * <li>a content (payload) |
| 28 | * </ul> |
| 29 | * |
| 30 | * @author Francois Chouinard |
| 31 | * |
| 32 | * @see ITmfTimestamp |
| 33 | * @see ITmfEventType |
| 34 | * @see ITmfEventField |
| 35 | * @see TmfEvent |
| 36 | */ |
| 37 | public interface ITmfEvent extends IAdaptable { |
| 38 | |
| 39 | // ------------------------------------------------------------------------ |
| 40 | // Getters |
| 41 | // ------------------------------------------------------------------------ |
| 42 | |
| 43 | /** |
| 44 | * @return the trace that 'owns' the event |
| 45 | */ |
| 46 | @NonNull ITmfTrace getTrace(); |
| 47 | |
| 48 | /** |
| 49 | * @return the event rank within the parent trace |
| 50 | */ |
| 51 | long getRank(); |
| 52 | |
| 53 | /** |
| 54 | * @return the event timestamp |
| 55 | */ |
| 56 | @NonNull ITmfTimestamp getTimestamp(); |
| 57 | |
| 58 | /** |
| 59 | * @return the event type |
| 60 | */ |
| 61 | ITmfEventType getType(); |
| 62 | |
| 63 | /** |
| 64 | * @return the event content |
| 65 | */ |
| 66 | ITmfEventField getContent(); |
| 67 | |
| 68 | /** |
| 69 | * Gets the name of the event |
| 70 | * |
| 71 | * @return the name of the event, same as getType().getName() |
| 72 | * @since 1.0 |
| 73 | */ |
| 74 | @NonNull String getName(); |
| 75 | } |