Babeltrace 2 C API 2.1.0
Open-source trace manipulation framework
Loading...
Searching...
No Matches
integer-range-set.h
1/*
2 * SPDX-License-Identifier: MIT
3 *
4 * Copyright (C) 2010-2019 EfficiOS Inc. and Linux Foundation
5 */
6
7#ifndef BABELTRACE2_INTEGER_RANGE_SET_H
8#define BABELTRACE2_INTEGER_RANGE_SET_H
9
10/* IWYU pragma: private, include <babeltrace2/babeltrace.h> */
11
12#ifndef __BT_IN_BABELTRACE_H
13# error "Please include <babeltrace2/babeltrace.h> instead."
14#endif
15
16#include <stdint.h>
17#include <stddef.h>
18
19#include <babeltrace2/types.h>
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
152 const bt_integer_range_unsigned *int_range) __BT_NOEXCEPT;
153
171 const bt_integer_range_unsigned *int_range) __BT_NOEXCEPT;
172
194 const bt_integer_range_unsigned *a_int_range,
195 const bt_integer_range_unsigned *b_int_range) __BT_NOEXCEPT;
196
221 const bt_integer_range_signed *int_range) __BT_NOEXCEPT;
222
240 const bt_integer_range_signed *int_range) __BT_NOEXCEPT;
241
263 const bt_integer_range_signed *a_int_range,
264 const bt_integer_range_signed *b_int_range) __BT_NOEXCEPT;
265
291
314 const bt_integer_range_set *int_range_set) __BT_NOEXCEPT;
315
331 void) __BT_NOEXCEPT;
332
365 bt_integer_range_set_unsigned *int_range_set,
366 uint64_t lower, uint64_t upper) __BT_NOEXCEPT;
367
395extern const bt_integer_range_unsigned *
397 const bt_integer_range_set_unsigned *int_range_set,
398 uint64_t index) __BT_NOEXCEPT;
399
423 const bt_integer_range_set_unsigned *int_range_set_a,
424 const bt_integer_range_set_unsigned *int_range_set_b)
425 __BT_NOEXCEPT;
426
442static inline
444 const bt_integer_range_set_unsigned *int_range_set)
445 __BT_NOEXCEPT
446{
447 return __BT_UPCAST_CONST(bt_integer_range_set, int_range_set);
448}
449
467 const bt_integer_range_set_unsigned *int_range_set)
468 __BT_NOEXCEPT;
469
487 const bt_integer_range_set_unsigned *int_range_set)
488 __BT_NOEXCEPT;
489
506#define BT_INTEGER_RANGE_SET_UNSIGNED_PUT_REF_AND_RESET(_int_range_set) \
507 do { \
508 bt_integer_range_set_unsigned_put_ref(_int_range_set); \
509 (_int_range_set) = NULL; \
510 } while (0)
511
538#define BT_INTEGER_RANGE_SET_UNSIGNED_MOVE_REF(_dst, _src) \
539 do { \
540 bt_integer_range_set_unsigned_put_ref(_dst); \
541 (_dst) = (_src); \
542 (_src) = NULL; \
543 } while (0)
544
560 void) __BT_NOEXCEPT;
561
594 bt_integer_range_set_signed *int_range_set,
595 int64_t lower, int64_t upper) __BT_NOEXCEPT;
596
624extern const bt_integer_range_signed *
626 const bt_integer_range_set_signed *int_range_set,
627 uint64_t index) __BT_NOEXCEPT;
628
652 const bt_integer_range_set_signed *int_range_set_a,
653 const bt_integer_range_set_signed *int_range_set_b)
654 __BT_NOEXCEPT;
655
671static inline
673 const bt_integer_range_set_signed *int_range_set)
674 __BT_NOEXCEPT
675{
676 return __BT_UPCAST_CONST(bt_integer_range_set, int_range_set);
677}
678
696 const bt_integer_range_set_signed *int_range_set) __BT_NOEXCEPT;
697
715 const bt_integer_range_set_signed *int_range_set) __BT_NOEXCEPT;
716
733#define BT_INTEGER_RANGE_SET_SIGNED_PUT_REF_AND_RESET(_int_range_set) \
734 do { \
735 bt_integer_range_set_signed_put_ref(_int_range_set); \
736 (_int_range_set) = NULL; \
737 } while (0)
738
765#define BT_INTEGER_RANGE_SET_SIGNED_MOVE_REF(_dst, _src) \
766 do { \
767 bt_integer_range_set_signed_put_ref(_dst); \
768 (_dst) = (_src); \
769 (_src) = NULL; \
770 } while (0)
771
776#ifdef __cplusplus
777}
778#endif
779
780#endif /* BABELTRACE2_INTEGER_RANGE_SET_H */
int bt_bool
Babeltrace&#160;2 boolean type.
Definition types.h:126
uint64_t bt_integer_range_unsigned_get_lower(const bt_integer_range_unsigned *int_range)
Returns the lower value of the unsigned integer range int_range.
bt_bool bt_integer_range_set_signed_is_equal(const bt_integer_range_set_signed *int_range_set_a, const bt_integer_range_set_signed *int_range_set_b)
Returns whether or not the signed integer range set int_range_set_a is equal to int_range_set_b.
void bt_integer_range_set_signed_get_ref(const bt_integer_range_set_signed *int_range_set)
Increments the reference count of the signed integer range set int_range_set.
bt_integer_range_set_unsigned * bt_integer_range_set_unsigned_create(void)
Creates and returns an empty set of unsigned 64-bit integer ranges.
struct bt_integer_range_set_unsigned bt_integer_range_set_unsigned
Set of unsigned 64-bit integer ranges.
Definition types.h:54
uint64_t bt_integer_range_set_get_range_count(const bt_integer_range_set *int_range_set)
Returns the number of integer ranges contained in the integer range set int_range_set.
bt_integer_range_set_add_range_status
Status codes for bt_integer_range_set_unsigned_add_range() and bt_integer_range_set_signed_add_range(...
Definition integer-range-set.h:278
bt_bool bt_integer_range_unsigned_is_equal(const bt_integer_range_unsigned *a_int_range, const bt_integer_range_unsigned *b_int_range)
Returns whether or not the unsigned integer range a_int_range is equal to b_int_range.
bt_integer_range_set_add_range_status bt_integer_range_set_unsigned_add_range(bt_integer_range_set_unsigned *int_range_set, uint64_t lower, uint64_t upper)
Adds an unsigned 64-bit integer range having the lower value lower and the upper value upper to the u...
const bt_integer_range_unsigned * bt_integer_range_set_unsigned_borrow_range_by_index_const(const bt_integer_range_set_unsigned *int_range_set, uint64_t index)
Borrows the unsigned integer range at index index from the unsigned integer range set int_range_set.
struct bt_integer_range_set bt_integer_range_set
Set of 64-bit integer ranges.
Definition types.h:52
struct bt_integer_range_unsigned bt_integer_range_unsigned
Unsigned 64-bit integer range.
Definition types.h:56
void bt_integer_range_set_unsigned_put_ref(const bt_integer_range_set_unsigned *int_range_set)
Decrements the reference count of the unsigned integer range set int_range_set.
struct bt_integer_range_set_signed bt_integer_range_set_signed
Set of signed 64-bit integer ranges.
Definition types.h:53
int64_t bt_integer_range_signed_get_upper(const bt_integer_range_signed *int_range)
Returns the upper value of the signed integer range int_range.
bt_bool bt_integer_range_set_unsigned_is_equal(const bt_integer_range_set_unsigned *int_range_set_a, const bt_integer_range_set_unsigned *int_range_set_b)
Returns whether or not the unsigned integer range set int_range_set_a is equal to int_range_set_b.
const bt_integer_range_signed * bt_integer_range_set_signed_borrow_range_by_index_const(const bt_integer_range_set_signed *int_range_set, uint64_t index)
Borrows the signed integer range at index index from the signed integer range set int_range_set.
static const bt_integer_range_set * bt_integer_range_set_signed_as_range_set_const(const bt_integer_range_set_signed *int_range_set)
Upcasts the signed integer range set int_range_set to the abstract bt_integer_range_set type.
Definition integer-range-set.h:672
uint64_t bt_integer_range_unsigned_get_upper(const bt_integer_range_unsigned *int_range)
Returns the upper value of the unsigned integer range int_range.
bt_integer_range_set_add_range_status bt_integer_range_set_signed_add_range(bt_integer_range_set_signed *int_range_set, int64_t lower, int64_t upper)
Adds a signed 64-bit integer range having the lower value lower and the upper value upper to the sign...
struct bt_integer_range_signed bt_integer_range_signed
Signed 64-bit integer range.
Definition types.h:55
int64_t bt_integer_range_signed_get_lower(const bt_integer_range_signed *int_range)
Returns the lower value of the signed integer range int_range.
void bt_integer_range_set_signed_put_ref(const bt_integer_range_set_signed *int_range_set)
Decrements the reference count of the signed integer range set int_range_set.
bt_bool bt_integer_range_signed_is_equal(const bt_integer_range_signed *a_int_range, const bt_integer_range_signed *b_int_range)
Returns whether or not the signed integer range a_int_range is equal to b_int_range.
static const bt_integer_range_set * bt_integer_range_set_unsigned_as_range_set_const(const bt_integer_range_set_unsigned *int_range_set)
Upcasts the unsigned integer range set int_range_set to the abstract bt_integer_range_set type.
Definition integer-range-set.h:443
void bt_integer_range_set_unsigned_get_ref(const bt_integer_range_set_unsigned *int_range_set)
Increments the reference count of the unsigned integer range set int_range_set.
bt_integer_range_set_signed * bt_integer_range_set_signed_create(void)
Creates and returns an empty set of signed 64-bit integer ranges.
@ BT_INTEGER_RANGE_SET_ADD_RANGE_STATUS_MEMORY_ERROR
Out of memory.
Definition integer-range-set.h:289
@ BT_INTEGER_RANGE_SET_ADD_RANGE_STATUS_OK
Success.
Definition integer-range-set.h:283