Babeltrace 2 C API
2.0.0
Open-source trace manipulation framework
|
Component class development (creation).
A component class is the class of a component:
A component class has methods. This module essentially offers:
A component class method is a user function. There are two types of methods:
Operates on an instance (a component).
The type of the method's first parameter is bt_self_component_source, bt_self_component_filter, or bt_self_component_sink, depending on the component class's type.
This is similar to an instance method in Python (where the instance object name is generally self
) or a member function in C++ (where the instance pointer is named this
), for example.
Operates on a component class.
The type of the method's first parameter is bt_self_component_class_source, bt_self_component_class_filter, or bt_self_component_class_sink, depending on the component class's type.
This is similar to a class method in Python or a static member function in C++, for example.
See Methods to learn more about the different types of component class methods.
A component class is a shared object: see the Component classes module for the reference count functions.
Some library functions freeze component classes on success. The documentation of those functions indicate this postcondition.
Create a component class with bt_component_class_source_create(), bt_component_class_filter_create(), and bt_component_class_sink_create(). You must give the component class a name (not unique in any way) at creation time.
When you create a source component class or a filter component class, you must pass a message iterator class. This is the class of any message iterator created for one of the component class's instance's output port.
When you create a sink component class, you must pass a consuming method.
Upcast the bt_component_class_source, bt_component_class_filter, and bt_component_class_sink types returned by the creation functions to the bt_component_class type with bt_component_class_source_as_component_class(), bt_component_class_filter_as_component_class(), and bt_component_class_sink_as_component_class().
Set the description and the help text of a component class with bt_component_class_set_description() and bt_component_class_set_help().
To learn when exactly the methods below are called, see Trace processing graph life cycle.
The available component class methods to implement are:
Called within bt_graph_run() or bt_graph_run_once() to make your sink component consume and process messages.
This method typically gets one message batch from one (or more) upstream message iterator. You are free to get more than one batch of messages if needed; however, keep in mind that the Babeltrace 2 project recommends that this method executes fast enough so as not to block an interactive application running on the same thread.
During what you consider to be a long, blocking operation, the project recommends that you periodically check whether or not you are interrupted with bt_self_component_sink_is_interrupted(). When you are, you can return either BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_AGAIN or BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_ERROR, depending on your capability to continue the current operation later.
If you need to block the thread, you can instead report to try again later to the bt_graph_run() or bt_graph_run_once() caller by returning BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_AGAIN.
If your sink component is done consuming and processing, return BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_END from this method. The trace processing graph can continue to run afterwards if other sink components are still consuming.
Within this method, you cannot add an input port with bt_self_component_sink_add_input_port().
Set this mandatory method at sink component class creation time with bt_component_class_sink_create().
Called to finalize your component, that is, to let you destroy/free/finalize any user data you have (retrieved with bt_self_component_get_data()).
The Babeltrace 2 library does not specify exactly when this method is called, but guarantees that it's called before the component is destroyed.
For source components and filter components, the library guarantees that this method is called after all the component's message iterators are finalized.
This method is not called if the component's initialization method previously returned an error status code.
Within this method, you cannot:
Set this optional method with bt_component_class_source_set_finalize_method(), bt_component_class_filter_set_finalize_method(), and bt_component_class_sink_set_finalize_method().
Called within bt_get_greatest_operative_mip_version() to get the set of MIP versions that an eventual component supports.
This is a class method because you can call bt_get_greatest_operative_mip_version() before you even create a trace processing graph.
In this method, you receive initialization parameters as the params parameter and initialization method data as the initialize_method_data. Those parameters are set when bt_component_descriptor_set_add_descriptor() is called, before bt_get_greatest_operative_mip_version() is called.
Considering those initialization parameters, you need to fill the received unsigned integer range set supported_versions with the rangs of MIP versions you support.
As of Babeltrace 2.0, you can only support MIP version 0.
Not having this method is equivalent to having one which adds the [0, 0] range to the supported_versions set.
Set this optional method with bt_component_class_source_set_get_supported_mip_versions_method(), bt_component_class_filter_set_get_supported_mip_versions_method(), and bt_component_class_sink_set_get_supported_mip_versions_method().
For a given trace processing graph, called the first time bt_graph_run() or bt_graph_run_once() is called to notify your sink component that the graph is now configured.
Within this method, you can create message iterators on your sink component's input ports. You can also manipulate those message iterators, for example get and process initial messages or make them.
This method is called after the component's initialization method is called. You cannot create a message iterator in the initialization method.
Within this method, you cannot add an input port with bt_self_component_sink_add_input_port().
Set this optional method with bt_component_class_sink_set_graph_is_configured_method().
Called within a bt_graph_add_*_component*()
function (see Graph) to initialize your component.
Within this method, you receive the initialization parameters and initialization method data passed to the bt_graph_add_*_component*()
function.
This method is where you can add initial ports to your component with bt_self_component_source_add_output_port(), bt_self_component_filter_add_input_port(), bt_self_component_filter_add_output_port(), or bt_self_component_sink_add_input_port(). You can also add ports in the input port connected and output port connected methods.
You can create user data and set it as the self component's user data with bt_self_component_set_data().
If you return BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK from this method, then your component's finalization method will be called, if it exists, when your component is finalized.
Set this optional method with bt_component_class_source_set_initialize_method(), bt_component_class_filter_set_initialize_method(), and bt_component_class_sink_set_initialize_method().
Called within bt_graph_connect_ports() to notify your component that one of its input ports has been connected.
Within this method, you can add more ports to your component with bt_self_component_source_add_output_port(), bt_self_component_filter_add_input_port(), bt_self_component_filter_add_output_port(), or bt_self_component_sink_add_input_port().
Set this optional method with bt_component_class_filter_set_input_port_connected_method() and bt_component_class_sink_set_input_port_connected_method().
Called within bt_graph_connect_ports() to notify your component that one of its output ports has been connected.
Within this method, you can add more ports to your component with bt_self_component_source_add_output_port(), bt_self_component_filter_add_input_port(), bt_self_component_filter_add_output_port(), or bt_self_component_sink_add_input_port().
Set this optional method with bt_component_class_source_set_output_port_connected_method() and bt_component_class_filter_set_output_port_connected_method().
Called within bt_query_executor_query() to make your component class perform a query operation.
Within this method, you receive the query object name, the query parameters, and the method data passed when the query executor was created with bt_query_executor_create() or bt_query_executor_create_with_method_data().
You also receive a private view of the query executor which you can cast to a const
query executor with bt_private_query_executor_as_query_executor_const() to access the executor's logging level with bt_query_executor_get_logging_level().
On success, set *result to the query operation's result: a new value reference.
If the queried object's name (object_name parameter) is unknown, return BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_UNKNOWN_OBJECT.
If you need to block the thread, you can instead report to try again later to the bt_query_executor_query() caller by returning BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_AGAIN.
Set this optional method with bt_component_class_source_set_query_method(), bt_component_class_filter_set_query_method(), and bt_component_class_sink_set_query_method().
In any of the methods above:
Never call bt_component_get_ref(), bt_component_source_get_ref(), bt_component_filter_get_ref(), or bt_component_sink_get_ref() on your own (upcasted) self component to avoid reference cycles.
You can keep a borrowed (weak) self component reference in your component's user data (see bt_self_component_set_data()).
Within any instance method, you can access the component's configured logging level by first upcasting the self component to the bt_component type with bt_self_component_as_component(), and then with bt_component_get_logging_level().
Modules | |
Messages | |
Elements exchanged between components. | |
Message iterator | |
Iterator of a message sequence. | |
Message iterator class | |
Message iterator class. | |
Private query executor | |
Private view of a query executor for a component class query method. | |
Self components | |
Private views of components for instance methods. | |
Self component classes | |
Private views of component classes for class methods. | |
Creation | |
bt_component_class_source * | bt_component_class_source_create (const char *name, bt_message_iterator_class *message_iterator_class) |
Creates a source component class named name and having the message iterator class message_iterator_class. More... | |
bt_component_class_filter * | bt_component_class_filter_create (const char *name, bt_message_iterator_class *message_iterator_class) |
Creates a filter component class named name and having the message iterator class message_iterator_class. More... | |
bt_component_class_sink * | bt_component_class_sink_create (const char *name, bt_component_class_sink_consume_method consume_method) |
Creates a sink component class named name and having the consuming method consume_method. More... | |
Upcast | |
static bt_component_class * | bt_component_class_source_as_component_class (bt_component_class_source *component_class) |
Upcasts the source component class component_class to the common bt_component_class type. More... | |
static bt_component_class * | bt_component_class_filter_as_component_class (bt_component_class_filter *component_class) |
Upcasts the filter component class component_class to the common bt_component_class type. More... | |
static bt_component_class * | bt_component_class_sink_as_component_class (bt_component_class_sink *component_class) |
Upcasts the sink component class component_class to the common bt_component_class type. More... | |
typedef bt_component_class_sink_consume_method_status(* bt_component_class_sink_consume_method) (bt_self_component_sink *self_component) |
Sink component consuming method.
See the consume method.
[in] | self_component | Sink component instance. |
BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_OK | Success. |
BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_END | Finished processing. |
BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_AGAIN | Try again. |
BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_MEMORY_ERROR | Out of memory. |
BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_ERROR | User error. |
NULL
.typedef void(* bt_component_class_source_finalize_method) (bt_self_component_source *self_component) |
Source component finalization method.
See the finalize method.
[in] | self_component | Source component instance. |
NULL
.typedef void(* bt_component_class_filter_finalize_method) (bt_self_component_filter *self_component) |
Filter component finalization method.
See the finalize method.
[in] | self_component | Filter component instance. |
NULL
.typedef void(* bt_component_class_sink_finalize_method) (bt_self_component_sink *self_component) |
Sink component finalization method.
See the finalize method.
[in] | self_component | Sink component instance. |
NULL
.typedef bt_component_class_get_supported_mip_versions_method_status(* bt_component_class_source_get_supported_mip_versions_method) (bt_self_component_class_source *self_component_class, const bt_value *params, void *initialize_method_data, bt_logging_level logging_level, bt_integer_range_set_unsigned *supported_versions) |
Source component class "get supported Message Interchange Protocol versions" method.
See the get supported MIP versions method.
As of Babeltrace 2.0, you can only add the range [0, 0] to supported_versions.
[in] | self_component_class | Source component class. |
[in] | params | Initialization parameters, as passed as the params parameter of bt_component_descriptor_set_add_descriptor() or bt_component_descriptor_set_add_descriptor_with_initialize_method_data(). params is frozen. |
[in] | initialize_method_data | User data for this method, as passed as the init_method_data parameter of bt_component_descriptor_set_add_descriptor_with_initialize_method_data(). |
[in] | logging_level | Logging level to use during this method's execution, as passed as the logging_level parameter of bt_get_greatest_operative_mip_version(). |
[in] | supported_versions | Unsigned integer range set to which to add the ranges of supported MIP versions of an eventual instance of self_component_class considering params and initialize_method_data. |
NULL
. NULL
. NULL
. typedef bt_component_class_get_supported_mip_versions_method_status(* bt_component_class_filter_get_supported_mip_versions_method) (bt_self_component_class_filter *source_component_class, const bt_value *params, void *initialize_method_data, bt_logging_level logging_level, bt_integer_range_set_unsigned *supported_versions) |
Filter component class "get supported Message Interchange Protocol versions" method.
See the get supported MIP versions method.
As of Babeltrace 2.0, you can only add the range [0, 0] to supported_versions.
[in] | self_component_class | Filter component class. |
[in] | params | Initialization parameters, as passed as the params parameter of bt_component_descriptor_set_add_descriptor() or bt_component_descriptor_set_add_descriptor_with_initialize_method_data(). params is frozen. |
[in] | initialize_method_data | User data for this method, as passed as the init_method_data parameter of bt_component_descriptor_set_add_descriptor_with_initialize_method_data(). |
[in] | logging_level | Logging level to use during this method's execution, as passed as the logging_level parameter of bt_get_greatest_operative_mip_version(). |
[in] | supported_versions | Unsigned integer range set to which to add the ranges of supported MIP versions of an eventual instance of self_component_class considering params and initialize_method_data. |
NULL
. NULL
. NULL
. typedef bt_component_class_get_supported_mip_versions_method_status(* bt_component_class_sink_get_supported_mip_versions_method) (bt_self_component_class_sink *source_component_class, const bt_value *params, void *initialize_method_data, bt_logging_level logging_level, bt_integer_range_set_unsigned *supported_versions) |
Sink component class "get supported Message Interchange Protocol versions" method.
See the get supported MIP versions method.
As of Babeltrace 2.0, you can only add the range [0, 0] to supported_versions.
[in] | self_component_class | Sink component class. |
[in] | params | Initialization parameters, as passed as the params parameter of bt_component_descriptor_set_add_descriptor() or bt_component_descriptor_set_add_descriptor_with_initialize_method_data(). params is frozen. |
[in] | initialize_method_data | User data for this method, as passed as the init_method_data parameter of bt_component_descriptor_set_add_descriptor_with_initialize_method_data(). |
[in] | logging_level | Logging level to use during this method's execution, as passed as the logging_level parameter of bt_get_greatest_operative_mip_version(). |
[in] | supported_versions | Unsigned integer range set to which to add the ranges of supported MIP versions of an eventual instance of self_component_class considering params and initialize_method_data. |
NULL
. NULL
. NULL
. typedef bt_component_class_sink_graph_is_configured_method_status(* bt_component_class_sink_graph_is_configured_method) (bt_self_component_sink *self_component) |
Sink component "graph is configured" method.
See the graph is configured method.
[in] | self_component | Sink component instance. |
NULL
.typedef bt_component_class_initialize_method_status(* bt_component_class_source_initialize_method) (bt_self_component_source *self_component, bt_self_component_source_configuration *configuration, const bt_value *params, void *initialize_method_data) |
Source component initialization method.
See the initialize method.
As of Babeltrace 2.0, the configuration parameter is not used.
[in] | self_component | Source component instance. |
[in] | configuration | Initial component configuration (unused). |
[in] | params | Initialization parameters, as passed as the params parameter of bt_graph_add_source_component() or bt_graph_add_source_component_with_initialize_method_data(). params is frozen. |
[in] | initialize_method_data | User data for this method, as passed as the initialize_method_data parameter of bt_graph_add_source_component_with_initialize_method_data(). |
BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK | Success. |
BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR | Out of memory. |
BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR | User error. |
NULL
. NULL
. NULL
. typedef bt_component_class_initialize_method_status(* bt_component_class_filter_initialize_method) (bt_self_component_filter *self_component, bt_self_component_filter_configuration *configuration, const bt_value *params, void *initialize_method_data) |
Filter component initialization method.
See the initialize method.
As of Babeltrace 2.0, the configuration parameter is not used.
[in] | self_component | Filter component instance. |
[in] | configuration | Initial component configuration (unused). |
[in] | params | Initialization parameters, as passed as the params parameter of bt_graph_add_filter_component() or bt_graph_add_filter_component_with_initialize_method_data(). params is frozen. |
[in] | initialize_method_data | User data for this method, as passed as the initialize_method_data parameter of bt_graph_add_filter_component_with_initialize_method_data(). |
BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK | Success. |
BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR | Out of memory. |
BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR | User error. |
NULL
. NULL
. NULL
. typedef bt_component_class_initialize_method_status(* bt_component_class_sink_initialize_method) (bt_self_component_sink *self_component, bt_self_component_sink_configuration *configuration, const bt_value *params, void *initialize_method_data) |
Sink component initialization method.
See the initialize method.
As of Babeltrace 2.0, the configuration parameter is not used.
[in] | self_component | Sink component instance. |
[in] | configuration | Initial component configuration (unused). |
[in] | params | Initialization parameters, as passed as the params parameter of bt_graph_add_sink_component(), bt_graph_add_sink_component_with_initialize_method_data(), or bt_graph_add_simple_sink_component(). params is frozen. |
[in] | initialize_method_data | User data for this method, as passed as the initialize_method_data parameter of bt_graph_add_sink_component_with_initialize_method_data(). |
BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK | Success. |
BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR | Out of memory. |
BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR | User error. |
NULL
. NULL
. NULL
. typedef bt_component_class_port_connected_method_status(* bt_component_class_source_output_port_connected_method) (bt_self_component_source *self_component, bt_self_component_port_output *self_port, const bt_port_input *other_port) |
Source component "output port connected" method.
See the output port connected method.
[in] | self_component | Source component instance. |
[in] | self_port | Connected output port of self_component. |
[in] | other_port | Connection's other (input) port. |
BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK | Success. |
BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROR | Out of memory. |
BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERROR | User error. |
NULL
. NULL
. NULL
.typedef bt_component_class_port_connected_method_status(* bt_component_class_filter_input_port_connected_method) (bt_self_component_filter *self_component, bt_self_component_port_input *self_port, const bt_port_output *other_port) |
Filter component "input port connected" method.
See the input port connected method.
[in] | self_component | Filter component instance. |
[in] | self_port | Connected input port of self_component. |
[in] | other_port | Connection's other (output) port. |
BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK | Success. |
BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROR | Out of memory. |
BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERROR | User error. |
NULL
. NULL
. NULL
.typedef bt_component_class_port_connected_method_status(* bt_component_class_filter_output_port_connected_method) (bt_self_component_filter *self_component, bt_self_component_port_output *self_port, const bt_port_input *other_port) |
Filter component "output port connected" method.
See the output port connected method.
[in] | self_component | Filter component instance. |
[in] | self_port | Connected output port of self_component. |
[in] | other_port | Connection's other (input) port. |
BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK | Success. |
BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROR | Out of memory. |
BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERROR | User error. |
NULL
. NULL
. NULL
.typedef bt_component_class_port_connected_method_status(* bt_component_class_sink_input_port_connected_method) (bt_self_component_sink *self_component, bt_self_component_port_input *self_port, const bt_port_output *other_port) |
Sink component "input port connected" method.
See the input port connected method.
[in] | self_component | Sink component instance. |
[in] | self_port | Connected input port of self_component. |
[in] | other_port | Connection's other (output) port. |
BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK | Success. |
BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROR | Out of memory. |
BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERROR | User error. |
NULL
. NULL
. NULL
.typedef bt_component_class_query_method_status(* bt_component_class_source_query_method) (bt_self_component_class_source *self_component_class, bt_private_query_executor *query_executor, const char *object_name, const bt_value *params, void *method_data, const bt_value **result) |
Source component class query method.
See the query method.
[in] | self_component_class | Source component class, as passed as the component_class parameter of bt_query_executor_create() or bt_query_executor_create_with_method_data() when creating this query operation's executor. |
[in] | query_executor | Private view of this query operation's executor. |
[in] | object_name | Name of the object to query, as passed as the object_name parameter of bt_query_executor_create() or bt_query_executor_create_with_method_data() when creating this query operation's executor. |
[in] | params | Query parameters, as passed as the params parameter of bt_query_executor_create() or bt_query_executor_create_with_method_data() when creating this query operation's executor. params is frozen. |
[in] | method_data | User data for this method, as passed as the method_data parameter of bt_query_executor_create_with_method_data() when creating this query operation's executor. |
[out] | result | On success, *result is a new reference of this query operation's result. |
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_OK | Success. |
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_UNKNOWN_OBJECT | object_name is unknown. |
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_AGAIN | Try again. |
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_MEMORY_ERROR | Out of memory. |
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_ERROR | User error. |
NULL
. NULL
. NULL
. NULL
. NULL
.typedef bt_component_class_query_method_status(* bt_component_class_filter_query_method) (bt_self_component_class_filter *self_component_class, bt_private_query_executor *query_executor, const char *object_name, const bt_value *params, void *method_data, const bt_value **result) |
Filter component class query method.
See the query method.
[in] | self_component_class | Filter component class, as passed as the component_class parameter of bt_query_executor_create() or bt_query_executor_create_with_method_data() when creating this query operation's executor. |
[in] | query_executor | Private view of this query operation's executor. |
[in] | object_name | Name of the object to query, as passed as the object_name parameter of bt_query_executor_create() or bt_query_executor_create_with_method_data() when creating this query operation's executor. |
[in] | params | Query parameters, as passed as the params parameter of bt_query_executor_create() or bt_query_executor_create_with_method_data() when creating this query operation's executor. params is frozen. |
[in] | method_data | User data for this method, as passed as the method_data parameter of bt_query_executor_create_with_method_data() when creating this query operation's executor. |
[out] | result | On success, *result is a new reference of this query operation's result. |
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_OK | Success. |
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_UNKNOWN_OBJECT | object_name is unknown. |
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_AGAIN | Try again. |
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_MEMORY_ERROR | Out of memory. |
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_ERROR | User error. |
NULL
. NULL
. NULL
. NULL
. NULL
.typedef bt_component_class_query_method_status(* bt_component_class_sink_query_method) (bt_self_component_class_sink *self_component_class, bt_private_query_executor *query_executor, const char *object_name, const bt_value *params, void *method_data, const bt_value **result) |
Sink component class query method.
See the query method.
[in] | self_component_class | Sink component class, as passed as the component_class parameter of bt_query_executor_create() or bt_query_executor_create_with_method_data() when creating this query operation's executor. |
[in] | query_executor | Private view of this query operation's executor. |
[in] | object_name | Name of the object to query, as passed as the object_name parameter of bt_query_executor_create() or bt_query_executor_create_with_method_data() when creating this query operation's executor. |
[in] | params | Query parameters, as passed as the params parameter of bt_query_executor_create() or bt_query_executor_create_with_method_data() when creating this query operation's executor. params is frozen. |
[in] | method_data | User data for this method, as passed as the method_data parameter of bt_query_executor_create_with_method_data() when creating this query operation's executor. |
[out] | result | On success, *result is a new reference of this query operation's result. |
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_OK | Success. |
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_UNKNOWN_OBJECT | object_name is unknown. |
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_AGAIN | Try again. |
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_MEMORY_ERROR | Out of memory. |
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_ERROR | User error. |
NULL
. NULL
. NULL
. NULL
. NULL
.Status codes for bt_component_class_sink_consume_method.
Status codes for bt_component_class_source_get_supported_mip_versions_method, bt_component_class_filter_get_supported_mip_versions_method, and bt_component_class_sink_get_supported_mip_versions_method.
Status codes for bt_component_class_sink_graph_is_configured_method.
Status codes for bt_component_class_source_initialize_method, bt_component_class_filter_initialize_method, and bt_component_class_sink_initialize_method.
Enumerator | |
---|---|
BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK | Success. |
BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR | Out of memory. |
BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR | User error. |
Status codes for bt_component_class_source_output_port_connected_method, bt_component_class_filter_input_port_connected_method, bt_component_class_filter_output_port_connected_method, and bt_component_class_sink_input_port_connected_method.
Status codes for bt_component_class_source_query_method, bt_component_class_filter_query_method, and bt_component_class_sink_query_method.
Status codes for bt_component_class_set_description().
Enumerator | |
---|---|
BT_COMPONENT_CLASS_SET_DESCRIPTION_STATUS_OK | Success. |
BT_COMPONENT_CLASS_SET_DESCRIPTION_STATUS_MEMORY_ERROR | Out of memory. |
Status codes for bt_component_class_set_help().
Enumerator | |
---|---|
BT_COMPONENT_CLASS_SET_HELP_STATUS_OK | Success. |
BT_COMPONENT_CLASS_SET_HELP_STATUS_MEMORY_ERROR | Out of memory. |
bt_component_class_source* bt_component_class_source_create | ( | const char * | name, |
bt_message_iterator_class * | message_iterator_class | ||
) |
Creates a source component class named name and having the message iterator class message_iterator_class.
On success, the returned source component class has the following property values:
Property | Value |
---|---|
Name | name |
Description | None |
Help text | None |
[in] | name | Name of the source component class to create (copied). |
[in] | message_iterator_class | Message iterator class of the source component class to create. |
NULL
on memory error.NULL
. NULL
.bt_component_class_filter* bt_component_class_filter_create | ( | const char * | name, |
bt_message_iterator_class * | message_iterator_class | ||
) |
Creates a filter component class named name and having the message iterator class message_iterator_class.
On success, the returned filter component class has the following property values:
Property | Value |
---|---|
Name | name |
Description | None |
Help text | None |
[in] | name | Name of the filter component class to create (copied). |
[in] | message_iterator_class | Message iterator class of the filter component class to create. |
NULL
on memory error.NULL
. NULL
.bt_component_class_sink* bt_component_class_sink_create | ( | const char * | name, |
bt_component_class_sink_consume_method | consume_method | ||
) |
Creates a sink component class named name and having the consuming method consume_method.
On success, the returned sink component class has the following property values:
Property | Value |
---|---|
Name | name |
Description | None |
Help text | None |
[in] | name | Name of the sink component class to create (copied). |
[in] | consume_method | Consuming method of the sink component class to create. |
NULL
on memory error.NULL
. NULL
. bt_component_class_set_description_status bt_component_class_set_description | ( | bt_component_class * | component_class, |
const char * | description | ||
) |
Sets the description of the component class component_class to a copy of description.
See the description property.
[in] | component_class | Component class of which to set the description to description. |
[in] | description | New description of component_class (copied). |
BT_COMPONENT_CLASS_SET_DESCRIPTION_STATUS_OK | Success. |
BT_COMPONENT_CLASS_SET_DESCRIPTION_STATUS_MEMORY_ERROR | Out of memory. |
NULL
. NULL
.bt_component_class_set_help_status bt_component_class_set_help | ( | bt_component_class * | component_class, |
const char * | help_text | ||
) |
Sets the help text of the component class component_class to a copy of help_text.
See the help text property.
[in] | component_class | Component class of which to set the help text to help_text. |
[in] | help_text | New help text of component_class (copied). |
BT_COMPONENT_CLASS_SET_HELP_STATUS_OK | Success. |
BT_COMPONENT_CLASS_SET_HELP_STATUS_MEMORY_ERROR | Out of memory. |
NULL
. NULL
.bt_component_class_set_method_status bt_component_class_source_set_finalize_method | ( | bt_component_class_source * | component_class, |
bt_component_class_source_finalize_method | method | ||
) |
Sets the optional finalization method of the source component class component_class to method.
See the finalize method.
[in] | component_class | Source component class of which to set the finalization method to method. |
[in] | method | New finalization method of component_class. |
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | Success. |
NULL
. NULL
. bt_component_class_set_method_status bt_component_class_filter_set_finalize_method | ( | bt_component_class_filter * | component_class, |
bt_component_class_filter_finalize_method | method | ||
) |
Sets the optional finalization method of the filter component class component_class to method.
See the finalize method.
[in] | component_class | Filter component class of which to set the finalization method to method. |
[in] | method | New finalization method of component_class. |
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | Success. |
NULL
. NULL
. bt_component_class_set_method_status bt_component_class_sink_set_finalize_method | ( | bt_component_class_sink * | component_class, |
bt_component_class_sink_finalize_method | method | ||
) |
Sets the optional finalization method of the sink component class component_class to method.
See the finalize method.
[in] | component_class | Sink component class of which to set the finalization method to method. |
[in] | method | New finalization method of component_class. |
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | Success. |
NULL
. NULL
. bt_component_class_set_method_status bt_component_class_source_set_get_supported_mip_versions_method | ( | bt_component_class_source * | component_class, |
bt_component_class_source_get_supported_mip_versions_method | method | ||
) |
Sets the "get supported Message Interchange Protocol versions" method of the source component class component_class to method.
See the get supported MIP versions method.
[in] | component_class | Source component class of which to set the "get supported MIP versions" method to method. |
[in] | method | New "get supported MIP versions" method of component_class. |
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | Success. |
NULL
. NULL
. bt_component_class_set_method_status bt_component_class_filter_set_get_supported_mip_versions_method | ( | bt_component_class_filter * | component_class, |
bt_component_class_filter_get_supported_mip_versions_method | method | ||
) |
Sets the "get supported Message Interchange Protocol versions" method of the filter component class component_class to method.
See the get supported MIP versions method.
[in] | component_class | Filter component class of which to set the "get supported MIP versions" method to method. |
[in] | method | New "get supported MIP versions" method of component_class. |
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | Success. |
NULL
. NULL
. bt_component_class_set_method_status bt_component_class_sink_set_get_supported_mip_versions_method | ( | bt_component_class_sink * | component_class, |
bt_component_class_sink_get_supported_mip_versions_method | method | ||
) |
Sets the "get supported Message Interchange Protocol versions" method of the sink component class component_class to method.
See the get supported MIP versions method.
[in] | component_class | Sink component class of which to set the "get supported MIP versions" method to method. |
[in] | method | New "get supported MIP versions" method of component_class. |
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | Success. |
NULL
. NULL
. bt_component_class_set_method_status bt_component_class_sink_set_graph_is_configured_method | ( | bt_component_class_sink * | component_class, |
bt_component_class_sink_graph_is_configured_method | method | ||
) |
Sets the "graph is configured" method of the sink component class component_class to method.
See the graph is configured method.
[in] | component_class | Sink component class of which to set the "graph is configured" method to method. |
[in] | method | New "graph is configured" method of component_class. |
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | Success. |
NULL
. NULL
. bt_component_class_set_method_status bt_component_class_source_set_initialize_method | ( | bt_component_class_source * | component_class, |
bt_component_class_source_initialize_method | method | ||
) |
Sets the optional initialization method of the source component class component_class to method.
See the initialize method.
[in] | component_class | Source component class of which to set the initialization method to method. |
[in] | method | New initialization method of component_class. |
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | Success. |
NULL
. NULL
. bt_component_class_set_method_status bt_component_class_filter_set_initialize_method | ( | bt_component_class_filter * | component_class, |
bt_component_class_filter_initialize_method | method | ||
) |
Sets the optional initialization method of the filter component class component_class to method.
See the initialize method.
[in] | component_class | Filter component class of which to set the initialization method to method. |
[in] | method | New initialization method of component_class. |
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | Success. |
NULL
. NULL
. bt_component_class_set_method_status bt_component_class_sink_set_initialize_method | ( | bt_component_class_sink * | component_class, |
bt_component_class_sink_initialize_method | method | ||
) |
Sets the optional initialization method of the sink component class component_class to method.
See the initialize method.
[in] | component_class | Sink component class of which to set the initialization method to method. |
[in] | method | New initialization method of component_class. |
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | Success. |
NULL
. NULL
. bt_component_class_set_method_status bt_component_class_source_set_output_port_connected_method | ( | bt_component_class_source * | component_class, |
bt_component_class_source_output_port_connected_method | method | ||
) |
Sets the optional "output port connected" method of the source component class component_class to method.
See the output port connected method.
[in] | component_class | Source component class of which to set the "output port connected" method to method. |
[in] | method | New "output port connected" method of component_class. |
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | Success. |
NULL
. NULL
. bt_component_class_set_method_status bt_component_class_filter_set_input_port_connected_method | ( | bt_component_class_filter * | component_class, |
bt_component_class_filter_input_port_connected_method | method | ||
) |
Sets the optional "input port connected" method of the filter component class component_class to method.
See the input port connected method.
[in] | component_class | Filter component class of which to set the "input port connected" method to method. |
[in] | method | New "input port connected" method of component_class. |
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | Success. |
NULL
. NULL
. bt_component_class_set_method_status bt_component_class_filter_set_output_port_connected_method | ( | bt_component_class_filter * | component_class, |
bt_component_class_filter_output_port_connected_method | method | ||
) |
Sets the optional "output port connected" method of the filter component class component_class to method.
See the output port connected method.
[in] | component_class | Filter component class of which to set the "output port connected" method to method. |
[in] | method | New "output port connected" method of component_class. |
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | Success. |
NULL
. NULL
. bt_component_class_set_method_status bt_component_class_sink_set_input_port_connected_method | ( | bt_component_class_sink * | component_class, |
bt_component_class_sink_input_port_connected_method | method | ||
) |
Sets the optional "input port connected" method of the sink component class component_class to method.
See the input port connected method.
[in] | component_class | Sink component class of which to set the "input port connected" method to method. |
[in] | method | New "input port connected" method of component_class. |
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | Success. |
NULL
. NULL
. bt_component_class_set_method_status bt_component_class_source_set_query_method | ( | bt_component_class_source * | component_class, |
bt_component_class_source_query_method | method | ||
) |
Sets the optional query method of the source component class component_class to method.
See the query method.
[in] | component_class | Source component class of which to set the query method to method. |
[in] | method | New query method of component_class. |
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | Success. |
NULL
. NULL
. bt_component_class_set_method_status bt_component_class_filter_set_query_method | ( | bt_component_class_filter * | component_class, |
bt_component_class_filter_query_method | method | ||
) |
Sets the optional query method of the filter component class component_class to method.
See the query method.
[in] | component_class | Filter component class of which to set the query method to method. |
[in] | method | New query method of component_class. |
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | Success. |
NULL
. NULL
. bt_component_class_set_method_status bt_component_class_sink_set_query_method | ( | bt_component_class_sink * | component_class, |
bt_component_class_sink_query_method | method | ||
) |
Sets the optional query method of the sink component class component_class to method.
See the query method.
[in] | component_class | Sink component class of which to set the query method to method. |
[in] | method | New query method of component_class. |
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | Success. |
NULL
. NULL
.
|
inlinestatic |
Upcasts the source component class component_class to the common bt_component_class type.
[in] | component_class | Source component class to upcast. Can be |
|
inlinestatic |
Upcasts the filter component class component_class to the common bt_component_class type.
[in] | component_class | Filter component class to upcast. Can be |
|
inlinestatic |
Upcasts the sink component class component_class to the common bt_component_class type.
[in] | component_class | Sink component class to upcast. Can be |