1 /*******************************************************************************
2 * Copyright (c) 2011-2014 Ericsson, Ecole Polytechnique de Montreal and others
4 * All rights reserved. This program and the accompanying materials are made
5 * 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
9 * Contributors: Matthew Khouzam - Initial API and implementation
10 *******************************************************************************/
12 package org
.eclipse
.tracecompass
.ctf
.core
.event
;
16 import org
.eclipse
.jdt
.annotation
.NonNull
;
17 import org
.eclipse
.tracecompass
.ctf
.core
.CTFException
;
18 import org
.eclipse
.tracecompass
.ctf
.core
.event
.io
.BitBuffer
;
19 import org
.eclipse
.tracecompass
.ctf
.core
.event
.types
.StructDeclaration
;
20 import org
.eclipse
.tracecompass
.ctf
.core
.trace
.CTFStream
;
21 import org
.eclipse
.tracecompass
.ctf
.core
.trace
.CTFStreamInputReader
;
24 * Representation of one type of event. A bit like "int" or "long" but for trace
27 * @author Matthew Khouzam
29 public interface IEventDeclaration
{
32 * Id of events when not set
36 public static final long UNSET_EVENT_ID
= -2L;
39 * Creates an instance of EventDefinition corresponding to this declaration.
41 * @param streamInputReader
42 * The StreamInputReader for which this definition is created.
44 * the bitbuffer input source
46 * The timestamp when the event was taken
47 * @return A new EventDefinition.
48 * @throws CTFException
49 * As a bitbuffer is used to read, it could have wrapped
52 EventDefinition
createDefinition(CTFStreamInputReader streamInputReader
, @NonNull BitBuffer input
, long timestamp
) throws CTFException
;
55 * Gets the name of an event declaration
62 * Gets the fields of an event declaration
64 * @return fields the fields in {@link StructDeclaration} format
66 StructDeclaration
getFields();
69 * Gets the context of an event declaration
71 * @return context the fields in {@link StructDeclaration} format
73 StructDeclaration
getContext();
76 * Gets the id of an event declaration
78 * @return The EventDeclaration ID
83 * Gets the {@link CTFStream} of an event declaration
87 CTFStream
getStream();
90 * What is the log level of this event?
92 * @return the log level.
97 * Get the {@link Set} of names of the custom CTF attributes.
99 * @return The set of custom attributes
101 @NonNull Set
<@NonNull String
> getCustomAttributes();
104 * Get the value of a given CTF attribute.
107 * The CTF attribute name
108 * @return the CTF attribute
110 String
getCustomAttribute(String key
);