diff options
Diffstat (limited to 'tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/event/ITmfEvent.java')
-rw-r--r-- | tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/event/ITmfEvent.java | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/event/ITmfEvent.java b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/event/ITmfEvent.java new file mode 100644 index 0000000000..ee2f573df2 --- /dev/null +++ b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/event/ITmfEvent.java @@ -0,0 +1,75 @@ +/******************************************************************************* + * Copyright (c) 2012, 2015 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Francois Chouinard - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.tracecompass.tmf.core.event; + +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp; +import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace; + +/** + * The generic event structure in TMF. In its canonical form, an event has: + * <ul> + * <li>a parent trace + * <li>a rank (order within the trace) + * <li>a timestamp + * <li>a type + * <li>a content (payload) + * </ul> + * + * @author Francois Chouinard + * + * @see ITmfTimestamp + * @see ITmfEventType + * @see ITmfEventField + * @see TmfEvent + */ +public interface ITmfEvent extends IAdaptable { + + // ------------------------------------------------------------------------ + // Getters + // ------------------------------------------------------------------------ + + /** + * @return the trace that 'owns' the event + */ + @NonNull ITmfTrace getTrace(); + + /** + * @return the event rank within the parent trace + */ + long getRank(); + + /** + * @return the event timestamp + */ + @NonNull ITmfTimestamp getTimestamp(); + + /** + * @return the event type + */ + ITmfEventType getType(); + + /** + * @return the event content + */ + ITmfEventField getContent(); + + /** + * Gets the name of the event + * + * @return the name of the event, same as getType().getName() + * @since 1.0 + */ + String getName(); +} |