lib: decouple variant FC option names from selector FC mapping names
[babeltrace.git] / include / babeltrace2 / trace-ir / field-class-const.h
index 5a8b2b49955d9f6150a66f7a5f7db61444b02c2a..844c9e32e8de45c841526c652c476c78dccb28ca 100644 (file)
@@ -2,8 +2,7 @@
 #define BABELTRACE2_TRACE_IR_FIELD_CLASS_CONST_H
 
 /*
- * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
- * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
  * 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.
- *
- * The Common Trace Format (CTF) Specification is available at
- * http://www.efficios.com/ctf
  */
 
 #ifndef __BT_IN_BABELTRACE_H
 # error "Please include <babeltrace2/babeltrace.h> instead."
 #endif
 
-/*
- * For bt_bool, bt_field_class, bt_field_path,
- * bt_field_class_enumeration_mapping,
- * bt_field_class_unsigned_enumeration_mapping,
- * bt_field_class_signed_enumeration_mapping,
- * bt_field_class_enumeration_mapping_label_array, __BT_UPCAST_CONST
- */
-#include <babeltrace2/types.h>
-
 #include <stdint.h>
 #include <stddef.h>
 
+#include <babeltrace2/types.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -57,7 +46,9 @@ typedef enum bt_field_class_type {
        BT_FIELD_CLASS_TYPE_STRUCTURE,
        BT_FIELD_CLASS_TYPE_STATIC_ARRAY,
        BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY,
-       BT_FIELD_CLASS_TYPE_VARIANT,
+       BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR,
+       BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR,
+       BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR,
 } bt_field_class_type;
 
 typedef enum bt_field_class_integer_preferred_display_base {
@@ -87,10 +78,18 @@ extern const bt_field_class_unsigned_enumeration_mapping *
 bt_field_class_unsigned_enumeration_borrow_mapping_by_index_const(
                const bt_field_class *field_class, uint64_t index);
 
+extern const bt_field_class_unsigned_enumeration_mapping *
+bt_field_class_unsigned_enumeration_borrow_mapping_by_label_const(
+               const bt_field_class *field_class, const char *label);
+
 extern const bt_field_class_signed_enumeration_mapping *
 bt_field_class_signed_enumeration_borrow_mapping_by_index_const(
                const bt_field_class *field_class, uint64_t index);
 
+extern const bt_field_class_signed_enumeration_mapping *
+bt_field_class_signed_enumeration_borrow_mapping_by_label_const(
+               const bt_field_class *field_class, const char *label);
+
 static inline
 const bt_field_class_enumeration_mapping *
 bt_field_class_unsigned_enumeration_mapping_as_mapping_const(
@@ -110,18 +109,13 @@ bt_field_class_signed_enumeration_mapping_as_mapping_const(
 extern const char *bt_field_class_enumeration_mapping_get_label(
                const bt_field_class_enumeration_mapping *mapping);
 
-extern uint64_t bt_field_class_enumeration_mapping_get_range_count(
-               const bt_field_class_enumeration_mapping *mapping);
-
-extern void
-bt_field_class_unsigned_enumeration_mapping_get_range_by_index(
-               const bt_field_class_unsigned_enumeration_mapping *mapping,
-               uint64_t index, uint64_t *lower, uint64_t *upper);
+extern const bt_integer_range_set_unsigned *
+bt_field_class_unsigned_enumeration_mapping_borrow_ranges_const(
+               const bt_field_class_unsigned_enumeration_mapping *mapping);
 
-extern void
-bt_field_class_signed_enumeration_mapping_get_range_by_index(
-               const bt_field_class_signed_enumeration_mapping *mapping,
-               uint64_t index, int64_t *lower, int64_t *upper);
+extern const bt_integer_range_set_signed *
+bt_field_class_signed_enumeration_mapping_borrow_ranges_const(
+               const bt_field_class_signed_enumeration_mapping *mapping);
 
 typedef enum bt_field_class_enumeration_get_mapping_labels_for_value_status {
        BT_FIELD_CLASS_ENUMERATION_GET_MAPPING_LABELS_BY_VALUE_STATUS_MEMORY_ERROR      = __BT_FUNC_STATUS_MEMORY_ERROR,
@@ -169,10 +163,6 @@ extern const bt_field_path *
 bt_field_class_dynamic_array_borrow_length_field_path_const(
                const bt_field_class *field_class);
 
-extern const bt_field_path *
-bt_field_class_variant_borrow_selector_field_path_const(
-               const bt_field_class *field_class);
-
 extern uint64_t bt_field_class_variant_get_option_count(
                const bt_field_class *field_class);
 
@@ -184,6 +174,22 @@ extern const bt_field_class_variant_option *
 bt_field_class_variant_borrow_option_by_name_const(
                const bt_field_class *field_class, const char *name);
 
+extern const bt_field_class_variant_with_unsigned_selector_option *
+bt_field_class_variant_with_unsigned_selector_borrow_option_by_index_const(
+               const bt_field_class *field_class, uint64_t index);
+
+extern const bt_field_class_variant_with_unsigned_selector_option *
+bt_field_class_variant_with_unsigned_selector_borrow_option_by_name_const(
+               const bt_field_class *field_class, const char *name);
+
+extern const bt_field_class_variant_with_signed_selector_option *
+bt_field_class_variant_with_signed_selector_borrow_option_by_index_const(
+               const bt_field_class *field_class, uint64_t index);
+
+extern const bt_field_class_variant_with_signed_selector_option *
+bt_field_class_variant_with_signed_selector_borrow_option_by_name_const(
+               const bt_field_class *field_class, const char *name);
+
 extern const char *bt_field_class_variant_option_get_name(
                const bt_field_class_variant_option *option);
 
@@ -191,6 +197,34 @@ extern const bt_field_class *
 bt_field_class_variant_option_borrow_field_class_const(
                const bt_field_class_variant_option *option);
 
+extern const bt_field_path *
+bt_field_class_variant_with_selector_borrow_selector_field_path_const(
+               const bt_field_class *field_class);
+
+extern const bt_integer_range_set_unsigned *
+bt_field_class_variant_with_unsigned_selector_option_borrow_ranges_const(
+               const bt_field_class_variant_with_unsigned_selector_option *option);
+
+static inline
+const bt_field_class_variant_option *
+bt_field_class_variant_with_unsigned_selector_option_as_option_const(
+               const bt_field_class_variant_with_unsigned_selector_option *option)
+{
+       return __BT_UPCAST_CONST(bt_field_class_variant_option, option);
+}
+
+extern const bt_integer_range_set_signed *
+bt_field_class_variant_with_signed_selector_option_borrow_ranges_const(
+               const bt_field_class_variant_with_signed_selector_option *option);
+
+static inline
+const bt_field_class_variant_option *
+bt_field_class_variant_with_signed_selector_option_as_option_const(
+               const bt_field_class_variant_with_signed_selector_option *option)
+{
+       return __BT_UPCAST_CONST(bt_field_class_variant_option, option);
+}
+
 extern void bt_field_class_get_ref(const bt_field_class *field_class);
 
 extern void bt_field_class_put_ref(const bt_field_class *field_class);
This page took 0.026491 seconds and 4 git commands to generate.