Copyright header update, 2015 edition
[deliverable/tracecompass.git] / org.eclipse.tracecompass.ctf.core / src / org / eclipse / tracecompass / ctf / core / event / IEventDeclaration.java
CommitLineData
8e964be1 1/*******************************************************************************
ed902a2b 2 * Copyright (c) 2011-2014 Ericsson, Ecole Polytechnique de Montreal and others
8e964be1
MK
3 *
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
8 *
9 * Contributors: Matthew Khouzam - Initial API and implementation
10 *******************************************************************************/
11
f357bcd4 12package org.eclipse.tracecompass.ctf.core.event;
8e964be1
MK
13
14import java.util.Set;
15
a4fa4e36 16import org.eclipse.jdt.annotation.NonNull;
f357bcd4
AM
17import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
18import org.eclipse.tracecompass.ctf.core.event.types.StructDeclaration;
19import org.eclipse.tracecompass.ctf.core.trace.CTFReaderException;
20import org.eclipse.tracecompass.ctf.core.trace.CTFStream;
21import org.eclipse.tracecompass.ctf.core.trace.CTFStreamInputReader;
8e964be1
MK
22
23/**
24 * Representation of one type of event. A bit like "int" or "long" but for trace
25 * events.
26 *
27 * @author Matthew Khouzam
28 * @since 2.0
29 */
30public interface IEventDeclaration {
31
32 /**
33 * Creates an instance of EventDefinition corresponding to this declaration.
34 *
35 * @param streamInputReader
36 * The StreamInputReader for which this definition is created.
a4fa4e36
MK
37 * @param input
38 * the bitbuffer input source
39 * @param timestamp
40 * The timestamp when the event was taken
8e964be1 41 * @return A new EventDefinition.
a4fa4e36
MK
42 * @throws CTFReaderException
43 * As a bitbuffer is used to read, it could have wrapped
44 * IOExceptions.
45 * @since 3.0
8e964be1 46 */
d84419e1 47 EventDefinition createDefinition(CTFStreamInputReader streamInputReader, @NonNull BitBuffer input, long timestamp) throws CTFReaderException;
8e964be1
MK
48
49 /**
50 * Gets the name of an event declaration
51 *
52 * @return the name
53 */
3e2618e9 54 String getName();
8e964be1
MK
55
56 /**
57 * Gets the fields of an event declaration
58 *
59 * @return fields the fields in {@link StructDeclaration} format
60 */
3e2618e9 61 StructDeclaration getFields();
8e964be1
MK
62
63 /**
64 * Gets the context of an event declaration
65 *
66 * @return context the fields in {@link StructDeclaration} format
67 */
3e2618e9 68 StructDeclaration getContext();
8e964be1
MK
69
70 /**
71 * Gets the id of an event declaration
72 *
73 * @return The EventDeclaration ID
74 */
3e2618e9 75 Long getId();
8e964be1
MK
76
77 /**
d84419e1 78 * Gets the {@link CTFStream} of an event declaration
8e964be1
MK
79 *
80 * @return the stream
d84419e1 81 * @since 3.0
8e964be1 82 */
d84419e1 83 CTFStream getStream();
8e964be1
MK
84
85 /**
86 * What is the log level of this event?
87 *
88 * @return the log level.
89 * @since 2.0
90 */
3e2618e9 91 long getLogLevel();
8e964be1
MK
92
93 /**
94 * Get the {@link Set} of names of the custom CTF attributes.
95 *
96 * @return The set of custom attributes
97 * @since 2.0
98 */
3e2618e9 99 Set<String> getCustomAttributes();
8e964be1
MK
100
101 /**
102 * Get the value of a given CTF attribute.
103 *
104 * @param key
105 * The CTF attribute name
106 * @return the CTF attribute
107 * @since 2.0
108 */
3e2618e9 109 String getCustomAttribute(String key);
8e964be1
MK
110
111}
This page took 0.074139 seconds and 5 git commands to generate.