6107114716622aa35a46e0395c3e35a99a30b5b8
[deliverable/tracecompass.git] / org.eclipse.linuxtools.ctf.core / src / org / eclipse / linuxtools / ctf / core / event / IEventDeclaration.java
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
12 package org.eclipse.linuxtools.ctf.core.event;
13
14 import java.util.Set;
15
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;
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 */
30 public 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.
37 * @param input
38 * the bitbuffer input source
39 * @param timestamp
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
44 * IOExceptions.
45 * @since 3.0
46 */
47 EventDefinition createDefinition(CTFStreamInputReader streamInputReader, @NonNull BitBuffer input, long timestamp) throws CTFReaderException;
48
49 /**
50 * Gets the name of an event declaration
51 *
52 * @return the name
53 */
54 String getName();
55
56 /**
57 * Gets the fields of an event declaration
58 *
59 * @return fields the fields in {@link StructDeclaration} format
60 */
61 StructDeclaration getFields();
62
63 /**
64 * Gets the context of an event declaration
65 *
66 * @return context the fields in {@link StructDeclaration} format
67 */
68 StructDeclaration getContext();
69
70 /**
71 * Gets the id of an event declaration
72 *
73 * @return The EventDeclaration ID
74 */
75 Long getId();
76
77 /**
78 * Gets the {@link CTFStream} of an event declaration
79 *
80 * @return the stream
81 * @since 3.0
82 */
83 CTFStream getStream();
84
85 /**
86 * What is the log level of this event?
87 *
88 * @return the log level.
89 * @since 2.0
90 */
91 long getLogLevel();
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 */
99 Set<String> getCustomAttributes();
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 */
109 String getCustomAttribute(String key);
110
111 }
This page took 0.050865 seconds and 4 git commands to generate.