ctf: Make events immutable
[deliverable/tracecompass.git] / org.eclipse.linuxtools.ctf.core / src / org / eclipse / linuxtools / ctf / core / event / IEventDeclaration.java
CommitLineData
8e964be1
MK
1/*******************************************************************************
2 * Copyright (c) 2011-2013 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
12package org.eclipse.linuxtools.ctf.core.event;
13
14import java.util.Set;
15
a4fa4e36
MK
16import org.eclipse.jdt.annotation.NonNull;
17import org.eclipse.linuxtools.ctf.core.event.io.BitBuffer;
8e964be1 18import org.eclipse.linuxtools.ctf.core.event.types.StructDeclaration;
a4fa4e36 19import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
8e964be1
MK
20import org.eclipse.linuxtools.ctf.core.trace.Stream;
21import org.eclipse.linuxtools.ctf.core.trace.StreamInputReader;
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 */
a4fa4e36 47 EventDefinition createDefinition(StreamInputReader 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 /**
78 * Gets the {@link Stream} of an event declaration
79 *
80 * @return the stream
81 * @since 2.0
82 */
3e2618e9 83 Stream 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.038287 seconds and 5 git commands to generate.