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