* SOFTWARE.
*/
+#include <babeltrace/component/component-class.h>
#include <babeltrace/component/notification/iterator.h>
#include <babeltrace/values.h>
#include <stdio.h>
extern "C" {
#endif
+struct bt_component_class;
+struct bt_component_graph;
+struct bt_component;
+struct bt_value;
+struct bt_port;
+
/**
* Status code. Errors are always negative.
*/
enum bt_component_status {
/** No error, okay. */
- BT_COMPONENT_STATUS_OK = 0,
+ BT_COMPONENT_STATUS_OK = 0,
/** No more work to be done by this component. **/
- BT_COMPONENT_STATUS_END = 1,
+ BT_COMPONENT_STATUS_END = 1,
/**
* Component can't process a notification at this time
* (e.g. would block), try again later.
*/
- BT_COMPONENT_STATUS_AGAIN = 2,
+ BT_COMPONENT_STATUS_AGAIN = 2,
+ /** Refuse port connection. */
+ BT_COMPONENT_STATUS_REFUSE_PORT_CONNECTION = 3,
/** General error. */
- BT_COMPONENT_STATUS_ERROR = -1,
+ BT_COMPONENT_STATUS_ERROR = -1,
/** Unsupported component feature. */
- BT_COMPONENT_STATUS_UNSUPPORTED = -2,
+ BT_COMPONENT_STATUS_UNSUPPORTED = -2,
/** Invalid arguments. */
- BT_COMPONENT_STATUS_INVALID = -3,
+ BT_COMPONENT_STATUS_INVALID = -3,
/** Memory allocation failure. */
- BT_COMPONENT_STATUS_NOMEM = -4,
+ BT_COMPONENT_STATUS_NOMEM = -4,
+ /** Element not found. */
+ BT_COMPONENT_STATUS_NOT_FOUND = -5,
};
-struct bt_component_class;
-struct bt_component;
-struct bt_value;
-
/**
* Create an instance of a component from a component class.
*
struct bt_component_class *component_class, const char *name,
struct bt_value *params);
-/**
- * Get a component's private data.
- *
- * @param component Component of which to get the private data
- * @returns Component's private data
- */
-extern void *bt_component_get_private_data(struct bt_component *component);
-
-/**
- * Set a component's private data.
- *
- * @param component Component of which to set the private data
- * @param data Component private data
- * @returns One of #bt_component_status values
- */
-extern enum bt_component_status bt_component_set_private_data(
- struct bt_component *component, void *data);
+extern struct bt_component *bt_component_create_with_init_method_data(
+ struct bt_component_class *component_class, const char *name,
+ struct bt_value *params, void *init_method_data);
/**
* Get component's name.
extern enum bt_component_class_type bt_component_get_class_type(
struct bt_component *component);
+extern struct bt_graph *bt_component_get_graph(struct bt_component *component);
+
#ifdef __cplusplus
}
#endif