cpp-common/bt2c/fmt.hpp: use `wise_enum::string_type` in `EnableIfIsWiseEnum` definition
[babeltrace.git] / src / lib / property.h
CommitLineData
8bf65fbd 1/*
0235b0db 2 * SPDX-License-Identifier: MIT
8bf65fbd 3 *
0235b0db 4 * Copyright (c) 2018 Philippe Proulx <pproulx@efficios.com>
8bf65fbd
JG
5 */
6
0235b0db
MJ
7#ifndef BABELTRACE_PROPERTY_INTERNAL_H
8#define BABELTRACE_PROPERTY_INTERNAL_H
9
578e048b 10#include "common/assert.h"
4fa90f32 11#include <babeltrace2/babeltrace.h>
44c440bc
PP
12#include <glib.h>
13#include <stdint.h>
8bf65fbd 14
44c440bc
PP
15struct bt_property {
16 enum bt_property_availability avail;
17};
8bf65fbd 18
44c440bc
PP
19struct bt_property_uint {
20 struct bt_property base;
21 uint64_t value;
8bf65fbd
JG
22};
23
44c440bc
PP
24static inline
25void bt_property_uint_set(struct bt_property_uint *prop, uint64_t value)
26{
27 BT_ASSERT(prop);
28 prop->base.avail = BT_PROPERTY_AVAILABILITY_AVAILABLE;
29 prop->value = value;
30}
31
32static inline
33void bt_property_uint_init(struct bt_property_uint *prop,
34 enum bt_property_availability avail, uint64_t value)
35{
36 BT_ASSERT(prop);
37 prop->base.avail = avail;
38 prop->value = value;
39}
8bf65fbd 40
44c440bc 41#endif /* BABELTRACE_PROPERTY_INTERNAL_H */
This page took 0.097276 seconds and 4 git commands to generate.