tmf: Move plugins to the Trace Compass namespace
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.ctf.core / src / org / eclipse / linuxtools / tmf / ctf / core / CtfTmfLostEvent.java
1 /*******************************************************************************
2 * Copyright (c) 2013 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:
10 * Alexandre Montplaisir - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.tmf.ctf.core;
14
15 import org.eclipse.jdt.annotation.NonNull;
16 import org.eclipse.linuxtools.ctf.core.event.EventDefinition;
17 import org.eclipse.linuxtools.ctf.core.event.IEventDeclaration;
18 import org.eclipse.linuxtools.tmf.core.event.ITmfLostEvent;
19 import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange;
20
21 /**
22 * An implementation of {@link ITmfLostEvent} for use in the CTF adaptor.
23 *
24 * @author Alexandre Montplaisir
25 * @since 2.2
26 */
27 public class CtfTmfLostEvent extends CtfTmfEvent implements ITmfLostEvent {
28
29 private final TmfTimeRange fTimeRange;
30 private final long fNbLost;
31
32 /**
33 * Constructor. Only {@link CtfTmfEventFactory} should call this.
34 *
35 * @param trace
36 * The origin trace
37 * @param rank
38 * The rank of the event in the trace
39 * @param content
40 * The event's payload (fields). In case this event has some.
41 * @param fileName
42 * The name of the trace file from which this event comes
43 * @param cpu
44 * The CPU on which this event happened
45 * @param declaration
46 * The CTF Event Declaration object that created this event
47 * @param timeRange
48 * The time range of lost events indicated by this one
49 * @param nbLost
50 * The number of lost events in the range
51 */
52 CtfTmfLostEvent(CtfTmfTrace trace,
53 long rank,
54 String fileName,
55 int cpu,
56 IEventDeclaration declaration,
57 TmfTimeRange timeRange,
58 long nbLost,
59 @NonNull EventDefinition def) {
60 /*
61 * Only the factory should call this method, the case to
62 * (CtfTmfTimestamp) should be safe.
63 */
64 super(trace, rank, (CtfTmfTimestamp) timeRange.getStartTime(), fileName, cpu, declaration, def);
65 fTimeRange = timeRange;
66 fNbLost = nbLost;
67 }
68
69 @Override
70 public TmfTimeRange getTimeRange() {
71 return fTimeRange;
72 }
73
74 @Override
75 public long getNbLostEvents() {
76 return fNbLost;
77 }
78
79 }
This page took 0.03364 seconds and 5 git commands to generate.