Commit | Line | Data |
---|---|---|
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 | ||
12 | package org.eclipse.linuxtools.ctf.core.event; | |
13 | ||
14 | import java.util.Set; | |
15 | ||
16 | import org.eclipse.linuxtools.ctf.core.event.types.StructDeclaration; | |
17 | import org.eclipse.linuxtools.ctf.core.trace.Stream; | |
18 | import org.eclipse.linuxtools.ctf.core.trace.StreamInputReader; | |
19 | ||
20 | /** | |
21 | * Representation of one type of event. A bit like "int" or "long" but for trace | |
22 | * events. | |
23 | * | |
24 | * @author Matthew Khouzam | |
25 | * @since 2.0 | |
26 | */ | |
27 | public interface IEventDeclaration { | |
28 | ||
29 | /** | |
30 | * Creates an instance of EventDefinition corresponding to this declaration. | |
31 | * | |
32 | * @param streamInputReader | |
33 | * The StreamInputReader for which this definition is created. | |
34 | * @return A new EventDefinition. | |
35 | */ | |
3e2618e9 | 36 | EventDefinition createDefinition(StreamInputReader streamInputReader); |
8e964be1 MK |
37 | |
38 | /** | |
39 | * Gets the name of an event declaration | |
40 | * | |
41 | * @return the name | |
42 | */ | |
3e2618e9 | 43 | String getName(); |
8e964be1 MK |
44 | |
45 | /** | |
46 | * Gets the fields of an event declaration | |
47 | * | |
48 | * @return fields the fields in {@link StructDeclaration} format | |
49 | */ | |
3e2618e9 | 50 | StructDeclaration getFields(); |
8e964be1 MK |
51 | |
52 | /** | |
53 | * Gets the context of an event declaration | |
54 | * | |
55 | * @return context the fields in {@link StructDeclaration} format | |
56 | */ | |
3e2618e9 | 57 | StructDeclaration getContext(); |
8e964be1 MK |
58 | |
59 | /** | |
60 | * Gets the id of an event declaration | |
61 | * | |
62 | * @return The EventDeclaration ID | |
63 | */ | |
3e2618e9 | 64 | Long getId(); |
8e964be1 MK |
65 | |
66 | /** | |
67 | * Gets the {@link Stream} of an event declaration | |
68 | * | |
69 | * @return the stream | |
70 | * @since 2.0 | |
71 | */ | |
3e2618e9 | 72 | Stream getStream(); |
8e964be1 MK |
73 | |
74 | /** | |
75 | * What is the log level of this event? | |
76 | * | |
77 | * @return the log level. | |
78 | * @since 2.0 | |
79 | */ | |
3e2618e9 | 80 | long getLogLevel(); |
8e964be1 MK |
81 | |
82 | /** | |
83 | * Get the {@link Set} of names of the custom CTF attributes. | |
84 | * | |
85 | * @return The set of custom attributes | |
86 | * @since 2.0 | |
87 | */ | |
3e2618e9 | 88 | Set<String> getCustomAttributes(); |
8e964be1 MK |
89 | |
90 | /** | |
91 | * Get the value of a given CTF attribute. | |
92 | * | |
93 | * @param key | |
94 | * The CTF attribute name | |
95 | * @return the CTF attribute | |
96 | * @since 2.0 | |
97 | */ | |
3e2618e9 | 98 | String getCustomAttribute(String key); |
8e964be1 MK |
99 | |
100 | } |