Babeltrace 2 C API
2.1.1
Open-source trace manipulation framework
|
Set of descriptors of prospective components to use with bt_get_greatest_operative_mip_version() or bt_get_greatest_operative_mip_version_with_restriction().
A component descriptor set is an unordered set of component descriptors.
A component descriptor describes a prospective component, that is, everything that's needed to instantiate a component class within a trace processing graph without actually doing it:
component_class
parameter of one of the bt_graph_add_*_component*()
functions.params
parameter of one of the bt_graph_add_*_component*()
functions.initialize_method_data
parameter of one of the bt_graph_add_*_component_with_initialize_method_data()
functions.As of Babeltrace 2.1, the only use case of a component descriptor set is bt_get_greatest_operative_mip_version() and bt_get_greatest_operative_mip_version_with_restriction(). This function computes the greatest Message Interchange Protocol version which you can use to create a trace processing graph to which you intend to add components described by a set of component descriptors.
A component descriptor set is a shared object: get a new reference with bt_component_descriptor_set_get_ref() and put an existing reference with bt_component_descriptor_set_put_ref().
Create an empty component descriptor set with bt_component_descriptor_set_create().
Add a component descriptor to a component descriptor set with bt_component_descriptor_set_add_descriptor() and bt_component_descriptor_set_add_descriptor_with_initialize_method_data().
Type | |
typedef struct bt_component_descriptor_set | bt_component_descriptor_set |
Component descriptor set. | |
Component descriptor adding | |
bt_component_descriptor_set_add_descriptor_status | bt_component_descriptor_set_add_descriptor (bt_component_descriptor_set *component_descriptor_set, const bt_component_class *component_class, const bt_value *params) |
Alias of bt_component_descriptor_set_add_descriptor_with_initialize_method_data() with the initialize_method_data parameter set to NULL . | |
bt_component_descriptor_set_add_descriptor_status | bt_component_descriptor_set_add_descriptor_with_initialize_method_data (bt_component_descriptor_set *component_descriptor_set, const bt_component_class *component_class, const bt_value *params, void *initialize_method_data) |
Adds a descriptor of a component which would be an instance of the component class component_class , would receive the parameters params and the method data initialize_method_data at initialization time, to the component descriptor set component_descriptor_set . More... | |
Reference count | |
void | bt_component_descriptor_set_get_ref (const bt_component_descriptor_set *component_descriptor_set) |
Increments the reference count of the component descriptor set component_descriptor_set . More... | |
void | bt_component_descriptor_set_put_ref (const bt_component_descriptor_set *component_descriptor_set) |
Decrements the reference count of the component descriptor set component_descriptor_set . More... | |
#define | BT_COMPONENT_DESCRIPTOR_SET_PUT_REF_AND_RESET(_component_descriptor_set) |
Decrements the reference count of the component descriptor set _component_descriptor_set , and then sets _component_descriptor_set to NULL . More... | |
#define | BT_COMPONENT_DESCRIPTOR_SET_MOVE_REF(_dst, _src) |
Decrements the reference count of the component descriptor set _dst , sets _dst to _src , and then sets _src to NULL . More... | |
Status codes for bt_component_descriptor_set_add_descriptor() and bt_component_descriptor_set_add_descriptor_with_initialize_method_data().
Enumerator | |
---|---|
BT_COMPONENT_DESCRIPTOR_SET_ADD_DESCRIPTOR_STATUS_OK |
Success. |
BT_COMPONENT_DESCRIPTOR_SET_ADD_DESCRIPTOR_STATUS_MEMORY_ERROR |
Out of memory. |
#define BT_COMPONENT_DESCRIPTOR_SET_PUT_REF_AND_RESET | ( | _component_descriptor_set | ) |
Decrements the reference count of the component descriptor set _component_descriptor_set
, and then sets _component_descriptor_set
to NULL
.
_component_descriptor_set | Component descriptor set of which to decrement the reference count. Can contain |
_component_descriptor_set
is an assignable expression. #define BT_COMPONENT_DESCRIPTOR_SET_MOVE_REF | ( | _dst, | |
_src | |||
) |
Decrements the reference count of the component descriptor set _dst
, sets _dst
to _src
, and then sets _src
to NULL
.
This macro effectively moves a component descriptor set reference from the expression _src
to the expression _dst
, putting the existing _dst
reference.
_dst | Destination expression. Can contain |
_src | Source expression. Can contain |
_dst
is an assignable expression. _src
is an assignable expression. bt_component_descriptor_set* bt_component_descriptor_set_create | ( | void | ) |
Creates an empty component descriptor set.
NULL
on memory error. bt_component_descriptor_set_add_descriptor_status bt_component_descriptor_set_add_descriptor_with_initialize_method_data | ( | bt_component_descriptor_set * | component_descriptor_set, |
const bt_component_class * | component_class, | ||
const bt_value * | params, | ||
void * | initialize_method_data | ||
) |
Adds a descriptor of a component which would be an instance of the component class component_class
, would receive the parameters params
and the method data initialize_method_data
at initialization time, to the component descriptor set component_descriptor_set
.
[in] | component_descriptor_set | Component descriptor set to which to add a component descriptor. |
[in] | component_class | Component class which would be instantiated to create the described component. |
[in] | params | Parameters which would be passed to the initialization method of the described component as the Can be |
[in] | initialize_method_data | User data which would be passed to the initialization method of the described component as the initialize_method_data parameter. |
BT_COMPONENT_DESCRIPTOR_SET_ADD_DESCRIPTOR_STATUS_OK | Success. |
BT_COMPONENT_DESCRIPTOR_SET_ADD_DESCRIPTOR_STATUS_MEMORY_ERROR | Out of memory. |
component_descriptor_set
is not NULL
. component_class
is not NULL
. params
is a map value (bt_value_is_map() returns BT_TRUE) or is NULL
.void bt_component_descriptor_set_get_ref | ( | const bt_component_descriptor_set * | component_descriptor_set | ) |
Increments the reference count of the component descriptor set component_descriptor_set
.
[in] | component_descriptor_set | Component descriptor set of which to increment the reference count. Can be |
void bt_component_descriptor_set_put_ref | ( | const bt_component_descriptor_set * | component_descriptor_set | ) |
Decrements the reference count of the component descriptor set component_descriptor_set
.
[in] | component_descriptor_set | Component descriptor set of which to decrement the reference count. Can be |