X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=org.eclipse.linuxtools.tmf.core%2Fsrc%2Forg%2Feclipse%2Flinuxtools%2Ftmf%2Fcore%2Ftrace%2FITmfContext.java;h=2d7aed53660aa126178d8ab057bcc5dc29299eca;hb=cbdacf036a44ec3145f8e508643cddb4901541fc;hp=4606ef1eebcd93c91a491b4bd739a695843106b9;hpb=fcccd90096c4a9d4b5ca41f02cd71390cf1a93d3;p=deliverable%2Ftracecompass.git diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/ITmfContext.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/ITmfContext.java index 4606ef1eeb..2d7aed5366 100644 --- a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/ITmfContext.java +++ b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/ITmfContext.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2010 Ericsson + * Copyright (c) 2009, 2010, 2012 Ericsson * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v1.0 which @@ -8,6 +8,7 @@ * * Contributors: * Francois Chouinard - Initial API and implementation + * Francois Chouinard - Updated as per TMF Trace Model 1.0 *******************************************************************************/ package org.eclipse.linuxtools.tmf.core.trace; @@ -15,28 +16,78 @@ package org.eclipse.linuxtools.tmf.core.trace; /** * ITmfContext *

- * This is a place-holder for the context objects. + * The basic trace context structure in TMF. The purpose of the context is to + * associate a trace location to an event of a specific rank (order). + *

+ * The context should be sufficient to allow the trace to position itself so + * that performing a trace read operation will yield the corresponding event. */ public interface ITmfContext extends Cloneable { - public long UNKNOWN_RANK = -2L; + // ------------------------------------------------------------------------ + // Constants + // ------------------------------------------------------------------------ + + /** + * The initial context event rank, before anything is read from the trace + */ public long INITIAL_RANK = -1L; - public void dispose(); + /** + * The unknown event rank + */ + public long UNKNOWN_RANK = -2L; + + // ------------------------------------------------------------------------ + // Getters + // ------------------------------------------------------------------------ - public void setLocation(ITmfLocation location); + /** + * @return the rank of the event referred to by the context + */ + public long getRank(); + + /** + * @return the location of the event referred to by the context + */ + public ITmfLocation> getLocation(); + + /** + * @return indicates if the context rank is valid (!= UNKNOWN_RANK) + */ + public boolean hasValidRank(); - @SuppressWarnings("rawtypes") - public ITmfLocation getLocation(); + // ------------------------------------------------------------------------ + // Operations + // ------------------------------------------------------------------------ + /** + * @param location the new location + */ + public void setLocation(ITmfLocation> location); + + /** + * @param rank the new rank + */ public void setRank(long rank); - public long getRank(); + /** + * Increment the context rank + */ + public void increaseRank(); - public void updateRank(int rank); + /** + * Cleanup hook + */ + public void dispose(); - public boolean isValidRank(); + // ------------------------------------------------------------------------ + // Cloneable + // ------------------------------------------------------------------------ + /** + * @return a clone of the context + */ public ITmfContext clone(); }