2 * Copyright 2018 Philippe Proulx <pproulx@efficios.com>
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 #define BT_LOG_TAG "CTF-WRITER-FIELD-WRAPPER"
24 #include <babeltrace/lib-logging-internal.h>
26 #include <babeltrace/ctf-writer/field-wrapper-internal.h>
27 #include <babeltrace/ctf-writer/fields-internal.h>
28 #include <babeltrace/object-pool-internal.h>
29 #include <babeltrace/ctf-writer/object-internal.h>
33 struct bt_ctf_field_wrapper
*bt_ctf_field_wrapper_new(void *data
)
35 struct bt_ctf_field_wrapper
*field_wrapper
=
36 g_new0(struct bt_ctf_field_wrapper
, 1);
38 BT_LOGD_STR("Creating empty field wrapper object.");
41 BT_LOGE("Failed to allocate one field wrapper.");
45 bt_ctf_object_init_unique(&field_wrapper
->base
);
46 BT_LOGD("Created empty field wrapper object: addr=%p",
54 void bt_ctf_field_wrapper_destroy(struct bt_ctf_field_wrapper
*field_wrapper
)
56 BT_LOGD("Destroying field wrapper: addr=%p", field_wrapper
);
57 BT_ASSERT(!field_wrapper
->field
);
58 BT_LOGD_STR("Putting stream class.");
59 g_free(field_wrapper
);
63 struct bt_ctf_field_wrapper
*bt_ctf_field_wrapper_create(
64 struct bt_ctf_object_pool
*pool
, struct bt_ctf_field_type
*ft
)
66 struct bt_ctf_field_wrapper
*field_wrapper
= NULL
;
70 field_wrapper
= bt_ctf_object_pool_create_object(pool
);
72 BT_LIB_LOGE("Cannot allocate one field wrapper from field wrapper pool: "
77 BT_ASSERT(field_wrapper
->field
);
82 bt_ctf_field_wrapper_destroy(field_wrapper
);
This page took 0.03239 seconds and 4 git commands to generate.