lib: simplify the public notification iterator interfaces
Simplify the public notification iterator interfaces so as to remove:
* bt_notification_iterator_borrow_notification()
* bt_notification_iterator_get_notification()
* bt_notification_iterator_next()
in favor of:
enum bt_notification_iterator_status
bt_output_port_notification_iterator_next(struct
bt_notification_iterator *iterator,
struct bt_notification **notification);
enum bt_notification_iterator_status
bt_private_connection_notification_iterator_next(
struct bt_notification_iterator *iterator,
struct bt_notification **notification);
Those two new functions:
* Move the notification received from the user method to the
`notification` output variable directly without modifying the
reference count.
* Do not need to check the notification iterator type of notification to
perform the appropriate specific operation and have precondition
checks to ensure `iterator` has the right type.
This API is also in line with some popular iterator interfaces where the
"next" function returns the iteration status and the element at the same
time, for example:
* g_hash_table_iter_next()
* Python's next()
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
13 files changed:
This page took 0.028105 seconds and 4 git commands to generate.