import java.io.FileNotFoundException;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.linuxtools.tmf.core.component.ITmfComponent;
-import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
+import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
+import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp;
import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange;
-import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
/**
* <b><u>ITmfTrace</u></b>
* <p>
*/
-public interface ITmfTrace<T extends TmfEvent> extends ITmfComponent {
+public interface ITmfTrace<T extends ITmfEvent> extends ITmfComponent {
// initTrace variants
- public void initTrace(String path, Class<T> eventType) throws FileNotFoundException;
+ public void initTrace(String name, String path, Class<T> eventType) throws FileNotFoundException;
- public void initTrace(String path, Class<T> eventType, int cacheSize) throws FileNotFoundException;
+ public void initTrace(String name, String path, Class<T> eventType, int cacheSize) throws FileNotFoundException;
- public void initTrace(String path, Class<T> eventType, boolean indexTrace) throws FileNotFoundException;
+ public void initTrace(String name, String path, Class<T> eventType, boolean indexTrace) throws FileNotFoundException;
- public void initTrace(String path, Class<T> eventType, int cacheSize, boolean indexTrace) throws FileNotFoundException;
+ public void initTrace(String name, String path, Class<T> eventType, int cacheSize, boolean indexTrace) throws FileNotFoundException;
// Trace type validation
public boolean validate(IProject project, String path);
*/
public TmfTimeRange getTimeRange();
- public TmfTimestamp getStartTime();
+ public ITmfTimestamp getStartTime();
- public TmfTimestamp getEndTime();
+ public ITmfTimestamp getEndTime();
+
+ /**
+ * @return the streaming interval in ms (0 if not streaming)
+ */
+ public long getStreamingInterval();
/**
* Positions the trace at the first event with the specified timestamp or index (i.e. the nth event in the trace).
* Returns a context which can later be used to read the event.
*
* @param location
- * @param timestamp
- * @param rank
* @return a context object for subsequent reads
*/
- public TmfContext seekLocation(ITmfLocation<?> location);
+ public ITmfContext seekLocation(ITmfLocation<?> location);
- public TmfContext seekEvent(TmfTimestamp 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.
* 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.
* Returns the rank of the first event with the requested timestamp. If none, returns the index of the next event
* (if any).
*
- * @param timestamp
- * @return
+ * @param timestamp the requested event timestamp
+ * @return the corresponding event rank
*/
- public long getRank(TmfTimestamp timestamp);
+ public long getRank(ITmfTimestamp timestamp);
/**
* Return the event pointed by the supplied context (or null if no event left) and updates the context to the next
*
* @return the next event in the stream
*/
- public TmfEvent 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 TmfEvent parseEvent(TmfContext context);
+ public ITmfEvent parseEvent(ITmfContext context);
+
+ /**
+ * Set the resource used for persistent properties on this trace
+ * @param resource the properties resource
+ */
+ public void setResource(IResource resource);
+ /**
+ * Get the resource used for persistent properties on this trace
+ * @return the properties resource or null if none is set
+ */
+ public IResource getResource();
}