Commit | Line | Data |
---|---|---|
a433ce7d MK |
1 | /******************************************************************************* |
2 | * Copyright (c) 2015 Ericsson | |
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.Collections; | |
15 | import java.util.Set; | |
16 | ||
17 | import org.eclipse.tracecompass.ctf.core.CTFException; | |
18 | import org.eclipse.tracecompass.ctf.core.CTFStrings; | |
19 | import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer; | |
20 | import org.eclipse.tracecompass.ctf.core.event.types.IntegerDeclaration; | |
21 | import org.eclipse.tracecompass.ctf.core.event.types.StructDeclaration; | |
a433ce7d | 22 | import org.eclipse.tracecompass.ctf.core.trace.CTFStreamInputReader; |
8aa463e0 | 23 | import org.eclipse.tracecompass.ctf.core.trace.ICTFStream; |
a433ce7d MK |
24 | |
25 | /** | |
26 | * A lost event definition | |
27 | * | |
28 | * @author Matthew Khouzam | |
29 | * @since 1.0 | |
30 | */ | |
31 | public class LostEventDeclaration implements IEventDeclaration { | |
32 | ||
33 | /** | |
34 | * Id of lost events | |
35 | * | |
36 | * @since 1.0 | |
37 | */ | |
38 | public static final long LOST_EVENT_ID = -1L; | |
39 | ||
40 | /** | |
41 | * Gets a "lost" event. This is a synthetic event that is there to show that | |
42 | * there should be something there. | |
43 | */ | |
44 | public static final LostEventDeclaration INSTANCE = new LostEventDeclaration(); | |
45 | ||
46 | private final StructDeclaration fFields = new StructDeclaration(0); | |
47 | ||
48 | private LostEventDeclaration() { | |
49 | getFields().addField(CTFStrings.LOST_EVENTS_FIELD, IntegerDeclaration.UINT_32B_DECL); | |
50 | getFields().addField(CTFStrings.LOST_EVENTS_DURATION, IntegerDeclaration.UINT_64B_DECL); | |
51 | } | |
52 | ||
53 | @Override | |
54 | public EventDefinition createDefinition(CTFStreamInputReader streamInputReader, BitBuffer input, long timestamp) throws CTFException { | |
55 | return null; | |
56 | } | |
57 | ||
58 | @Override | |
59 | public String getName() { | |
60 | return CTFStrings.LOST_EVENT_NAME; | |
61 | } | |
62 | ||
63 | @Override | |
64 | public StructDeclaration getFields() { | |
65 | return fFields; | |
66 | } | |
67 | ||
68 | @Override | |
69 | public StructDeclaration getContext() { | |
70 | return null; | |
71 | } | |
72 | ||
73 | @Override | |
74 | public Long getId() { | |
75 | return LOST_EVENT_ID; | |
76 | } | |
77 | ||
8aa463e0 MK |
78 | /** |
79 | * @since 2.0 | |
80 | */ | |
a433ce7d | 81 | @Override |
8aa463e0 | 82 | public ICTFStream getStream() { |
a433ce7d MK |
83 | return null; |
84 | } | |
85 | ||
86 | @Override | |
87 | public long getLogLevel() { | |
88 | return 0; | |
89 | } | |
90 | ||
91 | @Override | |
92 | public Set<String> getCustomAttributes() { | |
93 | return Collections.<String> emptySet(); | |
94 | } | |
95 | ||
96 | @Override | |
97 | public String getCustomAttribute(String key) { | |
98 | return null; | |
99 | } | |
100 | ||
101 | } |