Babeltrace 2 C API  2.0.0
Open-source trace manipulation framework
Modules
Component class development

Detailed Description

Component class development (creation).

A component class is the class of a component:

Attention
This module (component class development API) offers functions to programatically create component classes. To get the properties of an existing component class, see Component classes.

A component class has methods. This module essentially offers:

A component class method is a user function. There are two types of methods:

Instance method

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.

Class method

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().

Methods

To learn when exactly the methods below are called, see Trace processing graph life cycle.

The available component class methods to implement are:

Name Method type Component class types Requirement Graph is configured? C types
Consume Instance Sink Mandatory Yes bt_component_class_sink_consume_method
Finalize Instance All Optional Yes bt_component_class_source_finalize_method
bt_component_class_filter_finalize_method
bt_component_class_sink_finalize_method
Get supported Message Interchange Protocol (MIP) versions Class All Optional N/A bt_component_class_source_get_supported_mip_versions_method
bt_component_class_filter_get_supported_mip_versions_method
bt_component_class_sink_get_supported_mip_versions_method
Graph is configured Instance Sink Mandatory Yes bt_component_class_sink_graph_is_configured_method
Initialize Instance All Optional No bt_component_class_source_initialize_method
bt_component_class_filter_initialize_method
bt_component_class_sink_initialize_method
Input port connected Instance Filter and sink Optional No bt_component_class_filter_input_port_connected_method
bt_component_class_sink_input_port_connected_method
Output port connected Instance Source and filter Optional No bt_component_class_source_output_port_connected_method
bt_component_class_filter_output_port_connected_method
Query Class All Optional N/A bt_component_class_source_query_method
bt_component_class_filter_query_method
bt_component_class_sink_query_method
Consume

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().

Finalize

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().

Get supported Message Interchange Protocol (MIP) versions

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().

Graph is configured

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().

Initialize

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().

Input port connected

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().

Output port connected

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().

Query

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().

Attention

In any of the methods above:

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.
 

Method types

enum  bt_component_class_sink_consume_method_status {
  BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_OK,
  BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_END,
  BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_AGAIN,
  BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_MEMORY_ERROR,
  BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_ERROR
}
 Status codes for bt_component_class_sink_consume_method. More...
 
enum  bt_component_class_get_supported_mip_versions_method_status {
  BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_OK,
  BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_MEMORY_ERROR,
  BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_ERROR
}
 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. More...
 
enum  bt_component_class_sink_graph_is_configured_method_status {
  BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_OK,
  BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_MEMORY_ERROR,
  BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_ERROR
}
 Status codes for bt_component_class_sink_graph_is_configured_method. More...
 
enum  bt_component_class_initialize_method_status {
  BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK,
  BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR,
  BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR
}
 Status codes for bt_component_class_source_initialize_method, bt_component_class_filter_initialize_method, and bt_component_class_sink_initialize_method. More...
 
enum  bt_component_class_port_connected_method_status {
  BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK,
  BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROR,
  BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_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. More...
 
enum  bt_component_class_query_method_status {
  BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_OK,
  BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_UNKNOWN_OBJECT,
  BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_AGAIN,
  BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_MEMORY_ERROR,
  BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_ERROR
}
 Status codes for bt_component_class_source_query_method, bt_component_class_filter_query_method, and bt_component_class_sink_query_method. More...
 
typedef enum bt_component_class_sink_consume_method_status bt_component_class_sink_consume_method_status
 Status codes for bt_component_class_sink_consume_method.
 
typedef bt_component_class_sink_consume_method_status(* bt_component_class_sink_consume_method) (bt_self_component_sink *self_component)
 Sink component consuming method. More...
 
typedef void(* bt_component_class_source_finalize_method) (bt_self_component_source *self_component)
 Source component finalization method. More...
 
typedef void(* bt_component_class_filter_finalize_method) (bt_self_component_filter *self_component)
 Filter component finalization method. More...
 
typedef void(* bt_component_class_sink_finalize_method) (bt_self_component_sink *self_component)
 Sink component finalization method. More...
 
typedef enum bt_component_class_get_supported_mip_versions_method_status bt_component_class_get_supported_mip_versions_method_status
 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.
 
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. More...
 
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. More...
 
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. More...
 
typedef enum bt_component_class_sink_graph_is_configured_method_status bt_component_class_sink_graph_is_configured_method_status
 Status codes for bt_component_class_sink_graph_is_configured_method.
 
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. More...
 
typedef enum bt_component_class_initialize_method_status bt_component_class_initialize_method_status
 Status codes for bt_component_class_source_initialize_method, bt_component_class_filter_initialize_method, and bt_component_class_sink_initialize_method.
 
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. More...
 
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. More...
 
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. More...
 
typedef enum bt_component_class_port_connected_method_status bt_component_class_port_connected_method_status
 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.
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
typedef enum bt_component_class_query_method_status bt_component_class_query_method_status
 Status codes for bt_component_class_source_query_method, bt_component_class_filter_query_method, and bt_component_class_sink_query_method.
 
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. More...
 
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. More...
 
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. More...
 

Creation

bt_component_class_sourcebt_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_filterbt_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_sinkbt_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...
 

Common properties

enum  bt_component_class_set_description_status {
  BT_COMPONENT_CLASS_SET_DESCRIPTION_STATUS_OK,
  BT_COMPONENT_CLASS_SET_DESCRIPTION_STATUS_MEMORY_ERROR
}
 Status codes for bt_component_class_set_description(). More...
 
enum  bt_component_class_set_help_status {
  BT_COMPONENT_CLASS_SET_HELP_STATUS_OK,
  BT_COMPONENT_CLASS_SET_HELP_STATUS_MEMORY_ERROR
}
 Status codes for bt_component_class_set_help(). More...
 
typedef enum bt_component_class_set_description_status bt_component_class_set_description_status
 Status codes for bt_component_class_set_description().
 
typedef enum bt_component_class_set_help_status bt_component_class_set_help_status
 Status codes for bt_component_class_set_help().
 
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. More...
 
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. More...
 

Method setting

enum  bt_component_class_set_method_status { BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK }
 Status code for the bt_component_class_*_set_*_method() functions. More...
 
typedef enum bt_component_class_set_method_status bt_component_class_set_method_status
 Status code for the bt_component_class_*_set_*_method() functions.
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

Upcast

static bt_component_classbt_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_classbt_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_classbt_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 Documentation

◆ bt_component_class_sink_consume_method

typedef bt_component_class_sink_consume_method_status(* bt_component_class_sink_consume_method) (bt_self_component_sink *self_component)

◆ bt_component_class_source_finalize_method

typedef void(* bt_component_class_source_finalize_method) (bt_self_component_source *self_component)

Source component finalization method.

See the finalize method.

Parameters
[in]self_componentSource component instance.
Precondition
self_component is not NULL.
Postcondition
The current thread has no error.
See also
bt_component_class_source_set_finalize_method() — Sets the finalization method of a source component class.

◆ bt_component_class_filter_finalize_method

typedef void(* bt_component_class_filter_finalize_method) (bt_self_component_filter *self_component)

Filter component finalization method.

See the finalize method.

Parameters
[in]self_componentFilter component instance.
Precondition
self_component is not NULL.
Postcondition
The current thread has no error.
See also
bt_component_class_filter_set_finalize_method() — Sets the finalization method of a filter component class.

◆ bt_component_class_sink_finalize_method

typedef void(* bt_component_class_sink_finalize_method) (bt_self_component_sink *self_component)

Sink component finalization method.

See the finalize method.

Parameters
[in]self_componentSink component instance.
Precondition
self_component is not NULL.
Postcondition
The current thread has no error.
See also
bt_component_class_sink_set_finalize_method() — Sets the finalization method of a sink component class.

◆ bt_component_class_source_get_supported_mip_versions_method

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.

Parameters
[in]self_component_classSource 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_dataUser 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_levelLogging level to use during this method's execution, as passed as the logging_level parameter of bt_get_greatest_operative_mip_version().
[in]supported_versionsUnsigned 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.
Return values
BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_OKSuccess.
BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_MEMORY_ERROROut of memory.
BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_ERRORUser error.
Precondition
self_component_class is not NULL.
params is not NULL.
params is a map value (bt_value_is_map() returns BT_TRUE).
supported_versions is not NULL.
supported_versions is empty.
See also
bt_component_class_source_set_get_supported_mip_versions_method() — Sets the "get supported MIP versions" method of a source component class.

◆ bt_component_class_filter_get_supported_mip_versions_method

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.

Parameters
[in]self_component_classFilter 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_dataUser 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_levelLogging level to use during this method's execution, as passed as the logging_level parameter of bt_get_greatest_operative_mip_version().
[in]supported_versionsUnsigned 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.
Return values
BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_OKSuccess.
BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_MEMORY_ERROROut of memory.
BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_ERRORUser error.
Precondition
self_component_class is not NULL.
params is not NULL.
params is a map value (bt_value_is_map() returns BT_TRUE).
supported_versions is not NULL.
supported_versions is empty.
See also
bt_component_class_filter_set_get_supported_mip_versions_method() — Sets the "get supported MIP versions" method of a filter component class.

◆ bt_component_class_sink_get_supported_mip_versions_method

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.

Parameters
[in]self_component_classSink 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_dataUser 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_levelLogging level to use during this method's execution, as passed as the logging_level parameter of bt_get_greatest_operative_mip_version().
[in]supported_versionsUnsigned 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.
Return values
BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_OKSuccess.
BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_MEMORY_ERROROut of memory.
BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_ERRORUser error.
Precondition
self_component_class is not NULL.
params is not NULL.
params is a map value (bt_value_is_map() returns BT_TRUE).
supported_versions is not NULL.
supported_versions is empty.
See also
bt_component_class_sink_set_get_supported_mip_versions_method() — Sets the "get supported MIP versions" method of a sink component class.

◆ bt_component_class_sink_graph_is_configured_method

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.

Parameters
[in]self_componentSink component instance.
Return values
BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_OKSuccess.
BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_MEMORY_ERROROut of memory.
BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_ERRORUser error.
Precondition
self_component is not NULL.
See also
bt_component_class_sink_set_graph_is_configured_method() — Sets the "graph is configured" method of a sink component class.

◆ bt_component_class_source_initialize_method

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.

Parameters
[in]self_componentSource component instance.
[in]configurationInitial 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_dataUser data for this method, as passed as the initialize_method_data parameter of bt_graph_add_source_component_with_initialize_method_data().
Return values
BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OKSuccess.
BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROROut of memory.
BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERRORUser error.
Precondition
self_component is not NULL.
configuration is not NULL.
params is not NULL.
params is a map value (bt_value_is_map() returns BT_TRUE).
See also
bt_component_class_source_set_initialize_method() — Sets the initialization method of a source component class.

◆ bt_component_class_filter_initialize_method

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.

Parameters
[in]self_componentFilter component instance.
[in]configurationInitial 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_dataUser data for this method, as passed as the initialize_method_data parameter of bt_graph_add_filter_component_with_initialize_method_data().
Return values
BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OKSuccess.
BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROROut of memory.
BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERRORUser error.
Precondition
self_component is not NULL.
configuration is not NULL.
params is not NULL.
params is a map value (bt_value_is_map() returns BT_TRUE).
See also
bt_component_class_filter_set_initialize_method() — Sets the initialization method of a filter component class.

◆ bt_component_class_sink_initialize_method

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.

Parameters
[in]self_componentSink component instance.
[in]configurationInitial 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_dataUser data for this method, as passed as the initialize_method_data parameter of bt_graph_add_sink_component_with_initialize_method_data().
Return values
BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OKSuccess.
BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROROut of memory.
BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERRORUser error.
Precondition
self_component is not NULL.
configuration is not NULL.
params is not NULL.
params is a map value (bt_value_is_map() returns BT_TRUE).
See also
bt_component_class_sink_set_initialize_method() — Sets the initialization method of a sink component class.

◆ bt_component_class_source_output_port_connected_method

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.

Parameters
[in]self_componentSource component instance.
[in]self_portConnected output port of self_component.
[in]other_portConnection's other (input) port.
Return values
BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OKSuccess.
BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROROut of memory.
BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERRORUser error.
Precondition
self_component is not NULL.
self_port is not NULL.
other_port is not NULL.
See also
bt_component_class_source_set_output_port_connected_method() — Sets the "output port connected" method of a source component class.

◆ bt_component_class_filter_input_port_connected_method

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.

Parameters
[in]self_componentFilter component instance.
[in]self_portConnected input port of self_component.
[in]other_portConnection's other (output) port.
Return values
BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OKSuccess.
BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROROut of memory.
BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERRORUser error.
Precondition
self_component is not NULL.
self_port is not NULL.
other_port is not NULL.
See also
bt_component_class_filter_set_input_port_connected_method() — Sets the "input port connected" method of a filter component class.

◆ bt_component_class_filter_output_port_connected_method

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.

Parameters
[in]self_componentFilter component instance.
[in]self_portConnected output port of self_component.
[in]other_portConnection's other (input) port.
Return values
BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OKSuccess.
BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROROut of memory.
BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERRORUser error.
Precondition
self_component is not NULL.
self_port is not NULL.
other_port is not NULL.
See also
bt_component_class_filter_set_output_port_connected_method() — Sets the "output port connected" method of a filter component class.

◆ bt_component_class_sink_input_port_connected_method

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.

Parameters
[in]self_componentSink component instance.
[in]self_portConnected input port of self_component.
[in]other_portConnection's other (output) port.
Return values
BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OKSuccess.
BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROROut of memory.
BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERRORUser error.
Precondition
self_component is not NULL.
self_port is not NULL.
other_port is not NULL.
See also
bt_component_class_sink_set_input_port_connected_method() — Sets the "input port connected" method of a sink component class.

◆ bt_component_class_source_query_method

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.

Parameters
[in]self_component_classSource 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_executorPrivate view of this query operation's executor.
[in]object_nameName 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_dataUser 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]resultOn success, *result is a new reference of this query operation's result.
Return values
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_OKSuccess.
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_UNKNOWN_OBJECTobject_name is unknown.
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_AGAINTry again.
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_MEMORY_ERROROut of memory.
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_ERRORUser error.
Precondition
self_component_class is not NULL.
query_executor is not NULL.
object_name is not NULL.
params is not NULL.
result is not NULL.
Postcondition
On success, *result is set.
See also
bt_component_class_source_set_query_method() — Sets the query method of a source component class.

◆ bt_component_class_filter_query_method

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.

Parameters
[in]self_component_classFilter 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_executorPrivate view of this query operation's executor.
[in]object_nameName 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_dataUser 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]resultOn success, *result is a new reference of this query operation's result.
Return values
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_OKSuccess.
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_UNKNOWN_OBJECTobject_name is unknown.
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_AGAINTry again.
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_MEMORY_ERROROut of memory.
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_ERRORUser error.
Precondition
self_component_class is not NULL.
query_executor is not NULL.
object_name is not NULL.
params is not NULL.
result is not NULL.
Postcondition
On success, *result is set.
See also
bt_component_class_filter_set_query_method() — Sets the query method of a filter component class.

◆ bt_component_class_sink_query_method

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.

Parameters
[in]self_component_classSink 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_executorPrivate view of this query operation's executor.
[in]object_nameName 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_dataUser 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]resultOn success, *result is a new reference of this query operation's result.
Return values
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_OKSuccess.
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_UNKNOWN_OBJECTobject_name is unknown.
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_AGAINTry again.
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_MEMORY_ERROROut of memory.
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_ERRORUser error.
Precondition
self_component_class is not NULL.
query_executor is not NULL.
object_name is not NULL.
params is not NULL.
result is not NULL.
Postcondition
On success, *result is set.
See also
bt_component_class_sink_set_query_method() — Sets the query method of a sink component class.

Enumeration Type Documentation

◆ bt_component_class_sink_consume_method_status

Status codes for bt_component_class_sink_consume_method.

Enumerator
BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_OK 

Success.

BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_END 

Sink component is 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.

◆ bt_component_class_get_supported_mip_versions_method_status

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.

Enumerator
BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_OK 

Success.

BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_MEMORY_ERROR 

Out of memory.

BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_ERROR 

User error.

◆ bt_component_class_sink_graph_is_configured_method_status

Status codes for bt_component_class_sink_graph_is_configured_method.

Enumerator
BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_OK 

Success.

BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_MEMORY_ERROR 

Out of memory.

BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_ERROR 

User error.

◆ bt_component_class_initialize_method_status

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.

◆ bt_component_class_port_connected_method_status

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.

Enumerator
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.

◆ bt_component_class_query_method_status

Status codes for bt_component_class_source_query_method, bt_component_class_filter_query_method, and bt_component_class_sink_query_method.

Enumerator
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_OK 

Success.

BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_UNKNOWN_OBJECT 

Unknown object to query.

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.

◆ bt_component_class_set_description_status

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.

◆ bt_component_class_set_help_status

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_set_method_status

Status code for the bt_component_class_*_set_*_method() functions.

Enumerator
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK 

Success.

Function Documentation

◆ bt_component_class_source_create()

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
Parameters
[in]nameName of the source component class to create (copied).
[in]message_iterator_classMessage iterator class of the source component class to create.
Returns
New source component class reference, or NULL on memory error.
Precondition
name is not NULL.
message_iterator_class is not NULL.
Postcondition
On success, message_iterator_class is frozen.
See also
bt_message_iterator_class_create() — Creates a message iterator class.

◆ bt_component_class_filter_create()

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
Parameters
[in]nameName of the filter component class to create (copied).
[in]message_iterator_classMessage iterator class of the filter component class to create.
Returns
New filter component class reference, or NULL on memory error.
Precondition
name is not NULL.
message_iterator_class is not NULL.
Postcondition
On success, message_iterator_class is frozen.
See also
bt_message_iterator_class_create() — Creates a message iterator class.

◆ bt_component_class_sink_create()

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
Parameters
[in]nameName of the sink component class to create (copied).
[in]consume_methodConsuming method of the sink component class to create.
Returns
New sink component class reference, or NULL on memory error.
Precondition
name is not NULL.
consume_method is not NULL.

◆ bt_component_class_set_description()

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.

Parameters
[in]component_classComponent class of which to set the description to description.
[in]descriptionNew description of component_class (copied).
Return values
BT_COMPONENT_CLASS_SET_DESCRIPTION_STATUS_OKSuccess.
BT_COMPONENT_CLASS_SET_DESCRIPTION_STATUS_MEMORY_ERROROut of memory.
Precondition
component_class is not NULL.
component_class is not frozen.
description is not NULL.
See also
bt_component_class_get_description() — Returns the description of a component class.

◆ bt_component_class_set_help()

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.

Parameters
[in]component_classComponent class of which to set the help text to help_text.
[in]help_textNew help text of component_class (copied).
Return values
BT_COMPONENT_CLASS_SET_HELP_STATUS_OKSuccess.
BT_COMPONENT_CLASS_SET_HELP_STATUS_MEMORY_ERROROut of memory.
Precondition
component_class is not NULL.
component_class is not frozen.
help_text is not NULL.
See also
bt_component_class_get_help() — Returns the help text of a component class.

◆ bt_component_class_source_set_finalize_method()

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.

Parameters
[in]component_classSource component class of which to set the finalization method to method.
[in]methodNew finalization method of component_class.
Return values
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OKSuccess.
Precondition
component_class is not NULL.
component_class is not frozen.
method is not NULL.

◆ bt_component_class_filter_set_finalize_method()

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.

Parameters
[in]component_classFilter component class of which to set the finalization method to method.
[in]methodNew finalization method of component_class.
Return values
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OKSuccess.
Precondition
component_class is not NULL.
component_class is not frozen.
method is not NULL.

◆ bt_component_class_sink_set_finalize_method()

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.

Parameters
[in]component_classSink component class of which to set the finalization method to method.
[in]methodNew finalization method of component_class.
Return values
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OKSuccess.
Precondition
component_class is not NULL.
component_class is not frozen.
method is not NULL.

◆ bt_component_class_source_set_get_supported_mip_versions_method()

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.

Parameters
[in]component_classSource component class of which to set the "get supported MIP versions" method to method.
[in]methodNew "get supported MIP versions" method of component_class.
Return values
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OKSuccess.
Precondition
component_class is not NULL.
component_class is not frozen.
method is not NULL.

◆ bt_component_class_filter_set_get_supported_mip_versions_method()

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.

Parameters
[in]component_classFilter component class of which to set the "get supported MIP versions" method to method.
[in]methodNew "get supported MIP versions" method of component_class.
Return values
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OKSuccess.
Precondition
component_class is not NULL.
component_class is not frozen.
method is not NULL.

◆ bt_component_class_sink_set_get_supported_mip_versions_method()

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.

Parameters
[in]component_classSink component class of which to set the "get supported MIP versions" method to method.
[in]methodNew "get supported MIP versions" method of component_class.
Return values
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OKSuccess.
Precondition
component_class is not NULL.
component_class is not frozen.
method is not NULL.

◆ bt_component_class_sink_set_graph_is_configured_method()

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.

Parameters
[in]component_classSink component class of which to set the "graph is configured" method to method.
[in]methodNew "graph is configured" method of component_class.
Return values
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OKSuccess.
Precondition
component_class is not NULL.
component_class is not frozen.
method is not NULL.

◆ bt_component_class_source_set_initialize_method()

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.

Parameters
[in]component_classSource component class of which to set the initialization method to method.
[in]methodNew initialization method of component_class.
Return values
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OKSuccess.
Precondition
component_class is not NULL.
component_class is not frozen.
method is not NULL.

◆ bt_component_class_filter_set_initialize_method()

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.

Parameters
[in]component_classFilter component class of which to set the initialization method to method.
[in]methodNew initialization method of component_class.
Return values
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OKSuccess.
Precondition
component_class is not NULL.
component_class is not frozen.
method is not NULL.

◆ bt_component_class_sink_set_initialize_method()

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.

Parameters
[in]component_classSink component class of which to set the initialization method to method.
[in]methodNew initialization method of component_class.
Return values
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OKSuccess.
Precondition
component_class is not NULL.
component_class is not frozen.
method is not NULL.

◆ bt_component_class_source_set_output_port_connected_method()

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.

Parameters
[in]component_classSource component class of which to set the "output port connected" method to method.
[in]methodNew "output port connected" method of component_class.
Return values
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OKSuccess.
Precondition
component_class is not NULL.
component_class is not frozen.
method is not NULL.

◆ bt_component_class_filter_set_input_port_connected_method()

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.

Parameters
[in]component_classFilter component class of which to set the "input port connected" method to method.
[in]methodNew "input port connected" method of component_class.
Return values
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OKSuccess.
Precondition
component_class is not NULL.
component_class is not frozen.
method is not NULL.

◆ bt_component_class_filter_set_output_port_connected_method()

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.

Parameters
[in]component_classFilter component class of which to set the "output port connected" method to method.
[in]methodNew "output port connected" method of component_class.
Return values
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OKSuccess.
Precondition
component_class is not NULL.
component_class is not frozen.
method is not NULL.

◆ bt_component_class_sink_set_input_port_connected_method()

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.

Parameters
[in]component_classSink component class of which to set the "input port connected" method to method.
[in]methodNew "input port connected" method of component_class.
Return values
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OKSuccess.
Precondition
component_class is not NULL.
component_class is not frozen.
method is not NULL.

◆ bt_component_class_source_set_query_method()

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.

Parameters
[in]component_classSource component class of which to set the query method to method.
[in]methodNew query method of component_class.
Return values
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OKSuccess.
Precondition
component_class is not NULL.
component_class is not frozen.
method is not NULL.

◆ bt_component_class_filter_set_query_method()

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.

Parameters
[in]component_classFilter component class of which to set the query method to method.
[in]methodNew query method of component_class.
Return values
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OKSuccess.
Precondition
component_class is not NULL.
component_class is not frozen.
method is not NULL.

◆ bt_component_class_sink_set_query_method()

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.

Parameters
[in]component_classSink component class of which to set the query method to method.
[in]methodNew query method of component_class.
Return values
BT_COMPONENT_CLASS_SET_METHOD_STATUS_OKSuccess.
Precondition
component_class is not NULL.
component_class is not frozen.
method is not NULL.

◆ bt_component_class_source_as_component_class()

static bt_component_class* bt_component_class_source_as_component_class ( bt_component_class_source component_class)
inlinestatic

Upcasts the source component class component_class to the common bt_component_class type.

Parameters
[in]component_class

Source component class to upcast.

Can be NULL.

Returns
component_class as a common component class.

◆ bt_component_class_filter_as_component_class()

static bt_component_class* bt_component_class_filter_as_component_class ( bt_component_class_filter component_class)
inlinestatic

Upcasts the filter component class component_class to the common bt_component_class type.

Parameters
[in]component_class

Filter component class to upcast.

Can be NULL.

Returns
component_class as a common component class.

◆ bt_component_class_sink_as_component_class()

static bt_component_class* bt_component_class_sink_as_component_class ( bt_component_class_sink component_class)
inlinestatic

Upcasts the sink component class component_class to the common bt_component_class type.

Parameters
[in]component_class

Sink component class to upcast.

Can be NULL.

Returns
component_class as a common component class.