2 * SPDX-License-Identifier: MIT
4 * Copyright (C) 2010-2019 EfficiOS Inc. and Linux Foundation
7 #ifndef BABELTRACE2_TRACE_IR_STREAM_CLASS_H
8 #define BABELTRACE2_TRACE_IR_STREAM_CLASS_H
10 #ifndef __BT_IN_BABELTRACE_H
11 # error "Please include <babeltrace2/babeltrace.h> instead."
16 #include <babeltrace2/types.h>
23 @defgroup api-tir-stream-cls Stream class
27 Class of \bt_p_stream.
29 A <strong><em>stream class</em></strong> is the class of \bt_p_stream:
31 @image html trace-structure.png
33 In the illustration above, notice that:
35 - A \bt_stream is a conceptual \ref api-msg-seq "sequence of messages".
37 The sequence always starts with a \bt_sb_msg and ends with a
40 - A stream is an instance of a stream class.
42 A stream class is a \ref api-tir "trace IR" metadata object.
44 A stream class is a \ref api-fund-shared-object "shared object": get a
45 new reference with bt_stream_class_get_ref() and put an existing
46 reference with bt_stream_class_put_ref().
48 Some library functions \ref api-fund-freezing "freeze" stream classes on
49 success. The documentation of those functions indicate this
50 postcondition. You can still create and add an \bt_p_ev_cls to a frozen
51 stream class with bt_event_class_create() or
52 bt_event_class_create_with_id().
54 The type of a stream class is #bt_stream_class.
56 A \bt_trace_cls contains stream classes. All the stream classes of a
57 given trace class have unique
58 \ref api-tir-stream-cls-prop-id "numeric IDs". Borrow the trace class
59 which contains a stream class with bt_stream_class_borrow_trace_class()
60 or bt_stream_class_borrow_trace_class_const().
62 A stream class contains \bt_p_ev_cls. All the event classes of a given
63 stream class have unique \ref api-tir-ev-cls-prop-id "numeric IDs". Get
64 the number of event classes in a stream class with
65 bt_stream_class_get_event_class_count(). Borrow a specific event class
66 from a stream class with bt_stream_class_borrow_event_class_by_index(),
67 bt_stream_class_borrow_event_class_by_index_const(),
68 bt_stream_class_borrow_event_class_by_id(), and
69 bt_stream_class_borrow_event_class_by_id_const().
71 A stream class controls what its instances (\bt_p_stream) support:
74 <dt>Default clock</dt>
76 By default, a stream class's streams do not have default clocks.
78 Set the default \bt_clock_cls of a stream class with
79 bt_stream_class_set_default_clock_class(). This makes all its
80 streams have their own default clock.
83 <dt>\anchor api-tir-stream-cls-pkt-support Packets</dt>
85 By default, a stream class's streams do not support \bt_p_pkt.
87 In other words, you cannot create a packet for such a stream,
88 therefore you cannot create \bt_p_pb_msg and \bt_p_pe_msg for this
91 Enable packet support for a stream class's streams with
92 bt_stream_class_set_supports_packets().
94 bt_stream_class_set_supports_packets() also configures whether or
95 not the packets of the stream class's instances have beginning
96 and/or end default \bt_p_cs.
99 <dt>Discarded events</dt>
101 By default, a stream class's streams do not support discarded
104 In other words, you cannot create \bt_p_disc_ev_msg for such a
107 Enable discarded events support for a stream class's streams with
108 bt_stream_class_set_supports_discarded_events().
110 bt_stream_class_set_supports_discarded_events() also configures
111 whether or not the discarded events messages of the stream class's
112 instances have beginning and end default \bt_p_cs to indicate the
113 discarded events time range.
116 <dt>Discarded packets</dt>
118 By default, a stream class's streams do not support discarded
121 In other words, you cannot create \bt_p_disc_pkt_msg for such a
124 Enable discarded packets support for a stream class's streams with
125 bt_stream_class_set_supports_discarded_packets(). This also implies
126 that you must enable packet support with
127 bt_stream_class_set_supports_packets().
129 bt_stream_class_set_supports_discarded_packets() also configures
130 whether or not the discarded packets messages of the stream class's
131 instances have beginning and end \bt_p_cs to indicate the
132 discarded packets time range.
136 Set whether or not the \bt_p_ev_cls and \bt_p_stream you create for a
137 stream class get automatic numeric IDs with
138 bt_stream_class_set_assigns_automatic_event_class_id() and
139 bt_stream_class_set_assigns_automatic_stream_id().
141 To create a default stream class:
145 If bt_trace_class_assigns_automatic_stream_class_id() returns
146 #BT_TRUE (the default) for the trace class to use
148 <dd>Use bt_stream_class_create().</dd>
151 If bt_trace_class_assigns_automatic_stream_class_id() returns
152 #BT_FALSE for the trace class to use
154 <dd>Use bt_stream_class_create_with_id().</dd>
159 A stream class has the following properties:
162 <dt>\anchor api-tir-stream-cls-prop-id Numeric ID</dt>
164 Numeric ID, unique amongst the numeric IDs of the stream class's
165 \bt_trace_cls's stream classes.
167 Depending on whether or not the stream class's trace class
168 automatically assigns \bt_ev_cls IDs
169 (see bt_trace_class_assigns_automatic_stream_class_id()),
170 set the stream class's numeric ID on creation with
171 bt_stream_class_create() or bt_stream_class_create_with_id().
173 You cannot change the numeric ID once the stream class is created.
175 Get a stream class's numeric ID with bt_stream_class_get_id().
178 <dt>\anchor api-tir-stream-cls-prop-name \bt_dt_opt Name</dt>
180 Name of the stream class.
182 Use bt_stream_class_set_name() and bt_stream_class_get_name().
186 \anchor api-tir-stream-cls-prop-def-clock-cls
187 \bt_dt_opt Default clock class
190 Default \bt_clock_cls of the stream class.
192 As of \bt_name_version_min_maj, a stream class either has a default
193 clock class or none: it cannot have more than one clock class.
195 When a stream class has a default clock class, then all its
196 instances (\bt_p_stream) have a default clock which is an instance
197 of the stream class's default clock class.
199 Use bt_stream_class_set_default_clock_class(),
200 bt_stream_class_borrow_default_clock_class(), and
201 bt_stream_class_borrow_default_clock_class_const().
205 \anchor api-tir-stream-cls-prop-pc-fc
206 \bt_dt_opt Packet context field class
209 \bt_c_pkt context \bt_fc of the stream class.
211 This property is only relevant if the stream class
212 \ref api-tir-stream-cls-prop-supports-pkt "supports packets".
214 The context of a \bt_pkt contains data which is common to all the
217 Use bt_stream_class_set_packet_context_field_class()
218 bt_stream_class_borrow_packet_context_field_class(),
219 and bt_stream_class_borrow_packet_context_field_class_const().
223 \anchor api-tir-stream-cls-prop-ecc-fc
224 \bt_dt_opt Event common context field class
227 \bt_c_ev common context \bt_fc of the stream class.
229 The common context of an \bt_ev contains contextual data of which
230 the layout is common to all the stream class's \bt_p_ev_cls.
232 Use bt_stream_class_set_event_common_context_field_class()
233 bt_stream_class_borrow_event_common_context_field_class(),
234 and bt_stream_class_borrow_event_common_context_field_class_const().
238 \anchor api-tir-stream-cls-prop-auto-ec-id
239 Assigns automatic event class IDs?
242 Whether or not the \bt_p_ev_cls you create and add to the stream
243 class get \ref api-tir-ev-cls-prop-id "numeric IDs" automatically.
245 Depending on the value of this property, to create an event class
246 and add it to the stream class:
251 Use bt_event_class_create().
256 Use bt_event_class_create_with_id().
260 Use bt_stream_class_set_assigns_automatic_event_class_id()
261 and bt_stream_class_assigns_automatic_event_class_id().
265 \anchor api-tir-stream-cls-prop-auto-stream-id
266 Assigns automatic stream IDs?
269 Whether or not the streams you create from the stream class
270 get \ref api-tir-stream-prop-id "numeric IDs" automatically.
272 Depending on the value of this property, to create a stream
273 from the stream class:
278 Use bt_stream_create().
283 Use bt_stream_create_with_id().
287 Use bt_stream_class_set_assigns_automatic_stream_id()
288 and bt_stream_class_assigns_automatic_stream_id().
292 \anchor api-tir-stream-cls-prop-supports-pkt
296 Whether or not the streams you create from the stream class
299 If a stream has packets, then all the stream's \bt_p_ev are
300 conceptually contained within packets, which means you must
301 create \bt_p_ev_msg for such streams with
302 bt_message_event_create_with_packet() or
303 bt_message_event_create_with_packet_and_default_clock_snapshot()
304 instead of bt_message_event_create() or
305 bt_message_event_create_with_default_clock_snapshot().
307 It also means you must create \bt_p_pb_msg and \bt_p_pe_msg to
308 indicate where packets begin and end within the stream's
309 \ref api-msg-seq "message sequence".
311 Use bt_stream_class_set_supports_packets() and
312 bt_stream_class_supports_packets().
316 \anchor api-tir-stream-cls-prop-pkt-beg-cs
317 Packets have a beginning default clock snapshot?
320 Whether or not the \bt_p_pkt of the streams you create from the
321 stream class have beginning default \bt_p_cs.
323 This property is only relevant if the stream class
324 \ref api-tir-stream-cls-prop-supports-pkt "supports packets" and
326 \ref api-tir-stream-cls-prop-def-clock-cls "default clock class".
328 If the stream packets have a beginning default clock snapshot, then
329 you must create \bt_p_pb_msg with
330 bt_message_packet_beginning_create_with_default_clock_snapshot()
331 instead of bt_message_packet_beginning_create().
333 Use bt_stream_class_set_supports_packets() and
334 bt_stream_class_packets_have_beginning_default_clock_snapshot().
338 \anchor api-tir-stream-cls-prop-pkt-end-cs
339 Packets have an end default clock snapshot?
342 Whether or not the \bt_p_pkt of the streams you create from the
343 stream class have end default \bt_p_cs.
345 This property is only relevant if the stream class
346 \ref api-tir-stream-cls-prop-supports-pkt "supports packets" and
348 \ref api-tir-stream-cls-prop-def-clock-cls "default clock class".
350 If the stream packets have an end default clock snapshot, then you
351 must create \bt_p_pe_msg with
352 bt_message_packet_end_create_with_default_clock_snapshot() instead
353 of bt_message_packet_end_create().
355 Use bt_stream_class_set_supports_packets() and
356 bt_stream_class_packets_have_end_default_clock_snapshot().
360 \anchor api-tir-stream-cls-prop-supports-disc-ev
361 Supports discarded events?
364 Whether or not the streams you create from the stream class can have
367 If the stream class supports discarded events, then you can create
368 \bt_p_disc_ev_msg for this stream.
370 Use bt_stream_class_set_supports_discarded_events()
371 and bt_stream_class_supports_discarded_events().
375 \anchor api-tir-stream-cls-prop-disc-ev-cs
376 Discarded events have default clock snapshots?
379 Whether or not the stream's \bt_p_disc_ev_msg have
380 default beginning and end \bt_p_cs to indicate the discarded events
383 This property is only relevant if the stream class
384 \ref api-tir-stream-cls-prop-supports-disc-ev "supports discarded events"
386 \ref api-tir-stream-cls-prop-def-clock-cls "default clock class".
388 If the stream's discarded events messages have beginning and end
389 default clock snapshots, then you must create them with
390 bt_message_discarded_events_create_with_default_clock_snapshots()
391 instead of bt_message_discarded_events_create().
393 Use bt_stream_class_set_supports_discarded_events()
394 and bt_stream_class_discarded_events_have_default_clock_snapshots().
398 \anchor api-tir-stream-cls-prop-supports-disc-pkt
399 Supports discarded packets?
402 Whether or not the streams you create from the stream class can have
405 This property is only relevant if the stream class
406 \ref api-tir-stream-cls-prop-supports-pkt "supports packets".
408 If the stream class supports discarded packets, then you can create
409 \bt_p_disc_pkt_msg for this stream.
411 Use bt_stream_class_set_supports_discarded_packets()
412 and bt_stream_class_supports_discarded_packets().
416 \anchor api-tir-stream-cls-prop-disc-pkt-cs
417 Discarded packets have default clock snapshots?
420 Whether or not the stream's \bt_p_disc_pkt_msg have
421 default beginning and end \bt_p_cs to indicate the discarded
424 This property is only relevant if the stream class
425 \ref api-tir-stream-cls-prop-supports-disc-pkt "supports discarded packets"
427 \ref api-tir-stream-cls-prop-def-clock-cls "default clock class".
429 If the stream's discarded packets messages have default clock
430 snapshots, then you must create them with
431 bt_message_discarded_packets_create_with_default_clock_snapshots()
432 instead of bt_message_discarded_packets_create().
434 Use bt_stream_class_set_supports_discarded_packets()
435 and bt_stream_class_discarded_packets_have_default_clock_snapshots().
439 \anchor api-tir-stream-cls-prop-user-attrs
440 \bt_dt_opt User attributes
443 User attributes of the stream class.
445 User attributes are custom attributes attached to a stream class.
447 Use bt_stream_class_set_user_attributes(),
448 bt_stream_class_borrow_user_attributes(), and
449 bt_stream_class_borrow_user_attributes_const().
460 @typedef struct bt_stream_class bt_stream_class;
475 Creates a default stream class and adds it to the \bt_trace_cls
480 Only use this function if
483 bt_trace_class_assigns_automatic_stream_class_id(trace_class)
488 Otherwise, use bt_stream_class_create_with_id().
491 On success, the returned stream class has the following property values:
498 <td>\ref api-tir-stream-cls-prop-id "Numeric ID"
499 <td>Automatically assigned by \bt_p{trace_class}
501 <td>\ref api-tir-stream-cls-prop-name "Name"
504 <td>\ref api-tir-stream-cls-prop-def-clock-cls "Default clock class"
507 <td>\ref api-tir-stream-cls-prop-pc-fc "Packet context field class"
510 <td>\ref api-tir-stream-cls-prop-ecc-fc "Event common context field class"
513 <td>\ref api-tir-stream-cls-prop-auto-ec-id "Assigns automatic event class IDs?"
516 <td>\ref api-tir-stream-cls-prop-auto-stream-id "Assigns automatic stream IDs?"
519 <td>\ref api-tir-stream-cls-prop-supports-pkt "Supports packets?"
522 <td>\ref api-tir-stream-cls-prop-pkt-beg-cs "Packets have a beginning default clock snapshot?"
525 <td>\ref api-tir-stream-cls-prop-pkt-end-cs "Packets have an end default clock snapshot?"
528 <td>\ref api-tir-stream-cls-prop-supports-disc-ev "Supports discarded events?"
531 <td>\ref api-tir-stream-cls-prop-disc-ev-cs "Discarded events have default clock snapshots?"
534 <td>\ref api-tir-stream-cls-prop-supports-disc-pkt "Supports discarded packets?"
537 <td>\ref api-tir-stream-cls-prop-disc-pkt-cs "Discarded packets have default clock snapshots?"
540 <td>\ref api-tir-stream-cls-prop-user-attrs "User attributes"
541 <td>Empty \bt_map_val
544 @param[in] trace_class
545 Trace class to add the created stream class to.
548 New stream class reference, or \c NULL on memory error.
550 @bt_pre_not_null{trace_class}
552 <code>bt_trace_class_assigns_automatic_stream_class_id(trace_class)</code>
555 @bt_post_success_frozen{trace_class}
557 @sa bt_stream_class_create_with_id() —
558 Creates a stream class with a specific numeric ID and adds it to a
561 extern bt_stream_class
*bt_stream_class_create(
562 bt_trace_class
*trace_class
);
566 Creates a default stream class with the numeric ID \bt_p{id} and adds
567 it to the \bt_trace_cls \bt_p{trace_class}.
571 Only use this function if
574 bt_trace_class_assigns_automatic_stream_class_id(trace_class)
579 Otherwise, use bt_stream_class_create().
582 On success, the returned stream class has the following property values:
589 <td>\ref api-tir-stream-cls-prop-id "Numeric ID"
592 <td>\ref api-tir-stream-cls-prop-name "Name"
595 <td>\ref api-tir-stream-cls-prop-def-clock-cls "Default clock class"
598 <td>\ref api-tir-stream-cls-prop-pc-fc "Packet context field class"
601 <td>\ref api-tir-stream-cls-prop-ecc-fc "Event common context field class"
604 <td>\ref api-tir-stream-cls-prop-auto-ec-id "Assigns automatic event class IDs?"
607 <td>\ref api-tir-stream-cls-prop-auto-stream-id "Assigns automatic stream IDs?"
610 <td>\ref api-tir-stream-cls-prop-supports-pkt "Supports packets?"
613 <td>\ref api-tir-stream-cls-prop-pkt-beg-cs "Packets have a beginning default clock snapshot?"
616 <td>\ref api-tir-stream-cls-prop-pkt-end-cs "Packets have an end default clock snapshot?"
619 <td>\ref api-tir-stream-cls-prop-supports-disc-ev "Supports discarded events?"
622 <td>\ref api-tir-stream-cls-prop-disc-ev-cs "Discarded events have default clock snapshots?"
625 <td>\ref api-tir-stream-cls-prop-supports-disc-pkt "Supports discarded packets?"
628 <td>\ref api-tir-stream-cls-prop-disc-pkt-cs "Discarded packets have default clock snapshots?"
631 <td>\ref api-tir-stream-cls-prop-user-attrs "User attributes"
632 <td>Empty \bt_map_val
635 @param[in] trace_class
636 Trace class to add the created stream class to.
638 Numeric ID of the stream class to create and add to
642 New stream class reference, or \c NULL on memory error.
644 @bt_pre_not_null{trace_class}
646 <code>bt_trace_class_assigns_automatic_stream_class_id(trace_class)</code>
649 \bt_p{trace_class} does not contain a stream class with the numeric
652 @bt_post_success_frozen{trace_class}
654 @sa bt_stream_class_create() —
655 Creates a stream class with an automatic numeric ID and adds it to a
658 extern bt_stream_class
*bt_stream_class_create_with_id(
659 bt_trace_class
*trace_class
, uint64_t id
);
664 @name Trace class access
670 Borrows the \bt_trace_cls which contains the stream class
673 @param[in] stream_class
674 Stream class from which to borrow the trace class which contains it.
677 Trace class which contains \bt_p{stream_class}.
679 @bt_pre_not_null{stream_class}
681 @sa bt_stream_class_borrow_trace_class_const() —
682 \c const version of this function.
684 extern bt_trace_class
*bt_stream_class_borrow_trace_class(
685 bt_stream_class
*stream_class
);
689 Borrows the \bt_trace_cls which contains the stream class
690 \bt_p{stream_class} (\c const version).
692 See bt_stream_class_borrow_trace_class().
694 extern const bt_trace_class
*bt_stream_class_borrow_trace_class_const(
695 const bt_stream_class
*stream_class
);
700 @name Event class access
706 Returns the number of \bt_p_ev_cls contained in the stream
707 class \bt_p{stream_class}.
709 @param[in] stream_class
710 Stream class of which to get the number of contained event classes.
713 Number of contained event classes in \bt_p{stream_class}.
715 @bt_pre_not_null{stream_class}
717 extern uint64_t bt_stream_class_get_event_class_count(
718 const bt_stream_class
*stream_class
);
722 Borrows the \bt_ev_cls at index \bt_p{index} from the
723 stream class \bt_p{stream_class}.
725 @param[in] stream_class
726 Stream class from which to borrow the event class at index
729 Index of the event class to borrow from \bt_p{stream_class}.
733 \em Borrowed reference of the event class of
734 \bt_p{stream_class} at index \bt_p{index}.
736 The returned pointer remains valid as long as \bt_p{stream_class}
740 @bt_pre_not_null{stream_class}
742 \bt_p{index} is less than the number of event classes in
743 \bt_p{stream_class} (as returned by
744 bt_stream_class_get_event_class_count()).
746 @sa bt_stream_class_get_event_class_count() —
747 Returns the number of event classes contained in a stream class.
748 @sa bt_stream_class_borrow_event_class_by_index_const() —
749 \c const version of this function.
751 extern bt_event_class
*
752 bt_stream_class_borrow_event_class_by_index(
753 bt_stream_class
*stream_class
, uint64_t index
);
757 Borrows the \bt_ev_cls at index \bt_p{index} from the
758 stream class \bt_p{stream_class} (\c const version).
760 See bt_stream_class_borrow_event_class_by_index().
762 extern const bt_event_class
*
763 bt_stream_class_borrow_event_class_by_index_const(
764 const bt_stream_class
*stream_class
, uint64_t index
);
768 Borrows the \bt_ev_cls having the numeric ID \bt_p{id} from the
769 stream class \bt_p{stream_class}.
771 If there's no event class having the numeric ID \bt_p{id} in
772 \bt_p{stream_class}, this function returns \c NULL.
774 @param[in] stream_class
775 Stream class from which to borrow the event class having the
776 numeric ID \bt_p{id}.
778 ID of the event class to borrow from \bt_p{stream_class}.
782 \em Borrowed reference of the event class of
783 \bt_p{stream_class} having the numeric ID \bt_p{id}, or \c NULL
786 The returned pointer remains valid as long as \bt_p{stream_class}
790 @bt_pre_not_null{stream_class}
792 @sa bt_stream_class_borrow_event_class_by_id_const() —
793 \c const version of this function.
795 extern bt_event_class
*
796 bt_stream_class_borrow_event_class_by_id(
797 bt_stream_class
*stream_class
, uint64_t id
);
801 Borrows the \bt_ev_cls having the numeric ID \bt_p{id} from the
802 stream class \bt_p{stream_class} (\c const version).
804 See bt_stream_class_borrow_event_class_by_id().
806 extern const bt_event_class
*
807 bt_stream_class_borrow_event_class_by_id_const(
808 const bt_stream_class
*stream_class
, uint64_t id
);
819 Returns the numeric ID of the stream class \bt_p{stream_class}.
821 See the \ref api-tir-stream-cls-prop-id "numeric ID" property.
823 @param[in] stream_class
824 Stream class of which to get the numeric ID.
827 Numeric ID of \bt_p{stream_class}.
829 @bt_pre_not_null{stream_class}
831 @sa bt_stream_class_create_with_id() —
832 Creates a stream class with a specific numeric ID and adds it to a
835 extern uint64_t bt_stream_class_get_id(
836 const bt_stream_class
*stream_class
);
840 Status codes for bt_stream_class_set_name().
842 typedef enum bt_stream_class_set_name_status
{
847 BT_STREAM_CLASS_SET_NAME_STATUS_OK
= __BT_FUNC_STATUS_OK
,
853 BT_STREAM_CLASS_SET_NAME_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
854 } bt_stream_class_set_name_status
;
858 Sets the name of the stream class \bt_p{stream_class} to
859 a copy of \bt_p{name}.
861 See the \ref api-tir-stream-cls-prop-name "name" property.
863 @param[in] stream_class
864 Stream class of which to set the name to \bt_p{name}.
866 New name of \bt_p{stream_class} (copied).
868 @retval #BT_STREAM_CLASS_SET_NAME_STATUS_OK
870 @retval #BT_STREAM_CLASS_SET_NAME_STATUS_MEMORY_ERROR
873 @bt_pre_not_null{stream_class}
874 @bt_pre_hot{stream_class}
875 @bt_pre_not_null{name}
877 @sa bt_stream_class_get_name() —
878 Returns the name of a stream class.
880 extern bt_stream_class_set_name_status
bt_stream_class_set_name(
881 bt_stream_class
*stream_class
, const char *name
);
885 Returns the name of the stream class \bt_p{stream_class}.
887 See the \ref api-tir-stream-cls-prop-name "name" property.
889 If \bt_p{stream_class} has no name, this function returns \c NULL.
891 @param[in] stream_class
892 Stream class of which to get the name.
896 Name of \bt_p{stream_class}, or \c NULL if none.
898 The returned pointer remains valid as long as \bt_p{stream_class}
902 @bt_pre_not_null{stream_class}
904 @sa bt_stream_class_set_name() —
905 Sets the name of a stream class.
907 extern const char *bt_stream_class_get_name(
908 const bt_stream_class
*stream_class
);
912 Status codes for bt_stream_class_set_default_clock_class().
914 typedef enum bt_stream_class_set_default_clock_class_status
{
919 BT_STREAM_CLASS_SET_DEFAULT_CLOCK_CLASS_STATUS_OK
= __BT_FUNC_STATUS_OK
,
920 } bt_stream_class_set_default_clock_class_status
;
924 Sets the default \bt_clock_cls of the stream class
925 \bt_p{stream_class} to \bt_p{clock_class}.
927 See the \ref api-tir-stream-cls-prop-def-clock-cls "default clock class"
930 @param[in] stream_class
931 Stream class of which to set the default clock class to
933 @param[in] clock_class
934 New default clock class of \bt_p{stream_class}.
936 @retval #BT_STREAM_CLASS_SET_DEFAULT_CLOCK_CLASS_STATUS_OK
939 @bt_pre_not_null{stream_class}
940 @bt_pre_hot{stream_class}
941 @bt_pre_not_null{clock_class}
943 @sa bt_stream_class_borrow_default_clock_class() —
944 Borrows the default clock class of a stream class.
945 @sa bt_stream_class_borrow_default_clock_class_const() —
946 Borrows the default clock class of a stream class (\c const version).
948 extern bt_stream_class_set_default_clock_class_status
949 bt_stream_class_set_default_clock_class(
950 bt_stream_class
*stream_class
,
951 bt_clock_class
*clock_class
);
955 Borrows the default \bt_clock_cls from the stream class
958 See the \ref api-tir-stream-cls-prop-def-clock-cls "default clock class"
961 If \bt_p{stream_class} has no default clock class, this function
964 @param[in] stream_class
965 Stream class from which to borrow the default clock class.
968 \em Borrowed reference of the default clock class of
969 \bt_p{stream_class}, or \c NULL if none.
971 @bt_pre_not_null{stream_class}
973 @sa bt_stream_class_set_default_clock_class() —
974 Sets the default clock class of a stream class.
975 @sa bt_stream_class_borrow_default_clock_class_const() —
976 \c const version of this function.
978 extern bt_clock_class
*bt_stream_class_borrow_default_clock_class(
979 bt_stream_class
*stream_class
);
983 Borrows the default \bt_clock_cls from the stream class
984 \bt_p{stream_class} (\c const version).
986 See bt_stream_class_borrow_default_clock_class().
988 extern const bt_clock_class
*
989 bt_stream_class_borrow_default_clock_class_const(
990 const bt_stream_class
*stream_class
);
994 Status codes for bt_stream_class_set_packet_context_field_class()
995 and bt_stream_class_set_event_common_context_field_class().
997 typedef enum bt_stream_class_set_field_class_status
{
1002 BT_STREAM_CLASS_SET_FIELD_CLASS_STATUS_OK
= __BT_FUNC_STATUS_OK
,
1008 BT_STREAM_CLASS_SET_FIELD_CLASS_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
1009 } bt_stream_class_set_field_class_status
;
1013 Sets the packet context \bt_fc of the stream class
1014 \bt_p{stream_class} to \bt_p{field_class}.
1016 See the \ref api-tir-stream-cls-prop-pc-fc "packet context field class"
1019 \bt_p{stream_class} must support packets (see
1020 bt_stream_class_set_supports_packets()).
1022 @param[in] stream_class
1023 Stream class of which to set the packet context field class to
1025 @param[in] field_class
1026 New packet context field class of \bt_p{stream_class}.
1028 @retval #BT_STREAM_CLASS_SET_FIELD_CLASS_STATUS_OK
1030 @retval #BT_STREAM_CLASS_SET_FIELD_CLASS_STATUS_MEMORY_ERROR
1033 @bt_pre_not_null{stream_class}
1034 @bt_pre_hot{stream_class}
1036 <code>bt_stream_class_supports_packets(stream_class)</code>
1038 @bt_pre_not_null{field_class}
1039 @bt_pre_is_struct_fc{field_class}
1041 \bt_p{field_class}, or any of its contained field classes,
1042 is not already part of a stream class or of an \bt_ev_cls.
1044 If any of the field classes recursively contained in
1045 \bt_p{field_class} has a
1046 \ref api-tir-fc-link "link to another field class", it must honor
1047 the field class link rules.
1049 If any of the field classes recursively contained in
1050 \bt_p{field_class} has a
1051 \ref api-tir-fc-link "link to another field class", it must honor
1052 the field class link rules.
1054 @bt_post_success_frozen{field_class}
1056 @sa bt_stream_class_borrow_packet_context_field_class() —
1057 Borrows the packet context field class of a stream class.
1058 @sa bt_stream_class_borrow_packet_context_field_class_const() —
1059 Borrows the packet context field class of a stream class
1062 extern bt_stream_class_set_field_class_status
1063 bt_stream_class_set_packet_context_field_class(
1064 bt_stream_class
*stream_class
,
1065 bt_field_class
*field_class
);
1069 Borrows the packet context \bt_fc from the stream class
1070 \bt_p{stream_class}.
1072 See the \ref api-tir-stream-cls-prop-pc-fc "packet context field class"
1075 If \bt_p{stream_class} has no packet context field class, this function
1078 @param[in] stream_class
1079 Stream class from which to borrow the packet context field class.
1082 \em Borrowed reference of the packet context field class of
1083 \bt_p{stream_class}, or \c NULL if none.
1085 @bt_pre_not_null{stream_class}
1087 @sa bt_stream_class_set_packet_context_field_class() —
1088 Sets the packet context field class of a stream class.
1089 @sa bt_stream_class_borrow_packet_context_field_class_const() —
1090 \c const version of this function.
1092 extern bt_field_class
*
1093 bt_stream_class_borrow_packet_context_field_class(
1094 bt_stream_class
*stream_class
);
1098 Borrows the packet context \bt_fc from the stream class
1099 \bt_p{stream_class} (\c const version).
1101 See bt_stream_class_borrow_packet_context_field_class().
1103 extern const bt_field_class
*
1104 bt_stream_class_borrow_packet_context_field_class_const(
1105 const bt_stream_class
*stream_class
);
1109 Sets the event common context \bt_fc of the stream class
1110 \bt_p{stream_class} to \bt_p{field_class}.
1112 See the \ref api-tir-stream-cls-prop-ecc-fc "event common context field class"
1115 @param[in] stream_class
1116 Stream class of which to set the event common context field class to
1118 @param[in] field_class
1119 New event common context field class of \bt_p{stream_class}.
1121 @retval #BT_STREAM_CLASS_SET_FIELD_CLASS_STATUS_OK
1123 @retval #BT_STREAM_CLASS_SET_FIELD_CLASS_STATUS_MEMORY_ERROR
1126 @bt_pre_not_null{stream_class}
1127 @bt_pre_hot{stream_class}
1128 @bt_pre_not_null{field_class}
1129 @bt_pre_is_struct_fc{field_class}
1131 \bt_p{field_class}, or any of its contained field classes,
1132 is not already part of a stream class or of an \bt_ev_cls.
1134 If any of the field classes recursively contained in
1135 \bt_p{field_class} has a
1136 \ref api-tir-fc-link "link to another field class", it must honor
1137 the field class link rules.
1139 @bt_post_success_frozen{field_class}
1141 @sa bt_stream_class_borrow_event_common_context_field_class() —
1142 Borrows the event common context field class of a stream class.
1143 @sa bt_stream_class_borrow_event_common_context_field_class_const() —
1144 Borrows the event common context field class of a stream class
1147 extern bt_stream_class_set_field_class_status
1148 bt_stream_class_set_event_common_context_field_class(
1149 bt_stream_class
*stream_class
,
1150 bt_field_class
*field_class
);
1154 Borrows the event common context \bt_fc from the stream class
1155 \bt_p{stream_class}.
1157 See the \ref api-tir-stream-cls-prop-pc-fc "event common context field class"
1160 If \bt_p{stream_class} has no event common context field class, this
1161 function returns \c NULL.
1163 @param[in] stream_class
1164 Stream class from which to borrow the event common context
1168 \em Borrowed reference of the event common context field class of
1169 \bt_p{stream_class}, or \c NULL if none.
1171 @bt_pre_not_null{stream_class}
1173 @sa bt_stream_class_set_event_common_context_field_class() —
1174 Sets the event common context field class of a stream class.
1175 @sa bt_stream_class_borrow_event_common_context_field_class_const() —
1176 \c const version of this function.
1179 extern bt_field_class
*
1180 bt_stream_class_borrow_event_common_context_field_class(
1181 bt_stream_class
*stream_class
);
1185 Borrows the event common context \bt_fc from the stream class
1186 \bt_p{stream_class} (\c const version()).
1188 See bt_stream_class_borrow_event_common_context_field_class().
1190 extern const bt_field_class
*
1191 bt_stream_class_borrow_event_common_context_field_class_const(
1192 const bt_stream_class
*stream_class
);
1196 Sets whether or not the stream class \bt_p{stream_class}
1197 automatically assigns a numeric ID to an \bt_ev_cls you create and
1200 See the \ref api-tir-stream-cls-prop-auto-ec-id "assigns automatic event class IDs?"
1203 @param[in] stream_class
1204 Stream class of which to set whether or not it assigns automatic
1206 @param[in] assigns_automatic_event_class_id
1207 #BT_TRUE to make \bt_p{stream_class} assign automatic event class
1210 @bt_pre_not_null{stream_class}
1211 @bt_pre_hot{stream_class}
1213 @sa bt_stream_class_assigns_automatic_event_class_id() —
1214 Returns whether or not a stream class automatically assigns
1217 extern void bt_stream_class_set_assigns_automatic_event_class_id(
1218 bt_stream_class
*stream_class
,
1219 bt_bool assigns_automatic_event_class_id
);
1223 Returns whether or not the stream class \bt_p{stream_class}
1224 automatically assigns a numeric ID to an \bt_ev_cls you create
1227 See the \ref api-tir-stream-cls-prop-auto-ec-id "assigns automatic event class IDs?"
1230 @param[in] stream_class
1231 Stream class of which to get whether or not it assigns automatic
1235 #BT_TRUE if \bt_p{stream_class} automatically
1236 assigns event class IDs.
1238 @bt_pre_not_null{stream_class}
1240 @sa bt_stream_class_set_assigns_automatic_event_class_id() —
1241 Sets whether or not a stream class automatically assigns
1244 extern bt_bool
bt_stream_class_assigns_automatic_event_class_id(
1245 const bt_stream_class
*stream_class
);
1249 Sets whether or not the stream class \bt_p{stream_class}
1250 automatically assigns a numeric ID to a \bt_stream you create from
1253 See the \ref api-tir-stream-cls-prop-auto-stream-id "assigns automatic stream IDs?"
1256 @param[in] stream_class
1257 Stream class of which to set whether or not it assigns automatic
1259 @param[in] assigns_automatic_stream_id
1260 #BT_TRUE to make \bt_p{stream_class} assign automatic stream
1263 @bt_pre_not_null{stream_class}
1264 @bt_pre_hot{stream_class}
1266 @sa bt_stream_class_assigns_automatic_stream_id() —
1267 Returns whether or not a stream class automatically assigns
1270 extern void bt_stream_class_set_assigns_automatic_stream_id(
1271 bt_stream_class
*stream_class
, bt_bool assigns_automatic_stream_id
);
1275 Returns whether or not the stream class \bt_p{stream_class}
1276 automatically assigns a numeric ID to a \bt_stream you create
1279 See the \ref api-tir-stream-cls-prop-auto-stream-id "assigns automatic stream IDs?"
1282 @param[in] stream_class
1283 Stream class of which to get whether or not it assigns automatic
1287 #BT_TRUE if \bt_p{stream_class} automatically assigns stream IDs.
1289 @bt_pre_not_null{stream_class}
1291 @sa bt_stream_class_set_assigns_automatic_stream_id() —
1292 Sets whether or not a stream class automatically assigns
1295 extern bt_bool
bt_stream_class_assigns_automatic_stream_id(
1296 const bt_stream_class
*stream_class
);
1300 Sets whether or not the instances (\bt_p_stream) of the
1301 stream class \bt_p{stream_class} have \bt_p_pkt and, if so,
1302 if those packets have beginning and/or end default
1306 \ref api-tir-stream-cls-prop-supports-pkt "supports packets?",
1307 \ref api-tir-stream-cls-prop-pkt-beg-cs "packets have a beginning default clock snapshot?",
1309 \ref api-tir-stream-cls-prop-pkt-end-cs "packets have an end default clock snapshot?"
1312 @param[in] stream_class
1313 Stream class of which to set whether or not its streams have
1315 @param[in] supports_packets
1316 #BT_TRUE to make the streams of \bt_p{stream_class} have packets.
1317 @param[in] with_beginning_default_clock_snapshot
1318 #BT_TRUE to make the packets of the streams of \bt_p{stream_class}
1319 have a beginning default clock snapshot.
1320 @param[in] with_end_default_clock_snapshot
1321 #BT_TRUE to make the packets of the streams of \bt_p{stream_class}
1322 have an end default clock snapshot.
1324 @bt_pre_not_null{stream_class}
1325 @bt_pre_hot{stream_class}
1327 <strong>If \bt_p{with_beginning_default_clock_snapshot} is
1329 \bt_p{supports_packets} is also #BT_TRUE.
1331 <strong>If \bt_p{with_beginning_default_clock_snapshot} is
1333 \bt_p{supports_packets} is also #BT_TRUE.
1335 <strong>If \bt_p{with_beginning_default_clock_snapshot} or
1336 \bt_p{with_end_default_clock_snapshot} is #BT_TRUE</strong>,
1337 \bt_p{stream_class} has a
1338 \ref api-tir-stream-cls-prop-def-clock-cls "default clock class".
1340 @sa bt_stream_class_supports_packets() —
1341 Returns whether or not a stream class's streams have packets.
1342 @sa bt_stream_class_packets_have_beginning_default_clock_snapshot() —
1343 Returns whether or not the packets of a stream class's streams
1344 have a beginning default clock snapshot.
1345 @sa bt_stream_class_packets_have_end_default_clock_snapshot() —
1346 Returns whether or not the packets of a stream class's streams
1347 have an end default clock snapshot.
1349 extern void bt_stream_class_set_supports_packets(
1350 bt_stream_class
*stream_class
, bt_bool supports_packets
,
1351 bt_bool with_beginning_default_clock_snapshot
,
1352 bt_bool with_end_default_clock_snapshot
);
1356 Returns whether or not the instances (\bt_p_stream) of the
1357 stream class \bt_p{stream_class} have \bt_p_pkt.
1359 See the \ref api-tir-stream-cls-prop-supports-pkt "supports packets?"
1362 @param[in] stream_class
1363 Stream class of which to get whether or not its streams have
1367 #BT_TRUE if the streams of \bt_p{stream_class} have packets.
1369 @bt_pre_not_null{stream_class}
1371 @sa bt_stream_class_set_supports_packets() —
1372 Sets whether or not a stream class's streams have packets.
1374 extern bt_bool
bt_stream_class_supports_packets(
1375 const bt_stream_class
*stream_class
);
1379 Returns whether or not the \bt_p_pkt of the instances (\bt_p_stream)
1380 of the stream class \bt_p{stream_class} have a beginning
1384 \ref api-tir-stream-cls-prop-pkt-beg-cs "packets have a beginning default clock snapshot?"
1387 @param[in] stream_class
1388 Stream class of which to get whether or not its streams's packets
1389 have a beginning default clock snapshot.
1392 #BT_TRUE if the packets of the streams of \bt_p{stream_class} have a
1393 beginning default clock snapshot.
1395 @bt_pre_not_null{stream_class}
1397 @sa bt_stream_class_set_supports_packets() —
1398 Sets whether or not a stream class's streams have packets.
1399 @sa bt_stream_class_packets_have_end_default_clock_snapshot() —
1400 Returns whether or not the packets of a stream class's streams
1401 have an end default clock snapshot.
1403 extern bt_bool
bt_stream_class_packets_have_beginning_default_clock_snapshot(
1404 const bt_stream_class
*stream_class
);
1408 Returns whether or not the \bt_p_pkt of the instances (\bt_p_stream)
1409 of the stream class \bt_p{stream_class} have an end
1413 \ref api-tir-stream-cls-prop-pkt-end-cs "packets have an end default clock snapshot?"
1416 @param[in] stream_class
1417 Stream class of which to get whether or not its streams's packets
1418 have an end default clock snapshot.
1421 #BT_TRUE if the packets of the streams of \bt_p{stream_class} have
1422 an end default clock snapshot.
1424 @bt_pre_not_null{stream_class}
1426 @sa bt_stream_class_set_supports_packets() —
1427 Sets whether or not a stream class's streams have packets.
1428 @sa bt_stream_class_packets_have_beginning_default_clock_snapshot() —
1429 Returns whether or not the packets of a stream class's streams
1430 have a beginning default clock snapshot.
1432 extern bt_bool
bt_stream_class_packets_have_end_default_clock_snapshot(
1433 const bt_stream_class
*stream_class
);
1437 Sets whether or not the instances (\bt_p_stream) of the
1438 stream class \bt_p{stream_class} can have discarded events and,
1439 if so, if the \bt_p_disc_ev_msg of those streams have
1440 beginning and end default \bt_p_cs.
1443 \ref api-tir-stream-cls-prop-supports-disc-ev "supports discarded events?"
1445 \ref api-tir-stream-cls-prop-disc-ev-cs "discarded events have default clock snapshots?"
1448 @param[in] stream_class
1449 Stream class of which to set whether or not its streams can have
1451 @param[in] supports_discarded_events
1452 #BT_TRUE to make the streams of \bt_p{stream_class} be able to
1453 have discarded events.
1454 @param[in] with_default_clock_snapshots
1455 #BT_TRUE to make the discarded events messages the streams of
1456 \bt_p{stream_class} have beginning and end default clock snapshots.
1458 @bt_pre_not_null{stream_class}
1459 @bt_pre_hot{stream_class}
1461 <strong>If \bt_p{with_default_clock_snapshots} is #BT_TRUE</strong>,
1462 \bt_p{supports_discarded_events} is also #BT_TRUE.
1464 <strong>If \bt_p{with_default_clock_snapshots} is #BT_TRUE</strong>,
1465 \bt_p{stream_class} has a
1466 \ref api-tir-stream-cls-prop-def-clock-cls "default clock class".
1468 @sa bt_stream_class_supports_discarded_events() —
1469 Returns whether or not a stream class's streams can have
1471 @sa bt_stream_class_discarded_events_have_default_clock_snapshots() —
1472 Returns whether or not the discarded events messages of a
1473 stream class's streams have beginning and end default clock
1476 extern void bt_stream_class_set_supports_discarded_events(
1477 bt_stream_class
*stream_class
,
1478 bt_bool supports_discarded_events
,
1479 bt_bool with_default_clock_snapshots
);
1483 Returns whether or not the instances (\bt_p_stream) of the
1484 stream class \bt_p{stream_class} can have discarded events.
1487 \ref api-tir-stream-cls-prop-supports-disc-ev "supports discarded events?"
1490 @param[in] stream_class
1491 Stream class of which to get whether or not its streams can have
1495 #BT_TRUE if the streams of \bt_p{stream_class} can have discarded
1498 @bt_pre_not_null{stream_class}
1500 @sa bt_stream_class_set_supports_discarded_events() —
1501 Sets whether or not a stream class's streams can have discarded
1504 extern bt_bool
bt_stream_class_supports_discarded_events(
1505 const bt_stream_class
*stream_class
);
1509 Returns whether or not the \bt_p_disc_ev_msg of the instances
1510 (\bt_p_stream) of the stream class \bt_p{stream_class} have
1511 beginning and end default \bt_p_cs.
1514 \ref api-tir-stream-cls-prop-disc-ev-cs "discarded events have default clock snapshots?"
1517 @param[in] stream_class
1518 Stream class of which to get whether or not its streams's discarded
1519 events messages have a beginning and end default clock snapshots.
1522 #BT_TRUE if the discarded events messages of the streams of
1523 \bt_p{stream_class} have beginning and end default clock snapshots.
1525 @bt_pre_not_null{stream_class}
1527 @sa bt_stream_class_set_supports_discarded_events() —
1528 Sets whether or not a stream class's streams can have discarded
1531 extern bt_bool
bt_stream_class_discarded_events_have_default_clock_snapshots(
1532 const bt_stream_class
*stream_class
);
1536 Sets whether or not the instances (\bt_p_stream) of the
1537 stream class \bt_p{stream_class} can have discarded packets and,
1538 if so, if the \bt_p_disc_pkt_msg of those streams have
1539 beginning and end default \bt_p_cs.
1542 \ref api-tir-stream-cls-prop-supports-disc-pkt "supports discarded packets?"
1544 \ref api-tir-stream-cls-prop-disc-pkt-cs "discarded packets have default clock snapshots?"
1547 \bt_p{stream_class} must support packets (see
1548 bt_stream_class_set_supports_packets()).
1550 @param[in] stream_class
1551 Stream class of which to set whether or not its streams can have
1553 @param[in] supports_discarded_packets
1554 #BT_TRUE to make the streams of \bt_p{stream_class} be able to
1555 have discarded packets.
1556 @param[in] with_default_clock_snapshots
1557 #BT_TRUE to make the discarded packets messages the streams of
1558 \bt_p{stream_class} have beginning and end default clock snapshots.
1560 @bt_pre_not_null{stream_class}
1561 @bt_pre_hot{stream_class}
1563 <code>bt_stream_class_supports_packets(stream_class)</code>
1566 <strong>If \bt_p{with_default_clock_snapshots} is #BT_TRUE</strong>,
1567 \bt_p{supports_discarded_packets} is also #BT_TRUE.
1569 <strong>If \bt_p{with_default_clock_snapshots} is #BT_TRUE</strong>,
1570 \bt_p{stream_class} has a
1571 \ref api-tir-stream-cls-prop-def-clock-cls "default clock class".
1573 @sa bt_stream_class_supports_discarded_packets() —
1574 Returns whether or not a stream class's streams can have
1576 @sa bt_stream_class_discarded_packets_have_default_clock_snapshots() —
1577 Returns whether or not the discarded packets messages of a
1578 stream class's streams have beginning and end default clock
1581 extern void bt_stream_class_set_supports_discarded_packets(
1582 bt_stream_class
*stream_class
,
1583 bt_bool supports_discarded_packets
,
1584 bt_bool with_default_clock_snapshots
);
1588 Returns whether or not the instances (\bt_p_stream) of the
1589 stream class \bt_p{stream_class} can have discarded packets.
1592 \ref api-tir-stream-cls-prop-supports-disc-pkt "supports discarded packets?"
1595 @param[in] stream_class
1596 Stream class of which to get whether or not its streams can have
1600 #BT_TRUE if the streams of \bt_p{stream_class} can have discarded
1603 @bt_pre_not_null{stream_class}
1605 @sa bt_stream_class_set_supports_discarded_packets() —
1606 Sets whether or not a stream class's streams can have discarded
1609 extern bt_bool
bt_stream_class_supports_discarded_packets(
1610 const bt_stream_class
*stream_class
);
1614 Returns whether or not the \bt_p_disc_pkt_msg of the instances
1615 (\bt_p_stream) of the stream class \bt_p{stream_class} have
1616 beginning and end default \bt_p_cs.
1619 \ref api-tir-stream-cls-prop-disc-ev-cs "discarded packets have default clock snapshots?"
1622 @param[in] stream_class
1623 Stream class of which to get whether or not its streams's discarded
1624 packets messages have a beginning and end default clock snapshots.
1627 #BT_TRUE if the discarded packets messages of the streams of
1628 \bt_p{stream_class} have beginning and end default clock snapshots.
1630 @bt_pre_not_null{stream_class}
1632 @sa bt_stream_class_set_supports_discarded_packets() —
1633 Sets whether or not a stream class's streams can have discarded
1636 extern bt_bool
bt_stream_class_discarded_packets_have_default_clock_snapshots(
1637 const bt_stream_class
*stream_class
);
1641 Sets the user attributes of the stream class \bt_p{stream_class} to
1642 \bt_p{user_attributes}.
1644 See the \ref api-tir-stream-cls-prop-user-attrs "user attributes"
1648 When you create a default stream class with bt_stream_class_create()
1649 or bt_stream_class_create_with_id(), the stream class's initial user
1650 attributes is an empty \bt_map_val. Therefore you can borrow it with
1651 bt_stream_class_borrow_user_attributes() and fill it directly
1652 instead of setting a new one with this function.
1654 @param[in] stream_class
1655 Stream class of which to set the user attributes to
1656 \bt_p{user_attributes}.
1657 @param[in] user_attributes
1658 New user attributes of \bt_p{stream_class}.
1660 @bt_pre_not_null{stream_class}
1661 @bt_pre_hot{stream_class}
1662 @bt_pre_not_null{user_attributes}
1663 @bt_pre_is_map_val{user_attributes}
1665 @sa bt_stream_class_borrow_user_attributes() —
1666 Borrows the user attributes of a stream class.
1668 extern void bt_stream_class_set_user_attributes(
1669 bt_stream_class
*stream_class
, const bt_value
*user_attributes
);
1673 Borrows the user attributes of the stream class \bt_p{stream_class}.
1675 See the \ref api-tir-stream-cls-prop-user-attrs "user attributes"
1679 When you create a default stream class with bt_stream_class_create()
1680 or bt_stream_class_create_with_id(), the stream class's initial user
1681 attributes is an empty \bt_map_val.
1683 @param[in] stream_class
1684 Stream class from which to borrow the user attributes.
1687 User attributes of \bt_p{stream_class} (a \bt_map_val).
1689 @bt_pre_not_null{stream_class}
1691 @sa bt_stream_class_set_user_attributes() —
1692 Sets the user attributes of a stream class.
1693 @sa bt_stream_class_borrow_user_attributes_const() —
1694 \c const version of this function.
1696 extern bt_value
*bt_stream_class_borrow_user_attributes(
1697 bt_stream_class
*stream_class
);
1701 Borrows the user attributes of the stream class \bt_p{stream_class}
1704 See bt_stream_class_borrow_user_attributes().
1706 extern const bt_value
*bt_stream_class_borrow_user_attributes_const(
1707 const bt_stream_class
*stream_class
);
1712 @name Reference count
1718 Increments the \ref api-fund-shared-object "reference count" of
1719 the stream class \bt_p{stream_class}.
1721 @param[in] stream_class
1723 Stream class of which to increment the reference count.
1728 @sa bt_stream_class_put_ref() —
1729 Decrements the reference count of a stream class.
1731 extern void bt_stream_class_get_ref(const bt_stream_class
*stream_class
);
1735 Decrements the \ref api-fund-shared-object "reference count" of
1736 the stream class \bt_p{stream_class}.
1738 @param[in] stream_class
1740 Stream class of which to decrement the reference count.
1745 @sa bt_stream_class_get_ref() —
1746 Increments the reference count of a stream class.
1748 extern void bt_stream_class_put_ref(const bt_stream_class
*stream_class
);
1752 Decrements the reference count of the stream class
1753 \bt_p{_stream_class}, and then sets \bt_p{_stream_class} to \c NULL.
1755 @param _stream_class
1757 Stream class of which to decrement the reference count.
1759 Can contain \c NULL.
1762 @bt_pre_assign_expr{_stream_class}
1764 #define BT_STREAM_CLASS_PUT_REF_AND_RESET(_stream_class) \
1766 bt_stream_class_put_ref(_stream_class); \
1767 (_stream_class) = NULL; \
1772 Decrements the reference count of the stream class \bt_p{_dst}, sets
1773 \bt_p{_dst} to \bt_p{_src}, and then sets \bt_p{_src} to \c NULL.
1775 This macro effectively moves a stream class reference from the expression
1776 \bt_p{_src} to the expression \bt_p{_dst}, putting the existing
1777 \bt_p{_dst} reference.
1781 Destination expression.
1783 Can contain \c NULL.
1789 Can contain \c NULL.
1792 @bt_pre_assign_expr{_dst}
1793 @bt_pre_assign_expr{_src}
1795 #define BT_STREAM_CLASS_MOVE_REF(_dst, _src) \
1797 bt_stream_class_put_ref(_dst); \
1810 #endif /* BABELTRACE2_TRACE_IR_STREAM_CLASS_H */