X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;ds=sidebyside;f=include%2Fbabeltrace%2Fctf-ir%2Ftrace.h;h=858d9681624c6311671f4a1cac9068f26b8b5ae4;hb=c1e730febb17c72e96c356d54b8df31d5c0c0b94;hp=91b09f80eb409be76244dd7c4ff55a333344c194;hpb=a8ff38ef4b08728cd1bb93ae66a888dfbda4fbb2;p=babeltrace.git diff --git a/include/babeltrace/ctf-ir/trace.h b/include/babeltrace/ctf-ir/trace.h index 91b09f80..858d9681 100644 --- a/include/babeltrace/ctf-ir/trace.h +++ b/include/babeltrace/ctf-ir/trace.h @@ -76,6 +76,10 @@ can add an event class to a stream class with bt_ctf_stream_class_add_event_class(). You can add a stream class to a trace class with bt_ctf_trace_add_stream_class(). +You can access the streams of a trace, that is, the streams which were +created from the trace's stream classes with bt_ctf_stream_create(), +with bt_ctf_trace_get_stream(). + A trace class owns the trace packet header \link ctfirfieldtypes field type\endlink, which represents the \c trace.packet.header CTF scope. This field type describes the @@ -720,6 +724,46 @@ extern int bt_ctf_trace_add_stream_class(struct bt_ctf_trace *trace_class, /** @} */ +/** +@name Stream children functions +@{ +*/ + +/** +@brief Returns the number of streams contained in the CTF IR trace + class \p trace_class. + +@param[in] trace_class Trace class of which to get the number + of children streams. +@returns Number of children streams + contained in \p trace_class, or a negative + value on error. + +@prenotnull{trace_class} +@postrefcountsame{trace_class} +*/ +extern int bt_ctf_trace_get_stream_count(struct bt_ctf_trace *trace_class); + +/** +@brief Returns the stream at index \p index in the CTF IR trace + class \p trace_class. + +@param[in] trace_class Trace class of which to get the stream. +@param[in] index Index of the stream to find. +@returns Stream at index \p index, or \c NULL + on error. + +@prenotnull{trace_class} +@pre \p index is lesser than the number of streams contained in + the trace class \p trace_class (see + bt_ctf_trace_get_stream_count()). +@postrefcountsame{trace_class} +*/ +extern struct bt_ctf_stream *bt_ctf_trace_get_stream( + struct bt_ctf_trace *trace_class, int index); + +/** @} */ + /** @name Misc. functions @{