| author | Alexandre Montplaisir | 2012-03-14 16:34:44 (EDT) |
|---|---|---|
| committer | Francois Chouinard | 2012-03-19 17:43:43 (EDT) |
| commit | b5bf72ca186cc78f842e637580b64a74c36f38c4 (patch) (side-by-side diff) | |
| tree | 54b4fe23e00dc05ae01b9a72dbbd25493c68bf8c | |
| parent | 16972ac5da9c6b4c658d8b98144b040c6d2b7ed1 (diff) | |
| download | org.eclipse.linuxtools-b5bf72ca186cc78f842e637580b64a74c36f38c4.zip org.eclipse.linuxtools-b5bf72ca186cc78f842e637580b64a74c36f38c4.tar.gz org.eclipse.linuxtools-b5bf72ca186cc78f842e637580b64a74c36f38c4.tar.bz2 | |
Use ITmfEvent in a couple more places
7 files changed, 26 insertions, 17 deletions
diff --git a/lttng/org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/trace/LTTngExperiment.java b/lttng/org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/trace/LTTngExperiment.java index 040530d..b62fd58 100644 --- a/lttng/org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/trace/LTTngExperiment.java +++ b/lttng/org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/trace/LTTngExperiment.java @@ -30,6 +30,7 @@ import org.eclipse.linuxtools.tmf.core.signal.TmfExperimentRangeUpdatedSignal; import org.eclipse.linuxtools.tmf.core.signal.TmfSignalHandler; import org.eclipse.linuxtools.tmf.core.signal.TmfSignalManager; import org.eclipse.linuxtools.tmf.core.trace.ITmfContext; +import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation; import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; import org.eclipse.linuxtools.tmf.core.trace.TmfContext; @@ -128,7 +129,7 @@ public class LTTngExperiment<T extends ITmfEvent> extends TmfExperiment<T> { // If an event was consumed previously, get the next one from that trace int lastTrace = expContext.getLastTrace(); if (lastTrace != TmfExperimentContext.NO_TRACE) { - TmfContext traceContext = expContext.getContexts()[lastTrace]; + ITmfContext traceContext = expContext.getContexts()[lastTrace]; expContext.getEvents()[lastTrace] = expContext.getTraces()[lastTrace].getNextEvent(traceContext); expContext.setLastTrace(TmfExperimentContext.NO_TRACE); } @@ -163,9 +164,9 @@ public class LTTngExperiment<T extends ITmfEvent> extends TmfExperiment<T> { if (trace != TmfExperimentContext.NO_TRACE) { // updateIndex(expContext, timestamp); - TmfContext traceContext = expContext.getContexts()[trace]; + ITmfContext traceContext = expContext.getContexts()[trace]; TmfExperimentLocation expLocation = (TmfExperimentLocation) expContext.getLocation(); - expLocation.getLocation().locations[trace] = traceContext.getLocation(); + expLocation.getLocation().locations[trace] = (ITmfLocation<? extends Comparable<?>>) traceContext.getLocation(); updateIndex(expContext, timestamp); diff --git a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/experiment/TmfExperiment.java b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/experiment/TmfExperiment.java index e612c74..dd15357 100644 --- a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/experiment/TmfExperiment.java +++ b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/experiment/TmfExperiment.java @@ -400,7 +400,9 @@ public class TmfExperiment<T extends ITmfEvent> extends TmfEventProvider<T> impl rank += traceRank; // Set the trace location and read the corresponding event - expLocation.getLocation().locations[i] = context.getContexts()[i].getLocation().clone(); + /* The (TmfContext) cast should be safe since we created 'context' + * ourselves higher up. */ + expLocation.getLocation().locations[i] = ((TmfContext) context.getContexts()[i]).getLocation().clone(); context.getEvents()[i] = fTraces[i].getNextEvent(context.getContexts()[i]); } @@ -580,7 +582,7 @@ public class TmfExperiment<T extends ITmfEvent> extends TmfEventProvider<T> impl // If an event was consumed previously, get the next one from that trace int lastTrace = expContext.getLastTrace(); if (lastTrace != TmfExperimentContext.NO_TRACE) { - TmfContext traceContext = expContext.getContexts()[lastTrace]; + ITmfContext traceContext = expContext.getContexts()[lastTrace]; expContext.getEvents()[lastTrace] = expContext.getTraces()[lastTrace].getNextEvent(traceContext); expContext.setLastTrace(TmfExperimentContext.NO_TRACE); } @@ -614,10 +616,10 @@ public class TmfExperiment<T extends ITmfEvent> extends TmfEventProvider<T> impl if (trace != TmfExperimentContext.NO_TRACE) { updateIndex(expContext, timestamp); - TmfContext traceContext = expContext.getContexts()[trace]; + ITmfContext traceContext = expContext.getContexts()[trace]; TmfExperimentLocation expLocation = (TmfExperimentLocation) expContext.getLocation(); // expLocation.getLocation()[trace] = traceContext.getLocation().clone(); - expLocation.getLocation().locations[trace] = traceContext.getLocation().clone(); + expLocation.getLocation().locations[trace] = (ITmfLocation<? extends Comparable<?>>) traceContext.getLocation().clone(); // updateIndex(expContext, timestamp); @@ -676,7 +678,7 @@ public class TmfExperiment<T extends ITmfEvent> extends TmfEventProvider<T> impl // If an event was consumed previously, get the next one from that trace int lastTrace = expContext.getLastTrace(); if (lastTrace != TmfExperimentContext.NO_TRACE) { - TmfContext traceContext = expContext.getContexts()[lastTrace]; + ITmfContext traceContext = expContext.getContexts()[lastTrace]; expContext.getEvents()[lastTrace] = expContext.getTraces()[lastTrace].getNextEvent(traceContext); expContext.setLastTrace(TmfExperimentContext.NO_TRACE); fExperimentContext = (TmfExperimentContext) context; diff --git a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/experiment/TmfExperimentContext.java b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/experiment/TmfExperimentContext.java index 0dbc283..785f6ac 100644 --- a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/experiment/TmfExperimentContext.java +++ b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/experiment/TmfExperimentContext.java @@ -13,6 +13,7 @@ package org.eclipse.linuxtools.tmf.core.experiment; import org.eclipse.linuxtools.tmf.core.event.ITmfEvent; +import org.eclipse.linuxtools.tmf.core.trace.ITmfContext; import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation; import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; import org.eclipse.linuxtools.tmf.core.trace.TmfContext; @@ -102,7 +103,7 @@ public class TmfExperimentContext extends TmfContext { return fTraces; } - public TmfContext[] getContexts() { + public ITmfContext[] getContexts() { return fContexts; } diff --git a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/ITmfTrace.java b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/ITmfTrace.java index b9d0e2a..2b5cf66 100644 --- a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/ITmfTrace.java +++ b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/ITmfTrace.java @@ -86,11 +86,11 @@ public interface ITmfTrace<T extends ITmfEvent> extends ITmfComponent { * @param rank * @return a context object for subsequent reads */ - public TmfContext seekLocation(ITmfLocation<?> location); + public ITmfContext seekLocation(ITmfLocation<?> location); - public TmfContext seekEvent(ITmfTimestamp timestamp); + public ITmfContext seekEvent(ITmfTimestamp timestamp); - public TmfContext seekEvent(long rank); + public ITmfContext seekEvent(long rank); /** * Positions the trace at the event located at the specified ratio. @@ -101,7 +101,7 @@ public interface ITmfTrace<T extends ITmfEvent> extends ITmfComponent { * a floating-point number between 0.0 (beginning) and 1.0 (end) * @return a context object for subsequent reads */ - public TmfContext seekLocation(double ratio); + public ITmfContext seekLocation(double ratio); /** * Returns the ratio corresponding to the specified location. diff --git a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTrace.java b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTrace.java index bf8f0d7..8023d1b 100644 --- a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTrace.java +++ b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTrace.java @@ -319,6 +319,9 @@ public abstract class TmfTrace<T extends ITmfEvent> extends TmfEventProvider<T> // ITmfTrace // ------------------------------------------------------------------------ + @Override + public abstract TmfContext seekLocation(ITmfLocation<?> location); + /* (non-Javadoc) * @see org.eclipse.linuxtools.tmf.trace.ITmfTrace#seekEvent(org.eclipse.linuxtools.tmf.event.TmfTimestamp) */ diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/timechart/TimeChartView.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/timechart/TimeChartView.java index 076c233..ecf8730 100644 --- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/timechart/TimeChartView.java +++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/timechart/TimeChartView.java @@ -31,6 +31,7 @@ import org.eclipse.linuxtools.tmf.core.signal.TmfSignalHandler; import org.eclipse.linuxtools.tmf.core.signal.TmfTimeSynchSignal;
import org.eclipse.linuxtools.tmf.core.signal.TmfTraceSelectedSignal;
import org.eclipse.linuxtools.tmf.core.signal.TmfTraceUpdatedSignal;
+import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
import org.eclipse.linuxtools.tmf.core.trace.TmfContext;
import org.eclipse.linuxtools.tmf.ui.editors.ITmfTraceEditor;
@@ -157,7 +158,7 @@ public class TimeChartView extends TmfView implements ITmfTimeScaleSelectionList if (decorationProvider == null) {
return; // the trace has been closed
}
- TmfContext context = null;
+ ITmfContext context = null;
// TmfTimestamp lastTimestamp = null;
boolean done = false;
while (!done) {
@@ -339,7 +340,7 @@ public class TimeChartView extends TmfView implements ITmfTimeScaleSelectionList private volatile boolean interrupted = false;
private final TimeChartAnalysisEntry fTimeAnalysisEntry;
private final TimeChartDecorationProvider fDecorationProvider;
- private TmfContext fContext;
+ private ITmfContext fContext;
private int fCount = 0;
private DecorateThread(TimeChartAnalysisEntry timeAnalysisEntry) {
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/TmfRawEventViewer.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/TmfRawEventViewer.java index b9cdc4c..7869f7d 100644 --- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/TmfRawEventViewer.java +++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/TmfRawEventViewer.java @@ -15,6 +15,7 @@ package org.eclipse.linuxtools.tmf.ui.widgets; import java.util.ArrayList;
import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
+import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
import org.eclipse.linuxtools.tmf.core.trace.TmfContext;
@@ -70,7 +71,7 @@ public class TmfRawEventViewer extends Composite implements ControlListener, Sel private static final int SLIDER_MAX = 1000000;
private ITmfTrace<?> fTrace;
- private TmfContext fBottomContext;
+ private ITmfContext fBottomContext;
private ScrolledComposite fScrolledComposite;
private Composite fTextArea;
@@ -382,7 +383,7 @@ public class TmfRawEventViewer extends Composite implements ControlListener, Sel while (fTopLineIndex < 0) {
ITmfLocation<?> endLocation = fLines.get(0).location;
firstRatio = Math.max(0, firstRatio - delta);
- TmfContext context = fTrace.seekLocation(firstRatio);
+ ITmfContext context = fTrace.seekLocation(firstRatio);
ITmfLocation<?> location;
int index = 0;
long rank = 0;
|

