Babeltrace 2 C API  2.0.3
Open-source trace manipulation framework
self-component.h
1 #ifndef BABELTRACE2_GRAPH_SELF_COMPONENT_H
2 #define BABELTRACE2_GRAPH_SELF_COMPONENT_H
3 
4 /*
5  * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining a copy
8  * of this software and associated documentation files (the "Software"), to deal
9  * in the Software without restriction, including without limitation the rights
10  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11  * copies of the Software, and to permit persons to whom the Software is
12  * furnished to do so, subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice shall be included in
15  * all copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23  * SOFTWARE.
24  */
25 
26 #ifndef __BT_IN_BABELTRACE_H
27 # error "Please include <babeltrace2/babeltrace.h> instead."
28 #endif
29 
30 #include <babeltrace2/types.h>
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
147 
152  BT_SELF_COMPONENT_ADD_PORT_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
153 
158  BT_SELF_COMPONENT_ADD_PORT_STATUS_ERROR = __BT_FUNC_STATUS_ERROR,
160 
201  bt_self_component_source *self_component,
202  const char *name, void *user_data,
203  bt_self_component_port_output **self_component_port);
204 
245  bt_self_component_filter *self_component,
246  const char *name, void *user_data,
247  bt_self_component_port_input **self_component_port);
248 
289  bt_self_component_filter *self_component,
290  const char *name, void *user_data,
291  bt_self_component_port_output **self_component_port);
292 
334  bt_self_component_sink *self_component,
335  const char *name, void *user_data,
336  bt_self_component_port_input **self_component_port);
337 
375  bt_self_component_source *self_component,
376  uint64_t index);
377 
408  bt_self_component_filter *self_component,
409  uint64_t index);
410 
441  bt_self_component_filter *self_component,
442  uint64_t index);
443 
474  bt_self_component_sink *self_component, uint64_t index);
475 
503  bt_self_component_source *self_component,
504  const char *name);
505 
533  bt_self_component_filter *self_component,
534  const char *name);
535 
563  bt_self_component_filter *self_component,
564  const char *name);
565 
593  bt_self_component_sink *self_component,
594  const char *name);
595 
618 extern void bt_self_component_set_data(
619  bt_self_component *self_component, void *user_data);
620 
636 extern void *bt_self_component_get_data(
637  const bt_self_component *self_component);
638 
664 extern
666  bt_self_component *self_component);
667 
696  const bt_self_component_sink *self_component);
697 
720 static inline
722  bt_self_component *self_component)
723 {
724  return __BT_UPCAST(bt_component, self_component);
725 }
726 
743 static inline
744 const bt_component_source *
746  bt_self_component_source *self_component)
747 {
748  return __BT_UPCAST_CONST(bt_component_source, self_component);
749 }
750 
767 static inline
768 const bt_component_filter *
770  bt_self_component_filter *self_component)
771 {
772  return __BT_UPCAST_CONST(bt_component_filter, self_component);
773 }
774 
791 static inline
792 const bt_component_sink *
794  bt_self_component_sink *self_component)
795 {
796  return __BT_UPCAST_CONST(bt_component_sink, self_component);
797 }
798 
822 static inline
824  bt_self_component_source *self_component)
825 {
826  return __BT_UPCAST(bt_self_component, self_component);
827 }
828 
845 static inline
847  bt_self_component_filter *self_component)
848 {
849  return __BT_UPCAST(bt_self_component, self_component);
850 }
851 
868 static inline
870  bt_self_component_sink *self_component)
871 {
872  return __BT_UPCAST(bt_self_component, self_component);
873 }
874 
879 #ifdef __cplusplus
880 }
881 #endif
882 
883 #endif /* BABELTRACE2_GRAPH_SELF_COMPONENT_H */
bt_self_component_port_output * bt_self_component_filter_borrow_output_port_by_index(bt_self_component_filter *self_component, uint64_t index)
Borrows the self component output port at index index from the filter component self_component.
bt_self_component_add_port_status bt_self_component_source_add_output_port(bt_self_component_source *self_component, const char *name, void *user_data, bt_self_component_port_output **self_component_port)
Adds an output port named name and having the user data user_data to the source component self_compon...
static const bt_component_source * bt_self_component_source_as_component_source(bt_self_component_source *self_component)
Upcasts the self source component self_component to the public bt_component_source type...
Definition: self-component.h:745
struct bt_self_component_filter bt_self_component_filter
Self filter component.
Definition: types.h:90
struct bt_component_sink bt_component_sink
Sink component.
Definition: types.h:45
bt_self_component_add_port_status bt_self_component_filter_add_input_port(bt_self_component_filter *self_component, const char *name, void *user_data, bt_self_component_port_input **self_component_port)
Adds an input port named name and having the user data user_data to the filter component self_compone...
struct bt_component_source bt_component_source
Source component.
Definition: types.h:46
struct bt_self_component bt_self_component
Self component.
Definition: types.h:85
Success.
Definition: self-component.h:146
Out of memory.
Definition: self-component.h:152
bt_self_component_port_output * bt_self_component_filter_borrow_output_port_by_name(bt_self_component_filter *self_component, const char *name)
Borrows the self component output port named name from the filter component self_component.
static const bt_component_filter * bt_self_component_filter_as_component_filter(bt_self_component_filter *self_component)
Upcasts the self filter component self_component to the public bt_component_filter type...
Definition: self-component.h:769
bt_self_component_port_input * bt_self_component_filter_borrow_input_port_by_name(bt_self_component_filter *self_component, const char *name)
Borrows the self component input port named name from the filter component self_component.
struct bt_component_filter bt_component_filter
Filter component.
Definition: types.h:44
struct bt_self_component_sink bt_self_component_sink
Self sink component.
Definition: types.h:96
bt_bool bt_self_component_sink_is_interrupted(const bt_self_component_sink *self_component)
Returns whether or not the sink component self_component is interrupted, that is, whether or not any ...
bt_self_component_port_input * bt_self_component_sink_borrow_input_port_by_index(bt_self_component_sink *self_component, uint64_t index)
Borrows the self component input port at index index from the sink component self_component.
struct bt_self_component_port_input bt_self_component_port_input
Self component input port.
Definition: types.h:93
bt_self_component_port_input * bt_self_component_filter_borrow_input_port_by_index(bt_self_component_filter *self_component, uint64_t index)
Borrows the self component input port at index index from the filter component self_component.
struct bt_component bt_component
Component.
Definition: types.h:38
bt_self_component_port_output * bt_self_component_source_borrow_output_port_by_index(bt_self_component_source *self_component, uint64_t index)
Borrows the self component output port at index index from the source component self_component.
int bt_bool
Babeltrace 2 boolean type.
Definition: types.h:140
void * bt_self_component_get_data(const bt_self_component *self_component)
Returns the user data of the component self_component.
static bt_self_component * bt_self_component_filter_as_self_component(bt_self_component_filter *self_component)
Upcasts the self filter component self_component to the common bt_self_component type.
Definition: self-component.h:846
uint64_t bt_self_component_get_graph_mip_version(bt_self_component *self_component)
Returns the effective Message Interchange Protocol (MIP) version of the trace processing graph which ...
static const bt_component_sink * bt_self_component_sink_as_component_sink(bt_self_component_sink *self_component)
Upcasts the self sink component self_component to the public bt_component_sink type.
Definition: self-component.h:793
struct bt_self_component_source bt_self_component_source
Self source component.
Definition: types.h:98
Other error.
Definition: self-component.h:158
bt_self_component_add_port_status bt_self_component_sink_add_input_port(bt_self_component_sink *self_component, const char *name, void *user_data, bt_self_component_port_input **self_component_port)
Adds an input port named name and having the user data user_data to the sink component self_component...
bt_self_component_port_output * bt_self_component_source_borrow_output_port_by_name(bt_self_component_source *self_component, const char *name)
Borrows the self component output port named name from the source component self_component.
bt_self_component_add_port_status
Status codes for bt_self_component_source_add_output_port(), bt_self_component_filter_add_input_port(...
Definition: self-component.h:141
static bt_self_component * bt_self_component_source_as_self_component(bt_self_component_source *self_component)
Upcasts the self source component self_component to the common bt_self_component type.
Definition: self-component.h:823
void bt_self_component_set_data(bt_self_component *self_component, void *user_data)
Sets the user data of the component self_component to data.
static bt_self_component * bt_self_component_sink_as_self_component(bt_self_component_sink *self_component)
Upcasts the self sink component self_component to the common bt_self_component type.
Definition: self-component.h:869
bt_self_component_port_input * bt_self_component_sink_borrow_input_port_by_name(bt_self_component_sink *self_component, const char *name)
Borrows the self component input port named name from the sink component self_component.
static const bt_component * bt_self_component_as_component(bt_self_component *self_component)
Upcasts the self component self_component to the public bt_component type.
Definition: self-component.h:721
struct bt_self_component_port_output bt_self_component_port_output
Self component output port.
Definition: types.h:95
bt_self_component_add_port_status bt_self_component_filter_add_output_port(bt_self_component_filter *self_component, const char *name, void *user_data, bt_self_component_port_output **self_component_port)
Adds an output port named name and having the user data user_data to the filter component self_compon...