2 * SPDX-License-Identifier: MIT
4 * Copyright (C) 2010-2019 EfficiOS Inc. and Linux Foundation
7 #ifndef BABELTRACE2_TRACE_IR_EVENT_CLASS_H
8 #define BABELTRACE2_TRACE_IR_EVENT_CLASS_H
10 /* IWYU pragma: private, include <babeltrace2/babeltrace.h> */
12 #ifndef __BT_IN_BABELTRACE_H
13 # error "Please include <babeltrace2/babeltrace.h> instead."
18 #include <babeltrace2/types.h>
25 @defgroup api-tir-ev-cls Event class
31 An <strong><em>event class</em></strong> is the class of \bt_p_ev,
32 which \bt_p_ev_msg contain:
34 @image html trace-structure.png
36 In the illustration above, notice that:
38 - A \bt_stream is a conceptual \ref api-msg-seq "sequence of messages",
39 some of which are \bt_p_ev_msg.
40 - An event message contains an \bt_ev.
41 - An event is an instance of an event class.
42 - The \ref api-tir-ev-prop-payload "payload field" of an event is an
43 instance of the \ref api-tir-ev-cls-prop-p-fc "payload field class"
44 which an event class contains.
46 An event class is a \ref api-tir "trace IR" metadata object.
48 An event class is a \ref api-fund-shared-object "shared object": get a
49 new reference with bt_event_class_get_ref() and put an existing
50 reference with bt_event_class_put_ref().
52 Some library functions \ref api-fund-freezing "freeze" event classes on
53 success. The documentation of those functions indicate this
56 The type of an event class is #bt_event_class.
58 A \bt_stream_cls contains event classes. All the event classes of a
59 given stream class have unique
60 \ref api-tir-ev-cls-prop-id "numeric IDs". Borrow the stream class
61 which contains an event class with bt_event_class_borrow_stream_class()
62 or bt_event_class_borrow_stream_class_const().
64 To create a default event class:
68 If bt_stream_class_assigns_automatic_event_class_id() returns
69 #BT_TRUE (the default) for the stream class to use
71 <dd>Use bt_event_class_create().</dd>
74 If bt_stream_class_assigns_automatic_event_class_id() returns
75 #BT_FALSE for the stream class to use
77 <dd>Use bt_event_class_create_with_id().</dd>
82 An event class has the following properties:
85 <dt>\anchor api-tir-ev-cls-prop-id Numeric ID</dt>
87 Numeric ID, unique amongst the numeric IDs of the event class's
88 \bt_stream_cls's event classes.
90 Depending on whether or not the event class's stream class
91 automatically assigns event class IDs
92 (see bt_stream_class_assigns_automatic_event_class_id()),
93 set the event class's numeric ID on creation with
94 bt_event_class_create() or
95 bt_event_class_create_with_id().
97 You cannot change the numeric ID once the event class is created.
99 Get an event class's numeric ID with bt_event_class_get_id().
102 <dt>\anchor api-tir-ev-cls-prop-name \bt_dt_opt Name</dt>
104 Name of the event class.
106 Use bt_event_class_set_name() and bt_event_class_get_name().
109 <dt>\anchor api-tir-ev-cls-prop-log-lvl \bt_dt_opt Log level</dt>
111 Log level of the event class.
113 The event class's log level corresponds to the log level of the
114 tracer's original instrumentation point.
116 Use bt_event_class_set_log_level() and
117 bt_event_class_get_log_level().
121 \anchor api-tir-ev-cls-prop-emf-uri
122 \bt_dt_opt Eclipse Modeling Framework (EMF) URI
125 EMF URI of the event class.
127 Use bt_event_class_set_emf_uri() and
128 bt_event_class_get_emf_uri().
132 \anchor api-tir-ev-cls-prop-p-fc
133 \bt_dt_opt Payload field class
136 Payload \bt_fc of the event class.
138 The payload of an event class instance (\bt_ev) contains the
141 Use bt_event_class_set_payload_field_class()
142 bt_event_class_borrow_payload_field_class(),
143 and bt_event_class_borrow_payload_field_class_const().
147 \anchor api-tir-ev-cls-prop-sc-fc
148 \bt_dt_opt Specific context field class
151 Specific context \bt_fc of the event class.
153 The specific context of an event class instance (\bt_ev) contains
154 any contextual data of which the layout is specific to the
155 event's class and which does not belong to the payload.
157 Use bt_event_class_set_specific_context_field_class()
158 bt_event_class_borrow_specific_context_field_class(),
159 and bt_event_class_borrow_specific_context_field_class_const().
163 \anchor api-tir-ev-cls-prop-user-attrs
164 \bt_dt_opt User attributes
167 User attributes of the event class.
169 User attributes are custom attributes attached to an event class.
171 Use bt_event_class_set_user_attributes(),
172 bt_event_class_borrow_user_attributes(), and
173 bt_event_class_borrow_user_attributes_const().
184 @typedef struct bt_event_class bt_event_class;
199 Creates a default event class and adds it to the \bt_stream_cls
204 Only use this function if
207 bt_stream_class_assigns_automatic_event_class_id(stream_class)
212 Otherwise, use bt_event_class_create_with_id().
215 On success, the returned event class has the following property values:
222 <td>\ref api-tir-ev-cls-prop-id "Numeric ID"
223 <td>Automatically assigned by \bt_p{stream_class}
225 <td>\ref api-tir-ev-cls-prop-name "Name"
228 <td>\ref api-tir-ev-cls-prop-log-lvl "Log level"
231 <td>\ref api-tir-ev-cls-prop-emf-uri "EMF URI"
234 <td>\ref api-tir-ev-cls-prop-p-fc "Payload field class"
237 <td>\ref api-tir-ev-cls-prop-sc-fc "Specific context field class"
240 <td>\ref api-tir-ev-cls-prop-user-attrs "User attributes"
241 <td>Empty \bt_map_val
244 @param[in] stream_class
245 Stream class to add the created event class to.
248 New event class reference, or \c NULL on memory error.
250 @bt_pre_not_null{stream_class}
252 <code>bt_stream_class_assigns_automatic_event_class_id(stream_class)</code>
255 @bt_post_success_frozen{stream_class}
257 @sa bt_event_class_create_with_id() —
258 Creates an event class with a specific numeric ID and adds it to a
261 extern bt_event_class
*bt_event_class_create(
262 bt_stream_class
*stream_class
) __BT_NOEXCEPT
;
266 Creates a default event class with the numeric ID \bt_p{id} and adds
267 it to the \bt_stream_cls \bt_p{stream_class}.
271 Only use this function if
274 bt_stream_class_assigns_automatic_event_class_id(stream_class)
279 Otherwise, use bt_event_class_create().
282 On success, the returned event class has the following property values:
289 <td>\ref api-tir-ev-cls-prop-id "Numeric ID"
292 <td>\ref api-tir-ev-cls-prop-name "Name"
295 <td>\ref api-tir-ev-cls-prop-log-lvl "Log level"
298 <td>\ref api-tir-ev-cls-prop-emf-uri "EMF URI"
301 <td>\ref api-tir-ev-cls-prop-p-fc "Payload field class"
304 <td>\ref api-tir-ev-cls-prop-sc-fc "Specific context field class"
307 <td>\ref api-tir-ev-cls-prop-user-attrs "User attributes"
308 <td>Empty \bt_map_val
311 @param[in] stream_class
312 Stream class to add the created event class to.
314 Numeric ID of the event class to create and add to
318 New event class reference, or \c NULL on memory error.
320 @bt_pre_not_null{stream_class}
322 <code>bt_stream_class_assigns_automatic_event_class_id(stream_class)</code>
325 \bt_p{stream_class} does not contain an event class with the numeric
328 @bt_post_success_frozen{stream_class}
330 @sa bt_event_class_create() —
331 Creates an event class with an automatic numeric ID and adds it to a
334 extern bt_event_class
*bt_event_class_create_with_id(
335 bt_stream_class
*stream_class
, uint64_t id
) __BT_NOEXCEPT
;
340 @name Stream class access
346 Borrows the \bt_stream_cls which contains the event class
349 @param[in] event_class
350 Event class from which to borrow the stream class which contains it.
353 Stream class which contains \bt_p{event_class}.
355 @bt_pre_not_null{event_class}
357 @sa bt_event_class_borrow_stream_class_const() —
358 \c const version of this function.
360 extern bt_stream_class
*bt_event_class_borrow_stream_class(
361 bt_event_class
*event_class
) __BT_NOEXCEPT
;
365 Borrows the \bt_stream_cls which contains the event class
366 \bt_p{event_class} (\c const version).
368 See bt_event_class_borrow_stream_class().
370 extern const bt_stream_class
*bt_event_class_borrow_stream_class_const(
371 const bt_event_class
*event_class
) __BT_NOEXCEPT
;
382 Returns the numeric ID of the event class \bt_p{event_class}.
384 See the \ref api-tir-ev-cls-prop-id "numeric ID" property.
386 @param[in] event_class
387 Event class of which to get the numeric ID.
390 Numeric ID of \bt_p{event_class}.
392 @bt_pre_not_null{event_class}
394 @sa bt_event_class_create_with_id() —
395 Creates an event class with a specific numeric ID and adds it to a
398 extern uint64_t bt_event_class_get_id(
399 const bt_event_class
*event_class
) __BT_NOEXCEPT
;
403 Status codes for bt_event_class_set_name().
405 typedef enum bt_event_class_set_name_status
{
410 BT_EVENT_CLASS_SET_NAME_STATUS_OK
= __BT_FUNC_STATUS_OK
,
416 BT_EVENT_CLASS_SET_NAME_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
417 } bt_event_class_set_name_status
;
421 Sets the name of the event class \bt_p{event_class} to
422 a copy of \bt_p{name}.
424 See the \ref api-tir-ev-cls-prop-name "name" property.
426 @param[in] event_class
427 Event class of which to set the name to \bt_p{name}.
429 New name of \bt_p{event_class} (copied).
431 @retval #BT_EVENT_CLASS_SET_NAME_STATUS_OK
433 @retval #BT_EVENT_CLASS_SET_NAME_STATUS_MEMORY_ERROR
436 @bt_pre_not_null{event_class}
437 @bt_pre_hot{event_class}
438 @bt_pre_not_null{name}
440 @sa bt_event_class_get_name() —
441 Returns the name of an event class.
443 extern bt_event_class_set_name_status
bt_event_class_set_name(
444 bt_event_class
*event_class
, const char *name
) __BT_NOEXCEPT
;
448 Returns the name of the event class \bt_p{event_class}.
450 See the \ref api-tir-ev-cls-prop-name "name" property.
452 If \bt_p{event_class} has no name, this function returns \c NULL.
454 @param[in] event_class
455 Event class of which to get the name.
459 Name of \bt_p{event_class}, or \c NULL if none.
461 The returned pointer remains valid as long as \bt_p{event_class}
465 @bt_pre_not_null{event_class}
467 @sa bt_event_class_set_name() —
468 Sets the name of an event class.
470 extern const char *bt_event_class_get_name(
471 const bt_event_class
*event_class
) __BT_NOEXCEPT
;
475 Event class log level enumerators.
477 typedef enum bt_event_class_log_level
{
482 BT_EVENT_CLASS_LOG_LEVEL_EMERGENCY
= 0,
486 Action must be taken immediately.
488 BT_EVENT_CLASS_LOG_LEVEL_ALERT
= 1,
494 BT_EVENT_CLASS_LOG_LEVEL_CRITICAL
= 2,
500 BT_EVENT_CLASS_LOG_LEVEL_ERROR
= 3,
506 BT_EVENT_CLASS_LOG_LEVEL_WARNING
= 4,
510 Normal, but significant, condition.
512 BT_EVENT_CLASS_LOG_LEVEL_NOTICE
= 5,
516 Informational message.
518 BT_EVENT_CLASS_LOG_LEVEL_INFO
= 6,
522 Debugging information with system-level scope
525 BT_EVENT_CLASS_LOG_LEVEL_DEBUG_SYSTEM
= 7,
529 Debugging information with program-level scope
532 BT_EVENT_CLASS_LOG_LEVEL_DEBUG_PROGRAM
= 8,
536 Debugging information with process-level scope
539 BT_EVENT_CLASS_LOG_LEVEL_DEBUG_PROCESS
= 9,
543 Debugging information with module (executable/library) scope
546 BT_EVENT_CLASS_LOG_LEVEL_DEBUG_MODULE
= 10,
550 Debugging information with compilation unit scope
553 BT_EVENT_CLASS_LOG_LEVEL_DEBUG_UNIT
= 11,
557 Debugging information with function-level scope.
559 BT_EVENT_CLASS_LOG_LEVEL_DEBUG_FUNCTION
= 12,
563 Debugging information with function-level scope.
565 BT_EVENT_CLASS_LOG_LEVEL_DEBUG_LINE
= 13,
569 Debugging-level message.
571 BT_EVENT_CLASS_LOG_LEVEL_DEBUG
= 14,
572 } bt_event_class_log_level
;
576 Sets the log level of the event class \bt_p{event_class} to
579 See the \ref api-tir-ev-cls-prop-log-lvl "log level" property.
581 @param[in] event_class
582 Event class of which to set the log level to \bt_p{log_level}.
584 New log level of \bt_p{event_class}.
586 @bt_pre_not_null{event_class}
587 @bt_pre_hot{event_class}
589 @sa bt_event_class_get_log_level() —
590 Returns the log level of an event class.
592 extern void bt_event_class_set_log_level(bt_event_class
*event_class
,
593 bt_event_class_log_level log_level
) __BT_NOEXCEPT
;
597 Returns the log level of the event class \bt_p{event_class}.
599 See the \ref api-tir-ev-cls-prop-log-lvl "log level" property.
601 @param[in] event_class
602 Event class of which to get the log level.
603 @param[out] log_level
604 <strong>If this function returns
605 #BT_PROPERTY_AVAILABILITY_AVAILABLE</strong>, \bt_p{*log_level} is
606 the log level of \bt_p{event_class}.
608 @retval #BT_PROPERTY_AVAILABILITY_AVAILABLE
609 The log level of \bt_p{event_class} is available.
610 @retval #BT_PROPERTY_AVAILABILITY_NOT_AVAILABLE
611 The log level of \bt_p{event_class} is not available.
613 @bt_pre_not_null{event_class}
614 @bt_pre_not_null{log_level}
616 @sa bt_event_class_set_log_level() —
617 Sets the log level of an event class.
619 extern bt_property_availability
bt_event_class_get_log_level(
620 const bt_event_class
*event_class
,
621 bt_event_class_log_level
*log_level
) __BT_NOEXCEPT
;
625 Status codes for bt_event_class_set_emf_uri().
627 typedef enum bt_event_class_set_emf_uri_status
{
632 BT_EVENT_CLASS_SET_EMF_URI_STATUS_OK
= __BT_FUNC_STATUS_OK
,
638 BT_EVENT_CLASS_SET_EMF_URI_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
639 } bt_event_class_set_emf_uri_status
;
643 Sets the Eclipse Modeling Framework (EMF) URI of the event class
644 \bt_p{event_class} to a copy of \bt_p{emf_uri}.
646 See the \ref api-tir-ev-cls-prop-emf-uri "EMF URI" property.
648 @param[in] event_class
649 Event class of which to set the EMF URI to \bt_p{emf_uri}.
651 New EMF URI of \bt_p{event_class} (copied).
653 @retval #BT_EVENT_CLASS_SET_EMF_URI_STATUS_OK
655 @retval #BT_EVENT_CLASS_SET_EMF_URI_STATUS_MEMORY_ERROR
658 @bt_pre_not_null{event_class}
659 @bt_pre_hot{event_class}
660 @bt_pre_not_null{emf_uri}
662 @sa bt_event_class_get_emf_uri() —
663 Returns the EMF URI of an event class.
665 extern bt_event_class_set_emf_uri_status
bt_event_class_set_emf_uri(
666 bt_event_class
*event_class
, const char *emf_uri
) __BT_NOEXCEPT
;
670 Returns the Eclipse Modeling Framework (EMF) URI of the event
671 class \bt_p{event_class}.
673 See the \ref api-tir-ev-cls-prop-emf-uri "EMF URI" property.
675 If \bt_p{event_class} has no EMF URI, this function returns \c NULL.
677 @param[in] event_class
678 Event class of which to get the EMF URI.
682 EMF URI of \bt_p{event_class}, or \c NULL if none.
684 The returned pointer remains valid as long as \bt_p{event_class}
688 @bt_pre_not_null{event_class}
690 @sa bt_event_class_set_emf_uri() —
691 Sets the EMF URI of an event class.
693 extern const char *bt_event_class_get_emf_uri(
694 const bt_event_class
*event_class
) __BT_NOEXCEPT
;
698 Status codes for bt_event_class_set_payload_field_class() and
699 bt_event_class_set_specific_context_field_class().
701 typedef enum bt_event_class_set_field_class_status
{
706 BT_EVENT_CLASS_SET_FIELD_CLASS_STATUS_OK
= __BT_FUNC_STATUS_OK
,
712 BT_EVENT_CLASS_SET_FIELD_CLASS_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
713 } bt_event_class_set_field_class_status
;
717 Sets the payload \bt_fc of the event class
718 \bt_p{event_class} to \bt_p{field_class}.
720 See the \ref api-tir-ev-cls-prop-p-fc "payload field class" property.
722 @param[in] event_class
723 Event class of which to set the payload field class to
725 @param[in] field_class
726 New payload field class of \bt_p{event_class}.
728 @retval #BT_EVENT_CLASS_SET_FIELD_CLASS_STATUS_OK
730 @retval #BT_EVENT_CLASS_SET_FIELD_CLASS_STATUS_MEMORY_ERROR
733 @bt_pre_not_null{event_class}
734 @bt_pre_hot{event_class}
735 @bt_pre_not_null{field_class}
736 @bt_pre_is_struct_fc{field_class}
738 \bt_p{field_class}, or any of its contained field classes,
739 is not already part of a \bt_stream_cls or of an event class.
741 If any of the field classes recursively contained in
742 \bt_p{field_class} has a
743 \ref api-tir-fc-link "link to another field class", it must honor
744 the field class link rules.
746 @bt_post_success_frozen{field_class}
748 @sa bt_event_class_borrow_payload_field_class() —
749 Borrows the payload field class of an event class.
750 @sa bt_event_class_borrow_payload_field_class_const() —
751 Borrows the payload field class of an event class
754 extern bt_event_class_set_field_class_status
755 bt_event_class_set_payload_field_class(bt_event_class
*event_class
,
756 bt_field_class
*field_class
) __BT_NOEXCEPT
;
760 Borrows the payload \bt_fc from the event class \bt_p{event_class}.
762 See the \ref api-tir-ev-cls-prop-p-fc "payload field class" property.
764 If \bt_p{event_class} has no payload field class, this function
767 @param[in] event_class
768 Event class from which to borrow the payload field class.
771 \em Borrowed reference of the payload field class of
772 \bt_p{event_class}, or \c NULL if none.
774 @bt_pre_not_null{event_class}
776 @sa bt_event_class_set_payload_field_class() —
777 Sets the payload field class of an event class.
778 @sa bt_event_class_borrow_payload_field_class_const() —
779 \c const version of this function.
781 extern bt_field_class
*bt_event_class_borrow_payload_field_class(
782 bt_event_class
*event_class
) __BT_NOEXCEPT
;
786 Borrows the payload \bt_fc from the event class \bt_p{event_class}
789 See bt_event_class_borrow_payload_field_class().
791 extern const bt_field_class
*bt_event_class_borrow_payload_field_class_const(
792 const bt_event_class
*event_class
) __BT_NOEXCEPT
;
796 Sets the specific context \bt_fc of the event class
797 \bt_p{event_class} to \bt_p{field_class}.
799 See the \ref api-tir-ev-cls-prop-sc-fc "specific context field class"
802 @param[in] event_class
803 Event class of which to set the specific context field class to
805 @param[in] field_class
806 New specific context field class of \bt_p{event_class}.
808 @retval #BT_EVENT_CLASS_SET_FIELD_CLASS_STATUS_OK
810 @retval #BT_EVENT_CLASS_SET_FIELD_CLASS_STATUS_MEMORY_ERROR
813 @bt_pre_not_null{event_class}
814 @bt_pre_hot{event_class}
815 @bt_pre_not_null{field_class}
816 @bt_pre_is_struct_fc{field_class}
818 \bt_p{field_class}, or any of its contained field classes,
819 is not already part of a \bt_stream_cls or of an event class.
821 If any of the field classes recursively contained in
822 \bt_p{field_class} has a
823 \ref api-tir-fc-link "link to another field class", it must honor
824 the field class link rules.
826 @bt_post_success_frozen{field_class}
828 @sa bt_event_class_borrow_specific_context_field_class() —
829 Borrows the specific context field class of an event class.
830 @sa bt_event_class_borrow_specific_context_field_class_const() —
831 Borrows the specific context field class of an event class
834 extern bt_event_class_set_field_class_status
835 bt_event_class_set_specific_context_field_class(bt_event_class
*event_class
,
836 bt_field_class
*field_class
) __BT_NOEXCEPT
;
840 Borrows the specific context \bt_fc from the event class
843 See the \ref api-tir-ev-cls-prop-sc-fc "specific context field class"
846 If \bt_p{event_class} has no specific context field class, this function
849 @param[in] event_class
850 Event class from which to borrow the specific context field class.
853 \em Borrowed reference of the specific context field class of
854 \bt_p{event_class}, or \c NULL if none.
856 @bt_pre_not_null{event_class}
858 @sa bt_event_class_set_specific_context_field_class() —
859 Sets the specific context field class of an event class.
860 @sa bt_event_class_borrow_specific_context_field_class_const() —
861 \c const version of this function.
863 extern bt_field_class
*
864 bt_event_class_borrow_specific_context_field_class(
865 bt_event_class
*event_class
) __BT_NOEXCEPT
;
869 Borrows the specific context \bt_fc from the event class
870 \bt_p{event_class} (\c const version).
872 See bt_event_class_borrow_specific_context_field_class().
874 extern const bt_field_class
*
875 bt_event_class_borrow_specific_context_field_class_const(
876 const bt_event_class
*event_class
) __BT_NOEXCEPT
;
880 Sets the user attributes of the event class \bt_p{event_class} to
881 \bt_p{user_attributes}.
883 See the \ref api-tir-ev-cls-prop-user-attrs "user attributes" property.
886 When you create a default event class with bt_event_class_create()
887 or bt_event_class_create_with_id(), the event class's initial user
888 attributes is an empty \bt_map_val. Therefore you can borrow it with
889 bt_event_class_borrow_user_attributes() and fill it directly instead
890 of setting a new one with this function.
892 @param[in] event_class
893 Event class of which to set the user attributes to
894 \bt_p{user_attributes}.
895 @param[in] user_attributes
896 New user attributes of \bt_p{event_class}.
898 @bt_pre_not_null{event_class}
899 @bt_pre_hot{event_class}
900 @bt_pre_not_null{user_attributes}
901 @bt_pre_is_map_val{user_attributes}
903 @sa bt_event_class_borrow_user_attributes() —
904 Borrows the user attributes of an event class.
906 extern void bt_event_class_set_user_attributes(
907 bt_event_class
*event_class
, const bt_value
*user_attributes
)
912 Borrows the user attributes of the event class \bt_p{event_class}.
914 See the \ref api-tir-ev-cls-prop-user-attrs "user attributes" property.
917 When you create a default event class with bt_event_class_create()
918 or bt_event_class_create_with_id(), the event class's initial user
919 attributes is an empty \bt_map_val.
921 @param[in] event_class
922 Event class from which to borrow the user attributes.
925 User attributes of \bt_p{event_class} (a \bt_map_val).
927 @bt_pre_not_null{event_class}
929 @sa bt_event_class_set_user_attributes() —
930 Sets the user attributes of an event class.
931 @sa bt_event_class_borrow_user_attributes_const() —
932 \c const version of this function.
934 extern bt_value
*bt_event_class_borrow_user_attributes(
935 bt_event_class
*event_class
) __BT_NOEXCEPT
;
939 Borrows the user attributes of the event class \bt_p{event_class}
942 See bt_event_class_borrow_user_attributes().
944 extern const bt_value
*bt_event_class_borrow_user_attributes_const(
945 const bt_event_class
*event_class
) __BT_NOEXCEPT
;
950 @name Reference count
956 Increments the \ref api-fund-shared-object "reference count" of
957 the event class \bt_p{event_class}.
959 @param[in] event_class
961 Event class of which to increment the reference count.
966 @sa bt_event_class_put_ref() —
967 Decrements the reference count of an event class.
969 extern void bt_event_class_get_ref(
970 const bt_event_class
*event_class
) __BT_NOEXCEPT
;
974 Decrements the \ref api-fund-shared-object "reference count" of
975 the event class \bt_p{event_class}.
977 @param[in] event_class
979 Event class of which to decrement the reference count.
984 @sa bt_event_class_get_ref() —
985 Increments the reference count of an event class.
987 extern void bt_event_class_put_ref(
988 const bt_event_class
*event_class
) __BT_NOEXCEPT
;
992 Decrements the reference count of the event class
993 \bt_p{_event_class}, and then sets \bt_p{_event_class} to \c NULL.
997 Event class of which to decrement the reference count.
1002 @bt_pre_assign_expr{_event_class}
1004 #define BT_EVENT_CLASS_PUT_REF_AND_RESET(_event_class) \
1006 bt_event_class_put_ref(_event_class); \
1007 (_event_class) = NULL; \
1012 Decrements the reference count of the event class \bt_p{_dst}, sets
1013 \bt_p{_dst} to \bt_p{_src}, and then sets \bt_p{_src} to \c NULL.
1015 This macro effectively moves an event class reference from the expression
1016 \bt_p{_src} to the expression \bt_p{_dst}, putting the existing
1017 \bt_p{_dst} reference.
1021 Destination expression.
1023 Can contain \c NULL.
1029 Can contain \c NULL.
1032 @bt_pre_assign_expr{_dst}
1033 @bt_pre_assign_expr{_src}
1035 #define BT_EVENT_CLASS_MOVE_REF(_dst, _src) \
1037 bt_event_class_put_ref(_dst); \
1050 #endif /* BABELTRACE2_TRACE_IR_EVENT_CLASS_H */