X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace%2Fgraph%2Fnotification-iterator.h;h=bcf6a659ab00120adbc9119d4101d2916c58d71e;hb=65300d60e4b4f167e5fc8f584677757ce09a3844;hp=35f68a8398d805950f5732b3d86fb32cd5366e9e;hpb=7cdc2bab17acd56d035b204518ef845fa5a9f1c7;p=babeltrace.git diff --git a/include/babeltrace/graph/notification-iterator.h b/include/babeltrace/graph/notification-iterator.h index 35f68a83..bcf6a659 100644 --- a/include/babeltrace/graph/notification-iterator.h +++ b/include/babeltrace/graph/notification-iterator.h @@ -2,7 +2,7 @@ #define BABELTRACE_GRAPH_NOTIFICATION_ITERATOR_H /* - * BabelTrace - Plug-in Notification Iterator + * BabelTrace - Notification Iterator * * Copyright 2015 Jérémie Galarneau * @@ -27,6 +27,9 @@ * SOFTWARE. */ +/* For bt_object_get_ref() */ +#include + #include #ifdef __cplusplus @@ -40,6 +43,8 @@ struct bt_notification_iterator; * Status code. Errors are always negative. */ enum bt_notification_iterator_status { + /** Canceled. */ + BT_NOTIFICATION_ITERATOR_STATUS_CANCELED = 125, /** No notifications available for now. Try again later. */ BT_NOTIFICATION_ITERATOR_STATUS_AGAIN = 11, /** No more notifications to be delivered. */ @@ -56,82 +61,6 @@ enum bt_notification_iterator_status { BT_NOTIFICATION_ITERATOR_STATUS_UNSUPPORTED = -2, }; -/** - * Notification iterator seek reference. - */ -enum bt_notification_iterator_seek_origin { - /** Seek at a time relative to the beginning of the trace. */ - BT_NOTIFICATION_ITERATOR_SEEK_ORIGIN_BEGIN = 0, - - /** Seek at a time relative to the current position. */ - BT_NOTIFICATION_ITERATOR_SEEK_ORIGIN_CURRENT = 1, - - /** Seek at a time relative to the end of the trace. */ - BT_NOTIFICATION_ITERATOR_SEEK_ORIGIN_END = 2, - - /** Seek at a time relative to EPOCH. */ - BT_NOTIFICATION_ITERATOR_SEEK_ORIGIN_EPOCH = 3, -}; - -struct bt_notification_iterator_next_return { - struct bt_notification *notification; - enum bt_notification_iterator_status status; -}; - -/** - * Get current notification at iterator's position. - * - * This functions will not advance the cursor's position. - * The returned notification's reference count is already incremented. - * - * @param iterator Iterator instance - * @returns Returns a bt_notification instance - * - * @see bt_put() - */ -extern struct bt_notification *bt_notification_iterator_get_notification( - struct bt_notification_iterator *iterator); - -/** - * Advance the iterator's position forward. - * - * This function can be called repeatedly to iterate through the iterator's - * associated trace. - * - * @param iterator Iterator instance - * @returns Returns a bt_notification instance - * - * @see bt_notification_iterator_get_notification() - */ -extern enum bt_notification_iterator_status -bt_notification_iterator_next(struct bt_notification_iterator *iterator); - -/** - * Seek iterator to time. - * - * Sets the iterator's position for the trace associated with the iterator. - * The new position is computed by adding \p time to the position specified - * by \p seek_origin. - * - * time is expressed in nanoseconds. - * - * @param iterator Iterator instance - * @param seek_origin One of #bt_notification_iterator_seek_type values. - * @returns One of #bt_notification_iterator_status values; - * if \iterator does not support seeking, - * #BT_NOTIFICATION_ITERATOR_STATUS_UNSUPPORTED is - * returned. - * - * @see bt_notification_iterator_get_notification() - */ -extern enum bt_notification_iterator_status bt_notification_iterator_seek_time( - struct bt_notification_iterator *iterator, - enum bt_notification_iterator_seek_origin seek_origin, - int64_t time); - -extern struct bt_component *bt_notification_iterator_get_component( - struct bt_notification_iterator *iterator); - #ifdef __cplusplus } #endif