include/babeltrace2: add `noexcept` specifier for C++ ≥ 11
[babeltrace.git] / include / babeltrace2 / graph / message.h
index 34b98bc0717c909890459455d0cef7d786dd23f4..cdd125fd440a348c78685a544dc62f2eb2f87c7a 100644 (file)
@@ -1,28 +1,14 @@
-#ifndef BABELTRACE2_GRAPH_MESSAGE_H
-#define BABELTRACE2_GRAPH_MESSAGE_H
-
 /*
- * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
+ * SPDX-License-Identifier: MIT
  *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
+ * Copyright (C) 2010-2019 EfficiOS Inc. and Linux Foundation
  */
 
+#ifndef BABELTRACE2_GRAPH_MESSAGE_H
+#define BABELTRACE2_GRAPH_MESSAGE_H
+
+/* IWYU pragma: private, include <babeltrace2/babeltrace.h> */
+
 #ifndef __BT_IN_BABELTRACE_H
 # error "Please include <babeltrace2/babeltrace.h> instead."
 #endif
@@ -820,7 +806,7 @@ For example:
 
 - The maximum
   \ref api-tir-fc-int-prop-size "field value range" for an \bt_uint_fc
-  is [0,&nbsp;2<sup>64</sup>&nbsp;-&nbsp;1].
+  is [0,&nbsp;2<sup>64</sup>&nbsp;&nbsp;1].
 
 - The available message types are stream beginning and end, event,
   packet beginning and end, discarded events and packets, and message
@@ -1039,7 +1025,8 @@ typedef enum bt_message_type {
 
 @bt_pre_not_null{message}
 */
-extern bt_message_type bt_message_get_type(const bt_message *message);
+extern bt_message_type bt_message_get_type(const bt_message *message)
+               __BT_NOEXCEPT;
 
 /*! @} */
 
@@ -1113,7 +1100,7 @@ property values:
 extern
 bt_message *bt_message_stream_beginning_create(
                bt_self_message_iterator *self_message_iterator,
-               const bt_stream *stream);
+               const bt_stream *stream) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -1138,7 +1125,7 @@ See the \ref api-msg-sb-prop-stream "stream" property.
     \c const version of this function.
 */
 extern bt_stream *bt_message_stream_beginning_borrow_stream(
-               bt_message *message);
+               bt_message *message) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -1148,7 +1135,7 @@ extern bt_stream *bt_message_stream_beginning_borrow_stream(
 See bt_message_stream_beginning_borrow_stream().
 */
 extern const bt_stream *bt_message_stream_beginning_borrow_stream_const(
-               const bt_message *message);
+               const bt_message *message) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -1176,7 +1163,7 @@ See the \ref api-msg-sb-prop-cs "default clock snapshot" property.
 */
 extern
 void bt_message_stream_beginning_set_default_clock_snapshot(
-               bt_message *message, uint64_t value);
+               bt_message *message, uint64_t value) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -1212,7 +1199,7 @@ See the \ref api-msg-sb-prop-cs "default clock snapshot" property.
 extern bt_message_stream_clock_snapshot_state
 bt_message_stream_beginning_borrow_default_clock_snapshot_const(
                const bt_message *message,
-               const bt_clock_snapshot **clock_snapshot);
+               const bt_clock_snapshot **clock_snapshot) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -1244,7 +1231,7 @@ bt_stream_class_borrow_default_clock_class_const(
 */
 extern const bt_clock_class *
 bt_message_stream_beginning_borrow_stream_class_default_clock_class_const(
-               const bt_message *message);
+               const bt_message *message) __BT_NOEXCEPT;
 
 /*! @} */
 
@@ -1290,7 +1277,7 @@ property values:
 extern
 bt_message *bt_message_stream_end_create(
                bt_self_message_iterator *self_message_iterator,
-               const bt_stream *stream);
+               const bt_stream *stream) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -1315,7 +1302,7 @@ See the \ref api-msg-se-prop-stream "stream" property.
     \c const version of this function.
 */
 extern bt_stream *bt_message_stream_end_borrow_stream(
-               bt_message *message);
+               bt_message *message) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -1325,7 +1312,7 @@ extern bt_stream *bt_message_stream_end_borrow_stream(
 See bt_message_stream_end_borrow_stream().
 */
 extern const bt_stream *bt_message_stream_end_borrow_stream_const(
-               const bt_message *message);
+               const bt_message *message) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -1353,7 +1340,7 @@ See the \ref api-msg-se-prop-cs "default clock snapshot" property.
 */
 extern
 void bt_message_stream_end_set_default_clock_snapshot(
-               bt_message *message, uint64_t value);
+               bt_message *message, uint64_t value) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -1389,7 +1376,7 @@ See the \ref api-msg-se-prop-cs "default clock snapshot" property.
 extern bt_message_stream_clock_snapshot_state
 bt_message_stream_end_borrow_default_clock_snapshot_const(
                const bt_message *message,
-               const bt_clock_snapshot **clock_snapshot);
+               const bt_clock_snapshot **clock_snapshot) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -1421,7 +1408,7 @@ bt_stream_class_borrow_default_clock_class_const(
 */
 extern const bt_clock_class *
 bt_message_stream_end_borrow_stream_class_default_clock_class_const(
-               const bt_message *message);
+               const bt_message *message) __BT_NOEXCEPT;
 
 /*! @} */
 
@@ -1508,7 +1495,7 @@ extern
 bt_message *bt_message_event_create(
                bt_self_message_iterator *self_message_iterator,
                const bt_event_class *event_class,
-               const bt_stream *stream);
+               const bt_stream *stream) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -1592,7 +1579,8 @@ extern
 bt_message *bt_message_event_create_with_default_clock_snapshot(
                bt_self_message_iterator *self_message_iterator,
                const bt_event_class *event_class,
-               const bt_stream *stream, uint64_t clock_snapshot_value);
+               const bt_stream *stream, uint64_t clock_snapshot_value)
+               __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -1677,7 +1665,7 @@ extern
 bt_message *bt_message_event_create_with_packet(
                bt_self_message_iterator *self_message_iterator,
                const bt_event_class *event_class,
-               const bt_packet *packet);
+               const bt_packet *packet) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -1766,7 +1754,8 @@ extern
 bt_message *bt_message_event_create_with_packet_and_default_clock_snapshot(
                bt_self_message_iterator *self_message_iterator,
                const bt_event_class *event_class,
-               const bt_packet *packet, uint64_t clock_snapshot_value);
+               const bt_packet *packet, uint64_t clock_snapshot_value)
+               __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -1790,8 +1779,8 @@ See the \ref api-msg-ev-prop-ev "event" property.
 @sa bt_message_event_borrow_event_const() &mdash;
     \c const version of this function.
 */
-extern bt_event *bt_message_event_borrow_event(
-               bt_message *message);
+extern bt_event *bt_message_event_borrow_event(bt_message *message)
+               __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -1801,7 +1790,7 @@ extern bt_event *bt_message_event_borrow_event(
 See bt_message_event_borrow_event().
 */
 extern const bt_event *bt_message_event_borrow_event_const(
-               const bt_message *message);
+               const bt_message *message) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -1822,7 +1811,8 @@ See the \ref api-msg-ev-prop-cs "default clock snapshot" property.
     \ref api-tir-stream-cls-prop-def-clock-cls "default clock class".
 */
 extern const bt_clock_snapshot *
-bt_message_event_borrow_default_clock_snapshot_const(const bt_message *message);
+bt_message_event_borrow_default_clock_snapshot_const(const bt_message *message)
+               __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -1855,7 +1845,7 @@ bt_stream_class_borrow_default_clock_class_const(
 */
 extern const bt_clock_class *
 bt_message_event_borrow_stream_class_default_clock_class_const(
-               const bt_message *message);
+               const bt_message *message) __BT_NOEXCEPT;
 
 /*! @} */
 
@@ -1923,7 +1913,7 @@ property values:
 extern
 bt_message *bt_message_packet_beginning_create(
                bt_self_message_iterator *self_message_iterator,
-               const bt_packet *packet);
+               const bt_packet *packet) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -1988,7 +1978,8 @@ property values:
 extern
 bt_message *bt_message_packet_beginning_create_with_default_clock_snapshot(
                bt_self_message_iterator *self_message_iterator,
-               const bt_packet *packet, uint64_t clock_snapshot_value);
+               const bt_packet *packet, uint64_t clock_snapshot_value)
+               __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -2013,7 +2004,7 @@ See the \ref api-msg-pb-prop-pkt "packet" property.
     \c const version of this function.
 */
 extern bt_packet *bt_message_packet_beginning_borrow_packet(
-               bt_message *message);
+               bt_message *message) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -2023,7 +2014,7 @@ extern bt_packet *bt_message_packet_beginning_borrow_packet(
 See bt_message_packet_beginning_borrow_packet().
 */
 extern const bt_packet *bt_message_packet_beginning_borrow_packet_const(
-               const bt_message *message);
+               const bt_message *message) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -2046,7 +2037,7 @@ See the \ref api-msg-pb-prop-cs "default clock snapshot" property.
 */
 extern const bt_clock_snapshot *
 bt_message_packet_beginning_borrow_default_clock_snapshot_const(
-               const bt_message *message);
+               const bt_message *message) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -2079,7 +2070,7 @@ bt_stream_class_borrow_default_clock_class_const(
 */
 extern const bt_clock_class *
 bt_message_packet_beginning_borrow_stream_class_default_clock_class_const(
-               const bt_message *message);
+               const bt_message *message) __BT_NOEXCEPT;
 
 /*! @} */
 
@@ -2146,7 +2137,7 @@ property values:
 extern
 bt_message *bt_message_packet_end_create(
                bt_self_message_iterator *self_message_iterator,
-               const bt_packet *packet);
+               const bt_packet *packet) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -2211,7 +2202,8 @@ property values:
 extern
 bt_message *bt_message_packet_end_create_with_default_clock_snapshot(
                bt_self_message_iterator *self_message_iterator,
-               const bt_packet *packet, uint64_t clock_snapshot_value);
+               const bt_packet *packet, uint64_t clock_snapshot_value)
+               __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -2236,7 +2228,7 @@ See the \ref api-msg-pe-prop-pkt "packet" property.
     \c const version of this function.
 */
 extern bt_packet *bt_message_packet_end_borrow_packet(
-               bt_message *message);
+               bt_message *message) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -2246,7 +2238,7 @@ extern bt_packet *bt_message_packet_end_borrow_packet(
 See bt_message_packet_end_borrow_packet().
 */
 extern const bt_packet *bt_message_packet_end_borrow_packet_const(
-               const bt_message *message);
+               const bt_message *message) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -2269,7 +2261,7 @@ See the \ref api-msg-pe-prop-cs "default clock snapshot" property.
 */
 extern const bt_clock_snapshot *
 bt_message_packet_end_borrow_default_clock_snapshot_const(
-               const bt_message *message);
+               const bt_message *message) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -2302,7 +2294,7 @@ bt_stream_class_borrow_default_clock_class_const(
 */
 extern const bt_clock_class *
 bt_message_packet_end_borrow_stream_class_default_clock_class_const(
-               const bt_message *message);
+               const bt_message *message) __BT_NOEXCEPT;
 
 /*! @} */
 
@@ -2371,7 +2363,7 @@ property values:
 */
 extern bt_message *bt_message_discarded_events_create(
                bt_self_message_iterator *self_message_iterator,
-               const bt_stream *stream);
+               const bt_stream *stream) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -2436,6 +2428,7 @@ property values:
 @pre
     <code>bt_stream_class_discarded_events_have_default_clock_snapshots(bt_stream_borrow_class_const(stream))</code>
     returns #BT_TRUE.
+    \bt_p{beginning_clock_snapshot_value} ⩽ \bt_p{end_clock_snapshot_value}
 
 @bt_post_success_frozen{stream}
 */
@@ -2443,7 +2436,8 @@ extern bt_message *bt_message_discarded_events_create_with_default_clock_snapsho
                bt_self_message_iterator *self_message_iterator,
                const bt_stream *stream,
                uint64_t beginning_clock_snapshot_value,
-               uint64_t end_clock_snapshot_value);
+               uint64_t end_clock_snapshot_value)
+               __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -2468,7 +2462,7 @@ See the \ref api-msg-disc-ev-prop-stream "stream" property.
     \c const version of this function.
 */
 extern bt_stream *bt_message_discarded_events_borrow_stream(
-               bt_message *message);
+               bt_message *message) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -2478,7 +2472,8 @@ extern bt_stream *bt_message_discarded_events_borrow_stream(
 See bt_message_discarded_events_borrow_stream().
 */
 extern const bt_stream *
-bt_message_discarded_events_borrow_stream_const(const bt_message *message);
+bt_message_discarded_events_borrow_stream_const(const bt_message *message)
+               __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -2505,7 +2500,7 @@ property.
 */
 extern const bt_clock_snapshot *
 bt_message_discarded_events_borrow_beginning_default_clock_snapshot_const(
-               const bt_message *message);
+               const bt_message *message) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -2532,7 +2527,7 @@ property.
 */
 extern const bt_clock_snapshot *
 bt_message_discarded_events_borrow_end_default_clock_snapshot_const(
-               const bt_message *message);
+               const bt_message *message) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -2564,7 +2559,7 @@ bt_stream_class_borrow_default_clock_class_const(
 */
 extern const bt_clock_class *
 bt_message_discarded_events_borrow_stream_class_default_clock_class_const(
-               const bt_message *message);
+               const bt_message *message) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -2583,13 +2578,15 @@ property.
 @bt_pre_not_null{message}
 @bt_pre_hot{message}
 @bt_pre_is_disc_ev_msg{message}
+@pre
+    \bt_p{count} > 0
 
 @sa bt_message_discarded_events_get_count() &mdash;
     Returns the number of discarded events of a discarded events
     message.
 */
 extern void bt_message_discarded_events_set_count(bt_message *message,
-               uint64_t count);
+               uint64_t count) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -2620,7 +2617,7 @@ property.
     Sets the number of discarded events of a discarded events message.
 */
 extern bt_property_availability bt_message_discarded_events_get_count(
-               const bt_message *message, uint64_t *count);
+               const bt_message *message, uint64_t *count) __BT_NOEXCEPT;
 
 /*! @} */
 
@@ -2689,7 +2686,7 @@ property values:
 */
 extern bt_message *bt_message_discarded_packets_create(
                bt_self_message_iterator *self_message_iterator,
-               const bt_stream *stream);
+               const bt_stream *stream) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -2754,13 +2751,14 @@ property values:
 @pre
     <code>bt_stream_class_discarded_packets_have_default_clock_snapshots(bt_stream_borrow_class_const(stream))</code>
     returns #BT_TRUE.
+    \bt_p{beginning_clock_snapshot_value} ⩽ \bt_p{end_clock_snapshot_value}
 
 @bt_post_success_frozen{stream}
 */
 extern bt_message *bt_message_discarded_packets_create_with_default_clock_snapshots(
                bt_self_message_iterator *self_message_iterator,
                const bt_stream *stream, uint64_t beginning_clock_snapshot_value,
-               uint64_t end_clock_snapshot_value);
+               uint64_t end_clock_snapshot_value) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -2785,7 +2783,7 @@ See the \ref api-msg-disc-ev-prop-stream "stream" property.
     \c const version of this function.
 */
 extern bt_stream *bt_message_discarded_packets_borrow_stream(
-               bt_message *message);
+               bt_message *message) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -2795,7 +2793,8 @@ extern bt_stream *bt_message_discarded_packets_borrow_stream(
 See bt_message_discarded_packets_borrow_stream().
 */
 extern const bt_stream *
-bt_message_discarded_packets_borrow_stream_const(const bt_message *message);
+bt_message_discarded_packets_borrow_stream_const(const bt_message *message)
+               __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -2822,7 +2821,7 @@ property.
 */
 extern const bt_clock_snapshot *
 bt_message_discarded_packets_borrow_beginning_default_clock_snapshot_const(
-               const bt_message *message);
+               const bt_message *message) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -2849,7 +2848,7 @@ property.
 */
 extern const bt_clock_snapshot *
 bt_message_discarded_packets_borrow_end_default_clock_snapshot_const(
-               const bt_message *message);
+               const bt_message *message) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -2881,7 +2880,7 @@ bt_stream_class_borrow_default_clock_class_const(
 */
 extern const bt_clock_class *
 bt_message_discarded_packets_borrow_stream_class_default_clock_class_const(
-               const bt_message *message);
+               const bt_message *message) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -2900,13 +2899,15 @@ property.
 @bt_pre_not_null{message}
 @bt_pre_hot{message}
 @bt_pre_is_disc_pkt_msg{message}
+@pre
+    \bt_p{count} > 0
 
 @sa bt_message_discarded_packets_get_count() &mdash;
     Returns the number of discarded packets of a discarded packets
     message.
 */
 extern void bt_message_discarded_packets_set_count(bt_message *message,
-               uint64_t count);
+               uint64_t count) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -2937,7 +2938,7 @@ property.
     Sets the number of discarded packets of a discarded packets message.
 */
 extern bt_property_availability bt_message_discarded_packets_get_count(
-               const bt_message *message, uint64_t *count);
+               const bt_message *message, uint64_t *count) __BT_NOEXCEPT;
 
 /*! @} */
 
@@ -2989,7 +2990,7 @@ extern
 bt_message *bt_message_message_iterator_inactivity_create(
                bt_self_message_iterator *self_message_iterator,
                const bt_clock_class *clock_class,
-               uint64_t clock_snapshot_value);
+               uint64_t clock_snapshot_value) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -3009,7 +3010,7 @@ See the \ref api-msg-inac-prop-cs "clock snapshot" property.
 */
 extern const bt_clock_snapshot *
 bt_message_message_iterator_inactivity_borrow_clock_snapshot_const(
-               const bt_message *message);
+               const bt_message *message) __BT_NOEXCEPT;
 
 /*! @} */
 
@@ -3033,7 +3034,7 @@ bt_message_message_iterator_inactivity_borrow_clock_snapshot_const(
 @sa bt_message_put_ref() &mdash;
     Decrements the reference count of a message.
 */
-extern void bt_message_get_ref(const bt_message *message);
+extern void bt_message_get_ref(const bt_message *message) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -3050,7 +3051,7 @@ extern void bt_message_get_ref(const bt_message *message);
 @sa bt_message_get_ref() &mdash;
     Increments the reference count of a message.
 */
-extern void bt_message_put_ref(const bt_message *message);
+extern void bt_message_put_ref(const bt_message *message) __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -3106,7 +3107,6 @@ This macro effectively moves a message reference from the expression
 
 /*! @} */
 
-
 /*!
 @name Message Interchange Protocol version
 @{
@@ -3197,7 +3197,8 @@ component descriptors of \bt_p{component_descriptors}, it returns
 extern bt_get_greatest_operative_mip_version_status
 bt_get_greatest_operative_mip_version(
                const bt_component_descriptor_set *component_descriptors,
-               bt_logging_level logging_level, uint64_t *mip_version);
+               bt_logging_level logging_level, uint64_t *mip_version)
+               __BT_NOEXCEPT;
 
 /*!
 @brief
@@ -3210,7 +3211,7 @@ As of \bt_name_version_min_maj, this function returns
 @returns
     Maximal available MIP version (\bt_max_mip_version).
 */
-extern uint64_t bt_get_maximal_mip_version(void);
+extern uint64_t bt_get_maximal_mip_version(void) __BT_NOEXCEPT;
 
 /*! @} */
 
This page took 0.032508 seconds and 4 git commands to generate.