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();