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