tmf.ctf: Split the classes into proper packages
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.ctf.core / src / org / eclipse / tracecompass / tmf / ctf / core / event / 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.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.TmfTimeRange;
20 import org.eclipse.tracecompass.tmf.ctf.core.timestamp.CtfTmfTimestamp;
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 * @since 2.2
28 */
29 public class CtfTmfLostEvent extends CtfTmfEvent implements ITmfLostEvent {
30
31 private final TmfTimeRange fTimeRange;
32 private final long fNbLost;
33
34 /**
35 * Constructor. Only {@link CtfTmfEventFactory} should call this.
36 *
37 * @param trace
38 * The origin trace
39 * @param rank
40 * The rank of the event in the trace
41 * @param content
42 * The event's payload (fields). In case this event has some.
43 * @param fileName
44 * The name of the trace file from which this event comes
45 * @param cpu
46 * The CPU on which this event happened
47 * @param declaration
48 * The CTF Event Declaration object that created this event
49 * @param timeRange
50 * The time range of lost events indicated by this one
51 * @param nbLost
52 * The number of lost events in the range
53 */
54 CtfTmfLostEvent(CtfTmfTrace trace,
55 long rank,
56 String fileName,
57 int cpu,
58 IEventDeclaration declaration,
59 TmfTimeRange timeRange,
60 long nbLost,
61 @NonNull EventDefinition def) {
62 /*
63 * Only the factory should call this method, the case to
64 * (CtfTmfTimestamp) should be safe.
65 */
66 super(trace, rank, (CtfTmfTimestamp) timeRange.getStartTime(), fileName, cpu, declaration, def);
67 fTimeRange = timeRange;
68 fNbLost = nbLost;
69 }
70
71 @Override
72 public TmfTimeRange getTimeRange() {
73 return fTimeRange;
74 }
75
76 @Override
77 public long getNbLostEvents() {
78 return fNbLost;
79 }
80
81 }
This page took 0.034301 seconds and 5 git commands to generate.