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.ITmfTrace;
import org.eclipse.linuxtools.tmf.core.trace.TmfContext;
// ------------------------------------------------------------------------
@Override
- public synchronized ITmfEvent getNextEvent(TmfContext context) {
+ public synchronized ITmfEvent getNextEvent(ITmfContext context) {
// Validate the context
if (!(context instanceof TmfExperimentContext)) {
import org.eclipse.linuxtools.lttng.core.event.LttngTimestamp;
import org.eclipse.linuxtools.lttng.jni.JniEvent;
import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange;
+import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
import org.eclipse.linuxtools.tmf.core.trace.TmfCheckpoint;
import org.eclipse.linuxtools.tmf.core.trace.TmfContext;
return 0;
}
- private LttngEvent parseMyNextEvent(TmfContext context) {
+ private LttngEvent parseMyNextEvent(ITmfContext context) {
// All parsing variables declared here so to be able to print them into the catch if needed
String tmpContent = null;
}
@Override
- public LttngEvent parseEvent(TmfContext context) {
+ public LttngEvent parseEvent(ITmfContext context) {
context = seekLocation(context.getLocation());
return parseMyNextEvent(context);
public int nbEventsRead = 0;
@Override
- public synchronized LttngEvent getNextEvent(TmfContext context) {
+ public synchronized LttngEvent getNextEvent(ITmfContext context) {
if (PrintDebug) {
System.out.println("getNextEvent(context) context.getLocation() -> " //$NON-NLS-1$
}
// this method was extracted for profiling purposes
- private void setPreviousAndCurrentTimes(TmfContext context, LttngEvent returnedEvent, LttngLocation curLocation) {
+ private void setPreviousAndCurrentTimes(ITmfContext context, LttngEvent returnedEvent, LttngLocation curLocation) {
ITmfTimestamp eventTimestamp = returnedEvent.getTimestamp();
// long eventTime = eventTimestamp.getValue();
}
// this method was extracted for profiling purposes
- private LttngLocation getCurrentLocation(TmfContext context) {
+ private LttngLocation getCurrentLocation(ITmfContext context) {
LttngLocation curLocation;
curLocation = new LttngLocation();
context.setLocation(curLocation);
* @see org.eclipse.linuxtools.tmf.core.trace.TmfContext
*/
@Override
- public synchronized LttngEvent parseEvent(TmfContext context) {
+ public synchronized LttngEvent parseEvent(ITmfContext context) {
if (PrintDebug) {
System.out.println("parseEvent(context) context.getLocation() -> " //$NON-NLS-1$
import org.eclipse.linuxtools.lttng.core.event.LttngEvent;
import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
import org.eclipse.linuxtools.tmf.core.parser.ITmfEventParser;
+import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
-import org.eclipse.linuxtools.tmf.core.trace.TmfContext;
/**
* <b><u>TmfEventParserStub</u></b>
* @see org.eclipse.linuxtools.tmf.core.parser.ITmfEventParser#parseNextEvent(org.eclipse.linuxtools.tmf.core.trace.ITmfTrace, org.eclipse.linuxtools.tmf.core.trace.TmfContext)
*/
@Override
- public ITmfEvent parseNextEvent(ITmfTrace<LttngEvent> stream, TmfContext context)
+ public ITmfEvent parseNextEvent(ITmfTrace<LttngEvent> stream, ITmfContext context)
throws IOException {
// TODO Auto-generated method stub
return null;
import org.eclipse.linuxtools.lttng.core.event.LttngEvent;
import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
import org.eclipse.linuxtools.tmf.core.parser.ITmfEventParser;
+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;
* @see org.eclipse.linuxtools.tmf.trace.ITmfTrace#parseEvent()
*/
@Override
- public ITmfEvent parseEvent(TmfContext context) {
+ public ITmfEvent parseEvent(ITmfContext context) {
try {
// paserNextEvent updates the context
LttngEvent event = (LttngEvent) fParser.parseNextEvent(this, context);
import org.eclipse.linuxtools.tmf.core.event.TmfEventType;
import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
import org.eclipse.linuxtools.tmf.core.parser.ITmfEventParser;
+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.core.trace.TmfLocation;
/**
static final String typePrefix = "Type-";
@Override
@SuppressWarnings("unchecked")
- public ITmfEvent parseNextEvent(ITmfTrace<TmfEvent> eventStream, TmfContext context) throws IOException {
+ public ITmfEvent parseNextEvent(ITmfTrace<TmfEvent> eventStream, ITmfContext context) throws IOException {
if (! (eventStream instanceof TmfTraceStub)) {
return null;
}
@Override
- public ITmfEvent parseEvent(TmfContext context) {
+ public ITmfEvent parseEvent(ITmfContext context) {
fLock.lock();
try {
// parseNextEvent will update the context
// }
@Override
- public synchronized ITmfEvent getNextEvent(TmfContext context) {
+ public synchronized ITmfEvent getNextEvent(ITmfContext context) {
// Validate the context
if (!(context instanceof TmfExperimentContext)) {
* @see org.eclipse.linuxtools.tmf.trace.ITmfTrace#parseEvent(org.eclipse.linuxtools .tmf.trace.TmfContext)
*/
@Override
- public ITmfEvent parseEvent(TmfContext context) {
+ public ITmfEvent parseEvent(ITmfContext context) {
// Validate the context
if (!(context instanceof TmfExperimentContext)) {
import java.io.IOException;
import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
+import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
-import org.eclipse.linuxtools.tmf.core.trace.TmfContext;
/**
* <b><u>ITmfEventParser</u></b>
* @return
* @throws IOException
*/
- public ITmfEvent parseNextEvent(ITmfTrace<T> stream, TmfContext context) throws IOException;
+ public ITmfEvent parseNextEvent(ITmfTrace<T> stream, ITmfContext context) throws IOException;
}
* <p>
* This is a place-holder for the context objects.
*/
-public interface ITmfContext {
+public interface ITmfContext extends Cloneable {
public long UNKNOWN_RANK = -2L;
public long INITIAL_RANK = -1L;
public void updateRank(int rank);
public boolean isValidRank();
+
+ public ITmfContext clone();
+
}
*
* @return the next event in the stream
*/
- public ITmfEvent getNextEvent(TmfContext context);
+ public ITmfEvent getNextEvent(ITmfContext context);
/**
* Return the event pointed by the supplied context (or null if no event left) and *does not* update the context.
*
* @return the next event in the stream
*/
- public ITmfEvent parseEvent(TmfContext context);
+ public ITmfEvent parseEvent(ITmfContext context);
}
* linuxtools.tmf.trace.ITmfTrace.TraceContext)
*/
@Override
- public synchronized ITmfEvent getNextEvent(TmfContext context) {
+ public synchronized ITmfEvent getNextEvent(ITmfContext context) {
// parseEvent() does not update the context
ITmfEvent event = parseEvent(context);
if (event != null) {
import org.eclipse.linuxtools.tmf.core.event.TmfEventType;
import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
import org.eclipse.linuxtools.tmf.core.parser.ITmfEventParser;
+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.core.trace.TmfLocation;
import org.eclipse.linuxtools.tmf.stubs.trace.TmfTraceStub;
@Override
@SuppressWarnings({ "unchecked", "nls" })
- public TmfEvent parseNextEvent(ITmfTrace<TmfEvent> eventStream, TmfContext context) throws IOException {
+ public TmfEvent parseNextEvent(ITmfTrace<TmfEvent> eventStream, ITmfContext context) throws IOException {
if (! (eventStream instanceof TmfTraceStub)) {
return null;
}
}\r
\r
@Override\r
- public synchronized TmfEvent getNextEvent(TmfContext context) {\r
+ public synchronized TmfEvent getNextEvent(ITmfContext context) {\r
ITmfContext savedContext = context.clone();\r
TmfEvent event = parseEvent(context);\r
if (event != null) {\r
}\r
\r
@Override\r
- public TmfEvent parseEvent(TmfContext tmfContext) {\r
+ public TmfEvent parseEvent(ITmfContext tmfContext) {\r
if (!(tmfContext instanceof CustomTxtTraceContext)) {\r
return null;\r
}\r
}\r
\r
@Override\r
- public synchronized TmfEvent getNextEvent(TmfContext context) {\r
+ public synchronized TmfEvent getNextEvent(ITmfContext context) {\r
ITmfContext savedContext = context.clone();\r
TmfEvent event = parseEvent(context);\r
if (event != null) {\r
}\r
\r
@Override\r
- public TmfEvent parseEvent(TmfContext tmfContext) {\r
+ public TmfEvent parseEvent(ITmfContext tmfContext) {\r
if (!(tmfContext instanceof CustomXmlTraceContext)) {\r
return null;\r
}\r