import org.eclipse.linuxtools.tmf.trace.ITmfTrace;
import org.eclipse.linuxtools.tmf.trace.TmfCheckpoint;
import org.eclipse.linuxtools.tmf.trace.TmfContext;
-import org.eclipse.linuxtools.tmf.trace.TmfTrace;
/**
* @author alvaro
private void handleIncomingData(LttngEvent e) {
long eventTime = e.getTimestamp().getValue();
- TmfTrace<LttngEvent> inTrace = e.getParentTrace();
+ ITmfTrace inTrace = e.getParentTrace();
LttngTraceState traceModel = traceToTraceStateModel.get(inTrace);
// queue the new event data
syntheticEvent = new LttngSyntheticEvent(e);
}
- TmfTrace<LttngEvent> inTrace = e.getParentTrace();
+ ITmfTrace inTrace = e.getParentTrace();
LttngTraceState traceModel = traceToTraceStateModel.get(inTrace);
// Trace model needed by application handlers
// Reference to the JNI JniEvent. Should only be used INTERNALLY
private JniEvent jniEventReference = null;
- // Reference to the parent trace that own this event
- private TmfTrace<LttngEvent> parentTrace = null;
+// // Reference to the parent trace that own this event
+// private TmfTrace<LttngEvent> parentTrace = null;
/**
* Constructor with parameters.<p>
*
* @param oldEvent Event we want to copy from.
*/
+ @SuppressWarnings("unchecked")
public LttngEvent(LttngEvent oldEvent) {
this(
- oldEvent.getParentTrace(),
+ (TmfTrace<LttngEvent>) oldEvent.getParentTrace(),
(LttngTimestamp)oldEvent.getTimestamp(),
(TmfEventSource)oldEvent.getSource(),
(LttngEventType)oldEvent.getType(),
);
}
-
- /**
- * Return the parent trace associated with this event
- *
- * @return Parent trace
- */
- public TmfTrace<LttngEvent> getParentTrace() {
- return parentTrace;
- }
-
/**
* Set a new parent trace for this event
*
* @param parentTrace The new parent
*/
public void setParentTrace(TmfTrace<LttngEvent> parentTrace) {
- this.parentTrace = parentTrace;
+ fParentTrace = parentTrace;
}
public LttngEvent clone() {
LttngEvent clone = (LttngEvent) super.clone();
clone.getContent().setEvent(clone);
- clone.parentTrace = parentTrace;
clone.jniEventReference = jniEventReference;
return clone;
}
package org.eclipse.linuxtools.tmf.event;
+import org.eclipse.linuxtools.tmf.trace.ITmfTrace;
+
/**
* <b><u>TmfEvent</u></b>
* <p>
// Attributes
// ------------------------------------------------------------------------
+ protected ITmfTrace fParentTrace;
+ protected long fEventRank;
protected TmfTimestamp fEffectiveTimestamp;
protected TmfTimestamp fOriginalTimestamp;
protected TmfEventSource fSource;
// Constructors
// ------------------------------------------------------------------------
+ /**
+ * @param originalTS the original timestamp
+ * @param effectiveTS the effective timestamp
+ * @param source the event source (generator)
+ * @param type the event type
+ * @param reference a free-form reference field
+ */
+ public TmfEvent(ITmfTrace trace, long rank, TmfTimestamp originalTS, TmfTimestamp effectiveTS,
+ TmfEventSource source, TmfEventType type, TmfEventReference reference)
+ {
+ fParentTrace = trace;
+ fEventRank = rank;
+ fOriginalTimestamp = originalTS;
+ fEffectiveTimestamp = effectiveTS;
+ fSource = source;
+ fType = type;
+ fReference = reference;
+ }
+
/**
* @param originalTS the original timestamp
* @param effectiveTS the effective timestamp
public TmfEvent(TmfTimestamp originalTS, TmfTimestamp effectiveTS,
TmfEventSource source, TmfEventType type, TmfEventReference reference)
{
- fOriginalTimestamp = originalTS;
- fEffectiveTimestamp = effectiveTS;
- fSource = source;
- fType = type;
- fReference = reference;
+ this(null, -1, originalTS, effectiveTS, source, type, reference);
}
/**
public TmfEvent(TmfTimestamp timestamp, TmfEventSource source,
TmfEventType type, TmfEventReference reference)
{
- this(timestamp, timestamp, source, type, reference);
+ this(null, -1, timestamp, timestamp, source, type, reference);
}
/**
public TmfEvent(TmfEvent other) {
if (other == null)
throw new IllegalArgumentException();
+ fParentTrace = other.fParentTrace;
+ fEventRank = other.fEventRank;
fOriginalTimestamp = new TmfTimestamp(other.fOriginalTimestamp);
fEffectiveTimestamp = new TmfTimestamp(other.fEffectiveTimestamp);
fSource = new TmfEventSource(other.fSource);
// Accessors
// ------------------------------------------------------------------------
+ /**
+ * @return the parent trace
+ */
+ public ITmfTrace getParentTrace() {
+ return fParentTrace;
+ }
+
+ /**
+ * @return the event rank
+ */
+ public long getEventRank() {
+ return fEventRank;
+ }
+
/**
* @return the effective event timestamp
*/
TmfEvent clone = null;
try {
clone = (TmfEvent) super.clone();
+ clone.fParentTrace = fParentTrace;
+ clone.fEventRank = fEventRank;
clone.fOriginalTimestamp = fOriginalTimestamp.clone();
clone.fEffectiveTimestamp = fEffectiveTimestamp.clone();
clone.fSource = fSource.clone();