Fix some null warnings
[deliverable/tracecompass.git] / ctf / org.eclipse.tracecompass.ctf.core / src / org / eclipse / tracecompass / ctf / core / event / IEventDeclaration.java
1 /*******************************************************************************
2 * Copyright (c) 2011-2014 Ericsson, Ecole Polytechnique de Montreal and others
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
12 package org.eclipse.tracecompass.ctf.core.event;
13
14 import java.util.Set;
15
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;
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 */
29 public interface IEventDeclaration {
30
31 /**
32 * Id of events when not set
33 *
34 * @since 1.0
35 */
36 public static final long UNSET_EVENT_ID = -2L;
37
38 /**
39 * Creates an instance of EventDefinition corresponding to this declaration.
40 *
41 * @param streamInputReader
42 * The StreamInputReader for which this definition is created.
43 * @param input
44 * the bitbuffer input source
45 * @param timestamp
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
50 * IOExceptions.
51 */
52 EventDefinition createDefinition(CTFStreamInputReader streamInputReader, @NonNull BitBuffer input, long timestamp) throws CTFException;
53
54 /**
55 * Gets the name of an event declaration
56 *
57 * @return the name
58 */
59 String getName();
60
61 /**
62 * Gets the fields of an event declaration
63 *
64 * @return fields the fields in {@link StructDeclaration} format
65 */
66 StructDeclaration getFields();
67
68 /**
69 * Gets the context of an event declaration
70 *
71 * @return context the fields in {@link StructDeclaration} format
72 */
73 StructDeclaration getContext();
74
75 /**
76 * Gets the id of an event declaration
77 *
78 * @return The EventDeclaration ID
79 */
80 Long getId();
81
82 /**
83 * Gets the {@link CTFStream} of an event declaration
84 *
85 * @return the stream
86 */
87 CTFStream getStream();
88
89 /**
90 * What is the log level of this event?
91 *
92 * @return the log level.
93 */
94 long getLogLevel();
95
96 /**
97 * Get the {@link Set} of names of the custom CTF attributes.
98 *
99 * @return The set of custom attributes
100 */
101 @NonNull Set<@NonNull String> getCustomAttributes();
102
103 /**
104 * Get the value of a given CTF attribute.
105 *
106 * @param key
107 * The CTF attribute name
108 * @return the CTF attribute
109 */
110 String getCustomAttribute(String key);
111
112 }
This page took 0.042963 seconds and 5 git commands to generate.