X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=org.eclipse.linuxtools.ctf.core%2Fsrc%2Forg%2Feclipse%2Flinuxtools%2Finternal%2Fctf%2Fcore%2Ftrace%2FStream.java;h=bd9234159c46ce234a82bbb7f51d23f873d69789;hb=59db415b0a32a50c5661e2256127f69a5f0d5cf1;hp=1434fa781b5137b5260394d45da716bcab90c125;hpb=788ddcbcf4fa90a56b6f454a7cb0bf35a8c42bf4;p=deliverable%2Ftracecompass.git diff --git a/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/trace/Stream.java b/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/trace/Stream.java index 1434fa781b..bd9234159c 100644 --- a/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/trace/Stream.java +++ b/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/trace/Stream.java @@ -53,7 +53,7 @@ public class Stream { /** * Maps event ids to events */ - private HashMap events; + private HashMap events = new HashMap(); /** * The inputs associated to this stream @@ -78,63 +78,124 @@ public class Stream { // Getters/Setters/Predicates // ------------------------------------------------------------------------ + /** + * Sets the id of a stream + * @param id the id of a stream + */ public void setId(long id) { this.id = id; this.events = trace.createEvents(this.id); } + /** + * Gets the id of a stream + * @return id the id of a stream + */ public Long getId() { return id; } - public boolean idIsSet() { + /** + * Is the id of a stream set + * + * @return If the ID is set or not + */ + public boolean isIdSet() { return id != null; } - public boolean eventHeaderIsSet() { + /** + * + * @return is the event header set (timestamp and stuff) (see Ctf Spec) + */ + public boolean isEventHeaderSet() { return eventHeaderDecl != null; } - public boolean eventContextIsSet() { + /** + * + * @return is the event context set (pid and stuff) (see Ctf Spec) + */ + public boolean isEventContextSet() { return eventContextDecl != null; } - public boolean packetContextIsSet() { + /** + * + * @return Is the packet context set (see Ctf Spec) + */ + public boolean isPacketContextSet() { return packetContextDecl != null; } + /** + * + * @param eventHeader the current event header for all events in this stream + */ public void setEventHeader(StructDeclaration eventHeader) { this.eventHeaderDecl = eventHeader; } + /** + * + * @param eventContext the context for all events in this stream + */ public void setEventContext(StructDeclaration eventContext) { this.eventContextDecl = eventContext; } + /** + * + * @param packetContext the packet context for all packets in this stream + */ public void setPacketContext(StructDeclaration packetContext) { this.packetContextDecl = packetContext; } + /** + * + * @return the event header declaration in structdeclaration form + */ public StructDeclaration getEventHeaderDecl() { return eventHeaderDecl; } + /** + * + * @return the event context declaration in structdeclaration form + */ public StructDeclaration getEventContextDecl() { return eventContextDecl; } + /** + * + * @return the packet context declaration in structdeclaration form + */ public StructDeclaration getPacketContextDecl() { return packetContextDecl; } + /** + * + * @return the set of all stream inputs for this stream + */ public Set getStreamInputs() { return inputs; } + /** + * + * @return the parent trace + */ public CTFTrace getTrace() { return trace; } + /** + * + * @return all the event declarations for this stream, using the id as a key for the hashmap. + */ public HashMap getEvents() { return events; } @@ -153,8 +214,10 @@ public class Stream { * is present in the map. * * @param event - * The event to add. + * The event to add * @throws ParseException + * If there was a problem reading the event or adding it to the + * stream */ public void addEvent(EventDeclaration event) throws ParseException { /*