1 /*******************************************************************************
2 * Copyright (c) 2011-2013 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
.linuxtools
.ctf
.core
.event
;
16 import org
.eclipse
.jdt
.annotation
.NonNull
;
17 import org
.eclipse
.linuxtools
.ctf
.core
.event
.io
.BitBuffer
;
18 import org
.eclipse
.linuxtools
.ctf
.core
.event
.types
.StructDeclaration
;
19 import org
.eclipse
.linuxtools
.ctf
.core
.trace
.CTFReaderException
;
20 import org
.eclipse
.linuxtools
.ctf
.core
.trace
.CTFStream
;
21 import org
.eclipse
.linuxtools
.ctf
.core
.trace
.CTFStreamInputReader
;
24 * Representation of one type of event. A bit like "int" or "long" but for trace
27 * @author Matthew Khouzam
30 public interface IEventDeclaration
{
33 * Creates an instance of EventDefinition corresponding to this declaration.
35 * @param streamInputReader
36 * The StreamInputReader for which this definition is created.
38 * the bitbuffer input source
40 * The timestamp when the event was taken
41 * @return A new EventDefinition.
42 * @throws CTFReaderException
43 * As a bitbuffer is used to read, it could have wrapped
47 EventDefinition
createDefinition(CTFStreamInputReader streamInputReader
, @NonNull BitBuffer input
, long timestamp
) throws CTFReaderException
;
50 * Gets the name of an event declaration
57 * Gets the fields of an event declaration
59 * @return fields the fields in {@link StructDeclaration} format
61 StructDeclaration
getFields();
64 * Gets the context of an event declaration
66 * @return context the fields in {@link StructDeclaration} format
68 StructDeclaration
getContext();
71 * Gets the id of an event declaration
73 * @return The EventDeclaration ID
78 * Gets the {@link CTFStream} of an event declaration
83 CTFStream
getStream();
86 * What is the log level of this event?
88 * @return the log level.
94 * Get the {@link Set} of names of the custom CTF attributes.
96 * @return The set of custom attributes
99 Set
<String
> getCustomAttributes();
102 * Get the value of a given CTF attribute.
105 * The CTF attribute name
106 * @return the CTF attribute
109 String
getCustomAttribute(String key
);