X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=org.eclipse.linuxtools.ctf.core%2Fsrc%2Forg%2Feclipse%2Flinuxtools%2Fctf%2Fcore%2Ftrace%2FStreamInputReader.java;h=d04a8089cd6222e20fc4c091c7bdb37e357765bd;hb=9ac2eb62ce40169e4da395b9128c511e1ec8dbca;hp=2bb89c934052e1f3fb0a1ee2a14ee1b1dbc76802;hpb=8c35f30934557ba17ffba505626ba553adc98eee;p=deliverable%2Ftracecompass.git diff --git a/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/StreamInputReader.java b/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/StreamInputReader.java index 2bb89c9340..d04a8089cd 100644 --- a/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/StreamInputReader.java +++ b/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/StreamInputReader.java @@ -86,30 +86,67 @@ public class StreamInputReader { // Getters/Setters/Predicates // ------------------------------------------------------------------------ + /** + * Gets the current event in this stream + * + * @return the current event in the stream, null if the stream is + * finished/empty/malformed + */ public EventDefinition getCurrentEvent() { return this.currentEvent; } + /** + * gets the current packet context + * + * @return the current packet context (size, lost events and such) + */ public StructDefinition getCurrentPacketContext() { return this.packetReader.getStreamPacketContextDef(); } + /** + * Gets the byte order for a trace + * + * @return the trace byte order + */ public ByteOrder getByteOrder() { return streamInput.getStream().getTrace().getByteOrder(); } + /** + * Gets the name of the stream (it's an id and a number) + * + * @return gets the stream name (it's a number) + */ public int getName() { return this.name; } + /** + * Sets the name of the stream + * + * @param name + * the name of the stream, (it's a number) + */ public void setName(int name) { this.name = name; } + /** + * Gets the CPU of a stream. It's the same as the one in /proc or running + * the asm CPUID instruction + * + * @return The CPU id (a number) + */ public int getCPU() { return this.packetReader.getCPU(); } + /** + * Gets the filename of the stream being read + * @return The filename of the stream being read + */ public String getFilename() { return streamInput.getFilename(); } @@ -144,7 +181,7 @@ public class StreamInputReader { } } - /* + /*autogenerate javadoc getter setter * If an event is available, read it. */ if (this.packetReader.hasMoreEvents()) { @@ -217,7 +254,7 @@ public class StreamInputReader { // do nothing here } } - if( this.packetReader.getCurrentPacket() == null){ + if (this.packetReader.getCurrentPacket() == null) { gotoPacket(timestamp); } @@ -248,6 +285,9 @@ public class StreamInputReader { goToNextPacket(); } + /** + * Seeks the last event of a stream and returns it. + */ public void goToLastEvent() { /* * Search in the index for the packet to search in. @@ -308,6 +348,10 @@ public class StreamInputReader { this.parent = parent; } + /** + * Sets the current event in a stream input reader + * @param currentEvent the event to set + */ public void setCurrentEvent(EventDefinition currentEvent) { this.currentEvent = currentEvent; }