Babeltrace 2 C API  2.1.1
Open-source trace manipulation framework
stream-class.h
1 /*
2  * SPDX-License-Identifier: MIT
3  *
4  * Copyright (C) 2010-2019 EfficiOS Inc. and Linux Foundation
5  */
6 
7 #ifndef BABELTRACE2_TRACE_IR_STREAM_CLASS_H
8 #define BABELTRACE2_TRACE_IR_STREAM_CLASS_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 
18 #include <babeltrace2/types.h>
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
600  bt_trace_class *trace_class) __BT_NOEXCEPT;
601 
703  bt_trace_class *trace_class, uint64_t id) __BT_NOEXCEPT;
704 
729  bt_stream_class *stream_class) __BT_NOEXCEPT;
730 
739  const bt_stream_class *stream_class) __BT_NOEXCEPT;
740 
762  const bt_stream_class *stream_class) __BT_NOEXCEPT;
763 
795 extern bt_event_class *
797  bt_stream_class *stream_class, uint64_t index) __BT_NOEXCEPT;
798 
806 extern const bt_event_class *
808  const bt_stream_class *stream_class, uint64_t index)
809  __BT_NOEXCEPT;
810 
840 extern bt_event_class *
842  bt_stream_class *stream_class, uint64_t id) __BT_NOEXCEPT;
843 
851 extern const bt_event_class *
853  const bt_stream_class *stream_class, uint64_t id) __BT_NOEXCEPT;
854 
880 extern uint64_t bt_stream_class_get_id(
881  const bt_stream_class *stream_class) __BT_NOEXCEPT;
882 
895 
900  BT_STREAM_CLASS_SET_NAMESPACE_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
902 
931  bt_stream_class *stream_class, const char *ns) __BT_NOEXCEPT;
932 
961 extern const char *bt_stream_class_get_namespace(
962  const bt_stream_class *stream_class) __BT_NOEXCEPT;
963 
973  BT_STREAM_CLASS_SET_NAME_STATUS_OK = __BT_FUNC_STATUS_OK,
974 
979  BT_STREAM_CLASS_SET_NAME_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
981 
1007  bt_stream_class *stream_class, const char *name) __BT_NOEXCEPT;
1008 
1033 extern const char *bt_stream_class_get_name(
1034  const bt_stream_class *stream_class) __BT_NOEXCEPT;
1035 
1047  BT_STREAM_CLASS_SET_UID_STATUS_OK = __BT_FUNC_STATUS_OK,
1048 
1053  BT_STREAM_CLASS_SET_UID_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
1055 
1086  bt_stream_class *stream_class, const char *uid) __BT_NOEXCEPT;
1087 
1115 extern const char *bt_stream_class_get_uid(
1116  const bt_stream_class *stream_class) __BT_NOEXCEPT;
1117 
1129 
1158  bt_stream_class *stream_class,
1159  bt_clock_class *clock_class) __BT_NOEXCEPT;
1160 
1187  bt_stream_class *stream_class) __BT_NOEXCEPT;
1188 
1196 extern const bt_clock_class *
1198  const bt_stream_class *stream_class) __BT_NOEXCEPT;
1199 
1211 
1218 
1272  bt_stream_class *stream_class,
1273  bt_field_class *field_class) __BT_NOEXCEPT;
1274 
1300 extern bt_field_class *
1302  bt_stream_class *stream_class) __BT_NOEXCEPT;
1303 
1311 extern const bt_field_class *
1313  const bt_stream_class *stream_class) __BT_NOEXCEPT;
1314 
1357  bt_stream_class *stream_class,
1358  bt_field_class *field_class) __BT_NOEXCEPT;
1359 
1387 extern bt_field_class *
1389  bt_stream_class *stream_class) __BT_NOEXCEPT;
1390 
1398 extern const bt_field_class *
1400  const bt_stream_class *stream_class) __BT_NOEXCEPT;
1401 
1426  bt_stream_class *stream_class,
1427  bt_bool assigns_automatic_event_class_id) __BT_NOEXCEPT;
1428 
1453  const bt_stream_class *stream_class) __BT_NOEXCEPT;
1454 
1479  bt_stream_class *stream_class,
1480  bt_bool assigns_automatic_stream_id) __BT_NOEXCEPT;
1481 
1505  const bt_stream_class *stream_class) __BT_NOEXCEPT;
1506 
1559  bt_stream_class *stream_class, bt_bool supports_packets,
1560  bt_bool with_beginning_default_clock_snapshot,
1561  bt_bool with_end_default_clock_snapshot) __BT_NOEXCEPT;
1562 
1584  const bt_stream_class *stream_class) __BT_NOEXCEPT;
1585 
1613  const bt_stream_class *stream_class) __BT_NOEXCEPT;
1614 
1642  const bt_stream_class *stream_class) __BT_NOEXCEPT;
1643 
1685  bt_stream_class *stream_class,
1686  bt_bool supports_discarded_events,
1687  bt_bool with_default_clock_snapshots) __BT_NOEXCEPT;
1688 
1713  const bt_stream_class *stream_class) __BT_NOEXCEPT;
1714 
1741  const bt_stream_class *stream_class) __BT_NOEXCEPT;
1742 
1791  bt_stream_class *stream_class,
1792  bt_bool supports_discarded_packets,
1793  bt_bool with_default_clock_snapshots) __BT_NOEXCEPT;
1794 
1819  const bt_stream_class *stream_class) __BT_NOEXCEPT;
1820 
1847  const bt_stream_class *stream_class) __BT_NOEXCEPT;
1848 
1879  bt_stream_class *stream_class,
1880  const bt_value *user_attributes) __BT_NOEXCEPT;
1881 
1908  bt_stream_class *stream_class) __BT_NOEXCEPT;
1909 
1918  const bt_stream_class *stream_class) __BT_NOEXCEPT;
1919 
1942 extern void bt_stream_class_get_ref(
1943  const bt_stream_class *stream_class) __BT_NOEXCEPT;
1944 
1960 extern void bt_stream_class_put_ref(
1961  const bt_stream_class *stream_class) __BT_NOEXCEPT;
1962 
1977 #define BT_STREAM_CLASS_PUT_REF_AND_RESET(_stream_class) \
1978  do { \
1979  bt_stream_class_put_ref(_stream_class); \
1980  (_stream_class) = NULL; \
1981  } while (0)
1982 
2008 #define BT_STREAM_CLASS_MOVE_REF(_dst, _src) \
2009  do { \
2010  bt_stream_class_put_ref(_dst); \
2011  (_dst) = (_src); \
2012  (_src) = NULL; \
2013  } while (0)
2014 
2019 #ifdef __cplusplus
2020 }
2021 #endif
2022 
2023 #endif /* BABELTRACE2_TRACE_IR_STREAM_CLASS_H */
bt_bool bt_stream_class_discarded_packets_have_default_clock_snapshots(const bt_stream_class *stream_class)
Returns whether or not the discarded packets messages of the instances (streams) of the stream class ...
Out of memory.
Definition: stream-class.h:1216
Success.
Definition: stream-class.h:894
Success.
Definition: stream-class.h:1047
const bt_trace_class * bt_stream_class_borrow_trace_class_const(const bt_stream_class *stream_class)
Borrows the trace class which contains the stream class stream_class (const version).
const bt_clock_class * bt_stream_class_borrow_default_clock_class_const(const bt_stream_class *stream_class)
Borrows the default clock class from the stream class stream_class (const version).
void bt_stream_class_set_assigns_automatic_stream_id(bt_stream_class *stream_class, bt_bool assigns_automatic_stream_id)
Sets whether or not the stream class stream_class automatically assigns a numeric ID to a stream you ...
void bt_stream_class_set_user_attributes(bt_stream_class *stream_class, const bt_value *user_attributes)
Sets the user attributes of the stream class stream_class to user_attributes.
bt_event_class * bt_stream_class_borrow_event_class_by_id(bt_stream_class *stream_class, uint64_t id)
Borrows the event class having the numeric ID id from the stream class stream_class.
void bt_stream_class_set_supports_discarded_packets(bt_stream_class *stream_class, bt_bool supports_discarded_packets, bt_bool with_default_clock_snapshots)
Sets whether or not the instances (streams) of the stream class stream_class can have discarded packe...
bt_bool bt_stream_class_discarded_events_have_default_clock_snapshots(const bt_stream_class *stream_class)
Returns whether or not the discarded events messages of the instances (streams) of the stream class s...
void bt_stream_class_set_supports_packets(bt_stream_class *stream_class, bt_bool supports_packets, bt_bool with_beginning_default_clock_snapshot, bt_bool with_end_default_clock_snapshot)
Sets whether or not the instances (streams) of the stream class stream_class have packets and...
Out of memory.
Definition: stream-class.h:979
void bt_stream_class_set_supports_discarded_events(bt_stream_class *stream_class, bt_bool supports_discarded_events, bt_bool with_default_clock_snapshots)
Sets whether or not the instances (streams) of the stream class stream_class can have discarded event...
const bt_field_class * bt_stream_class_borrow_event_common_context_field_class_const(const bt_stream_class *stream_class)
Borrows the event common context field class from the stream class stream_class (const version())...
bt_stream_class_set_name_status
Status codes for bt_stream_class_set_name().
Definition: stream-class.h:968
struct bt_field_class bt_field_class
Field class.
Definition: types.h:39
bt_stream_class * bt_stream_class_create(bt_trace_class *trace_class)
Creates a default stream class and adds it to the trace class trace_class.
Out of memory.
Definition: stream-class.h:1053
bt_bool bt_stream_class_supports_discarded_packets(const bt_stream_class *stream_class)
Returns whether or not the instances (streams) of the stream class stream_class can have discarded pa...
const char * bt_stream_class_get_name(const bt_stream_class *stream_class)
Returns the name of the stream class stream_class.
bt_field_class * bt_stream_class_borrow_event_common_context_field_class(bt_stream_class *stream_class)
Borrows the event common context field class from the stream class stream_class.
bt_stream_class_set_field_class_status
Status codes for bt_stream_class_set_packet_context_field_class() and bt_stream_class_set_event_commo...
Definition: stream-class.h:1205
bt_event_class * bt_stream_class_borrow_event_class_by_index(bt_stream_class *stream_class, uint64_t index)
Borrows the event class at index index from the stream class stream_class.
bt_trace_class * bt_stream_class_borrow_trace_class(bt_stream_class *stream_class)
Borrows the trace class which contains the stream class stream_class.
bt_stream_class_set_uid_status bt_stream_class_set_uid(bt_stream_class *stream_class, const char *uid)
Sets the unique identifier (UID) of the stream class stream_class to a copy of uid.
Success.
Definition: stream-class.h:1127
bt_bool bt_stream_class_packets_have_end_default_clock_snapshot(const bt_stream_class *stream_class)
Returns whether or not the packets of the instances (streams) of the stream class stream_class have a...
uint64_t bt_stream_class_get_id(const bt_stream_class *stream_class)
Returns the numeric ID of the stream class stream_class.
bt_field_class * bt_stream_class_borrow_packet_context_field_class(bt_stream_class *stream_class)
Borrows the packet context field class from the stream class stream_class.
bt_bool bt_stream_class_assigns_automatic_event_class_id(const bt_stream_class *stream_class)
Returns whether or not the stream class stream_class automatically assigns a numeric ID to an event c...
struct bt_value bt_value
Value.
Definition: types.h:93
bt_value * bt_stream_class_borrow_user_attributes(bt_stream_class *stream_class)
Borrows the user attributes of the stream class stream_class.
struct bt_event_class bt_event_class
Event class.
Definition: types.h:37
const bt_field_class * bt_stream_class_borrow_packet_context_field_class_const(const bt_stream_class *stream_class)
Borrows the packet context field class from the stream class stream_class (const version).
bt_bool bt_stream_class_assigns_automatic_stream_id(const bt_stream_class *stream_class)
Returns whether or not the stream class stream_class automatically assigns a numeric ID to a stream y...
bt_stream_class_set_field_class_status bt_stream_class_set_packet_context_field_class(bt_stream_class *stream_class, bt_field_class *field_class)
Sets the packet context field class of the stream class stream_class to field_class.
void bt_stream_class_put_ref(const bt_stream_class *stream_class)
Decrements the reference count of the stream class stream_class.
bt_stream_class_set_namespace_status
Status codes for bt_stream_class_set_namespace().
Definition: stream-class.h:889
int bt_bool
Babeltrace 2 boolean type.
Definition: types.h:126
bt_stream_class_set_namespace_status bt_stream_class_set_namespace(bt_stream_class *stream_class, const char *ns)
Sets the namespace of the stream class stream_class to a copy of ns.
Out of memory.
Definition: stream-class.h:900
bt_clock_class * bt_stream_class_borrow_default_clock_class(bt_stream_class *stream_class)
Borrows the default clock class from the stream class stream_class.
bt_bool bt_stream_class_packets_have_beginning_default_clock_snapshot(const bt_stream_class *stream_class)
Returns whether or not the packets of the instances (streams) of the stream class stream_class have a...
const char * bt_stream_class_get_namespace(const bt_stream_class *stream_class)
Returns the namespace of the stream class stream_class.
bt_stream_class * bt_stream_class_create_with_id(bt_trace_class *trace_class, uint64_t id)
Creates a default stream class with the numeric ID id and adds it to the trace class trace_class...
struct bt_trace_class bt_trace_class
Trace class.
Definition: types.h:92
void bt_stream_class_set_assigns_automatic_event_class_id(bt_stream_class *stream_class, bt_bool assigns_automatic_event_class_id)
Sets whether or not the stream class stream_class automatically assigns a numeric ID to an event clas...
bt_stream_class_set_default_clock_class_status
Status codes for bt_stream_class_set_default_clock_class().
Definition: stream-class.h:1122
const bt_value * bt_stream_class_borrow_user_attributes_const(const bt_stream_class *stream_class)
Borrows the user attributes of the stream class stream_class (const version).
bt_stream_class_set_name_status bt_stream_class_set_name(bt_stream_class *stream_class, const char *name)
Sets the name of the stream class stream_class to a copy of name.
bt_stream_class_set_default_clock_class_status bt_stream_class_set_default_clock_class(bt_stream_class *stream_class, bt_clock_class *clock_class)
Sets the default clock class of the stream class stream_class to clock_class.
struct bt_stream_class bt_stream_class
Stream class.
Definition: types.h:90
Success.
Definition: stream-class.h:973
bt_stream_class_set_uid_status
Status codes for bt_stream_class_set_uid().
Definition: stream-class.h:1042
void bt_stream_class_get_ref(const bt_stream_class *stream_class)
Increments the reference count of the stream class stream_class.
Success.
Definition: stream-class.h:1210
const char * bt_stream_class_get_uid(const bt_stream_class *stream_class)
Returns the UID of the stream class stream_class.
struct bt_clock_class bt_clock_class
Clock class.
Definition: types.h:22
bt_bool bt_stream_class_supports_packets(const bt_stream_class *stream_class)
Returns whether or not the instances (streams) of the stream class stream_class have packets...
uint64_t bt_stream_class_get_event_class_count(const bt_stream_class *stream_class)
Returns the number of event classes contained in the stream class stream_class.
const bt_event_class * bt_stream_class_borrow_event_class_by_id_const(const bt_stream_class *stream_class, uint64_t id)
Borrows the event class having the numeric ID id from the stream class stream_class (const version)...
bt_bool bt_stream_class_supports_discarded_events(const bt_stream_class *stream_class)
Returns whether or not the instances (streams) of the stream class stream_class can have discarded ev...
bt_stream_class_set_field_class_status bt_stream_class_set_event_common_context_field_class(bt_stream_class *stream_class, bt_field_class *field_class)
Sets the event common context field class of the stream class stream_class to field_class.
const bt_event_class * bt_stream_class_borrow_event_class_by_index_const(const bt_stream_class *stream_class, uint64_t index)
Borrows the event class at index index from the stream class stream_class (const version).