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
.CTFStreamInputReader
;
21 import org
.eclipse
.tracecompass
.ctf
.core
.trace
.ICTFStream
;
22 import org
.eclipse
.tracecompass
.internal
.ctf
.core
.trace
.CTFStream
;
25 * Representation of one type of event. A bit like "int" or "long" but for trace
28 * @author Matthew Khouzam
30 public interface IEventDeclaration
{
33 * Id of events when not set
37 public static final long UNSET_EVENT_ID
= -2L;
40 * Creates an instance of {@link IEventDefinition} corresponding to this
43 * @param streamInputReader
44 * The {@link CTFStreamInputReader} for which this definition is
47 * the {@link BitBuffer} input source
49 * The timestamp when the event was taken
50 * @return A new {@link IEventDefinition}
51 * @throws CTFException
52 * As a bitbuffer is used to read, it could have wrapped
56 IEventDefinition
createDefinition(CTFStreamInputReader streamInputReader
, @NonNull BitBuffer input
, long timestamp
) throws CTFException
;
59 * Gets the name of an event declaration
66 * Gets the fields of an event declaration
68 * @return fields the fields in {@link StructDeclaration} format
70 StructDeclaration
getFields();
73 * Gets the context of an event declaration
75 * @return context the fields in {@link StructDeclaration} format
77 StructDeclaration
getContext();
80 * Gets the id of an event declaration
82 * @return The EventDeclaration ID
87 * Gets the {@link CTFStream} of an event declaration
92 ICTFStream
getStream();
95 * What is the log level of this event?
97 * @return the log level.
102 * Get the {@link Set} of names of the custom CTF attributes.
104 * @return The set of custom attributes
106 @NonNull Set
<@NonNull String
> getCustomAttributes();
109 * Get the value of a given CTF attribute.
112 * The CTF attribute name
113 * @return the CTF attribute
115 String
getCustomAttribute(String key
);