bt_component_class_filter_message_iterator_finalize_method method);
extern bt_component_class_set_method_status
-bt_component_class_filter_set_message_iterator_seek_ns_from_origin_method(
+bt_component_class_filter_set_message_iterator_seek_ns_from_origin_methods(
bt_component_class_filter *comp_class,
- bt_component_class_filter_message_iterator_seek_ns_from_origin_method method);
+ bt_component_class_filter_message_iterator_seek_ns_from_origin_method seek_method,
+ bt_component_class_filter_message_iterator_can_seek_ns_from_origin_method can_seek_method);
extern bt_component_class_set_method_status
-bt_component_class_filter_set_message_iterator_seek_beginning_method(
+bt_component_class_filter_set_message_iterator_seek_beginning_methods(
bt_component_class_filter *comp_class,
- bt_component_class_filter_message_iterator_seek_beginning_method method);
-
-extern bt_component_class_set_method_status
-bt_component_class_filter_set_message_iterator_can_seek_ns_from_origin_method(
- bt_component_class_filter *comp_class,
- bt_component_class_filter_message_iterator_can_seek_ns_from_origin_method method);
-
-extern bt_component_class_set_method_status
-bt_component_class_filter_set_message_iterator_can_seek_beginning_method(
- bt_component_class_filter *comp_class,
- bt_component_class_filter_message_iterator_can_seek_beginning_method method);
+ bt_component_class_filter_message_iterator_seek_beginning_method seek_method,
+ bt_component_class_filter_message_iterator_can_seek_beginning_method can_seek_method);
#ifdef __cplusplus
}
bt_component_class_source_message_iterator_finalize_method method);
extern bt_component_class_set_method_status
-bt_component_class_source_set_message_iterator_seek_ns_from_origin_method(
+bt_component_class_source_set_message_iterator_seek_ns_from_origin_methods(
bt_component_class_source *comp_class,
- bt_component_class_source_message_iterator_seek_ns_from_origin_method method);
+ bt_component_class_source_message_iterator_seek_ns_from_origin_method seek_method,
+ bt_component_class_source_message_iterator_can_seek_ns_from_origin_method can_seek_method);
extern bt_component_class_set_method_status
-bt_component_class_source_set_message_iterator_seek_beginning_method(
+bt_component_class_source_set_message_iterator_seek_beginning_methods(
bt_component_class_source *comp_class,
- bt_component_class_source_message_iterator_seek_beginning_method method);
-
-extern bt_component_class_set_method_status
-bt_component_class_source_set_message_iterator_can_seek_ns_from_origin_method(
- bt_component_class_source *comp_class,
- bt_component_class_source_message_iterator_can_seek_ns_from_origin_method method);
-
-extern bt_component_class_set_method_status
-bt_component_class_source_set_message_iterator_can_seek_beginning_method(
- bt_component_class_source *comp_class,
- bt_component_class_source_message_iterator_can_seek_beginning_method method);
+ bt_component_class_source_message_iterator_seek_beginning_method seek_method,
+ bt_component_class_source_message_iterator_can_seek_beginning_method can_seek_method);
#ifdef __cplusplus
}
__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_msg_iter_finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_FINALIZE_METHOD, _id, _comp_class_id, source, _x)
/*
- * Defines an iterator "seek nanoseconds from origin" method attribute
- * attached to a specific source component class descriptor.
- *
- * _id: Plugin descriptor ID (C identifier).
- * _comp_class_id: Component class descriptor ID (C identifier).
- * _x: Iterator "seek nanoseconds from origin" method
- * (bt_component_class_source_message_iterator_seek_ns_from_origin_method).
- */
-#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_NS_FROM_ORIGIN_METHOD_WITH_ID(_id, _comp_class_id, _x) \
- __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_msg_iter_seek_ns_from_origin_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_NS_FROM_ORIGIN_METHOD, _id, _comp_class_id, source, _x)
-
-/*
- * Defines an iterator "seek beginning" method attribute attached to a
- * specific source component class descriptor.
+ * Defines an iterator "seek nanoseconds from origin" and "can seek nanoseconds
+ * from origin" method attributes attached to a specific source component class
+ * descriptor.
*
- * _id: Plugin descriptor ID (C identifier).
- * _comp_class_id: Component class descriptor ID (C identifier).
- * _x: Iterator "seek beginning" method
- * (bt_component_class_source_message_iterator_seek_beginning_method).
+ * _id: Plugin descriptor ID (C identifier).
+ * _comp_class_id: Component class descriptor ID (C identifier).
+ * _seek_method: Iterator "seek nanoseconds from origin" method
+ * (bt_component_class_source_message_iterator_seek_ns_from_origin_method).
+ * _can_seek_method: Iterator "can seek nanoseconds from origin" method
+ * (bt_component_class_source_message_iterator_can_seek_ns_from_origin_method).
*/
-#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_BEGINNING_METHOD_WITH_ID(_id, _comp_class_id, _x) \
- __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_msg_iter_seek_beginning_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_BEGINNING_METHOD, _id, _comp_class_id, source, _x)
+#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_NS_FROM_ORIGIN_METHODS_WITH_ID(_id, _comp_class_id, _seek_method, _can_seek_method) \
+ __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_msg_iter_seek_ns_from_origin_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_NS_FROM_ORIGIN_METHOD, _id, _comp_class_id, source, _seek_method); \
+ __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_msg_iter_can_seek_ns_from_origin_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_NS_FROM_ORIGIN_METHOD, _id, _comp_class_id, source, _can_seek_method)
/*
- * Defines an iterator "can seek nanoseconds from origin" method
- * attribute attached to a specific source component class descriptor.
+ * Defines an iterator "seek beginning" and "can seek beginning" method
+ * attributes attached to a specific source component class descriptor.
*
- * _id: Plugin descriptor ID (C identifier).
- * _comp_class_id: Component class descriptor ID (C identifier).
- * _x: Iterator "can seek nanoseconds from origin" method
- * (bt_component_class_source_message_iterator_can_seek_ns_from_origin_method).
+ * _id: Plugin descriptor ID (C identifier).
+ * _comp_class_id: Component class descriptor ID (C identifier).
+ * _seek_method: Iterator "seek beginning" method
+ * (bt_component_class_source_message_iterator_seek_beginning_method).
+ * _can_seek_method: Iterator "can seek beginning" method
+ * (bt_component_class_source_message_iterator_can_seek_beginning_method).
*/
-#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CAN_SEEK_NS_FROM_ORIGIN_METHOD_WITH_ID(_id, _comp_class_id, _x) \
- __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_msg_iter_can_seek_ns_from_origin_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_NS_FROM_ORIGIN_METHOD, _id, _comp_class_id, source, _x)
-
-/*
- * Defines an iterator "can seek beginning" method attribute attached to a
- * specific source component class descriptor.
- *
- * _id: Plugin descriptor ID (C identifier).
- * _comp_class_id: Component class descriptor ID (C identifier).
- * _x: Iterator "can seek beginning" method
- * (bt_component_class_source_message_iterator_can_seek_beginning_method).
- */
-#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CAN_SEEK_BEGINNING_METHOD_WITH_ID(_id, _comp_class_id, _x) \
- __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_msg_iter_can_seek_beginning_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_BEGINNING_METHOD, _id, _comp_class_id, source, _x)
+#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_BEGINNING_METHODS_WITH_ID(_id, _comp_class_id, _seek_method, _can_seek_method) \
+ __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_msg_iter_seek_beginning_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_BEGINNING_METHOD, _id, _comp_class_id, source, _seek_method); \
+ __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_msg_iter_can_seek_beginning_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_BEGINNING_METHOD, _id, _comp_class_id, source, _can_seek_method)
/*
* Defines an iterator initialization method attribute attached to a
__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_msg_iter_finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_FINALIZE_METHOD, _id, _comp_class_id, filter, _x)
/*
- * Defines an iterator "seek nanoseconds from origin" method attribute
- * attached to a specific filter component class descriptor.
- *
- * _id: Plugin descriptor ID (C identifier).
- * _comp_class_id: Component class descriptor ID (C identifier).
- * _x: Iterator "seek nanoseconds from origin" method
- * (bt_component_class_filter_message_iterator_seek_ns_from_origin_method).
- */
-#define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_NS_FROM_ORIGIN_METHOD_WITH_ID(_id, _comp_class_id, _x) \
- __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_msg_iter_seek_ns_from_origin_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_NS_FROM_ORIGIN_METHOD, _id, _comp_class_id, filter, _x)
-
-/*
- * Defines an iterator "seek beginning" method attribute attached to a
- * specific filter component class descriptor.
- *
- * _id: Plugin descriptor ID (C identifier).
- * _comp_class_id: Component class descriptor ID (C identifier).
- * _x: Iterator "seek beginning" method
- * (bt_component_class_filter_message_iterator_seek_beginning_method).
- */
-#define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_BEGINNING_METHOD_WITH_ID(_id, _comp_class_id, _x) \
- __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_msg_iter_seek_beginning_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_BEGINNING_METHOD, _id, _comp_class_id, filter, _x)
-
-/*
- * Defines an iterator "can seek nanoseconds from origin" method
- * attribute attached to a specific filter component class descriptor.
+ * Defines an iterator "seek nanoseconds" and "can seek nanoseconds from origin"
+ * method attributes attached to a specific filter component class descriptor.
*
- * _id: Plugin descriptor ID (C identifier).
- * _comp_class_id: Component class descriptor ID (C identifier).
- * _x: Iterator "can seek nanoseconds from origin" method
- * (bt_component_class_filter_message_iterator_can_seek_ns_from_origin_method).
+ * _id: Plugin descriptor ID (C identifier).
+ * _comp_class_id: Component class descriptor ID (C identifier).
+ * _seek_method: Iterator "seek nanoseconds from origin" method
+ * (bt_component_class_filter_message_iterator_seek_ns_from_origin_method).
+ * _can_seek_method: Iterator "can seek nanoseconds from origin" method
+ * (bt_component_class_filter_message_iterator_can_seek_ns_from_origin_method).
*/
-#define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CAN_SEEK_NS_FROM_ORIGIN_METHOD_WITH_ID(_id, _comp_class_id, _x) \
- __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_msg_iter_can_seek_ns_from_origin_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_NS_FROM_ORIGIN_METHOD, _id, _comp_class_id, filter, _x)
+#define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_NS_FROM_ORIGIN_METHODS_WITH_ID(_id, _comp_class_id, _seek_method, _can_seek_method) \
+ __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_msg_iter_seek_ns_from_origin_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_NS_FROM_ORIGIN_METHOD, _id, _comp_class_id, filter, _seek_method); \
+ __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_msg_iter_can_seek_ns_from_origin_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_NS_FROM_ORIGIN_METHOD, _id, _comp_class_id, filter, _can_seek_method)
/*
- * Defines an iterator "can seek beginning" method attribute attached to a
- * specific filter component class descriptor.
+ * Defines an iterator "seek beginning" and "can seek beginning" method
+ * attributes attached to a specific filter component class descriptor.
*
- * _id: Plugin descriptor ID (C identifier).
- * _comp_class_id: Component class descriptor ID (C identifier).
- * _x: Iterator "can seek beginning" method
- * (bt_component_class_filter_message_iterator_can_seek_beginning_method).
+ * _id: Plugin descriptor ID (C identifier).
+ * _comp_class_id: Component class descriptor ID (C identifier).
+ * _seek_method: Iterator "seek beginning" method
+ * (bt_component_class_filter_message_iterator_seek_beginning_method).
+ * _can_seek_method: Iterator "can seek beginning" method
+ * (bt_component_class_filter_message_iterator_can_seek_beginning_method).
*/
-#define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CAN_SEEK_BEGINNING_METHOD_WITH_ID(_id, _comp_class_id, _x) \
- __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_msg_iter_can_seek_beginning_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_BEGINNING_METHOD, _id, _comp_class_id, filter, _x)
+#define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_BEGINNING_METHODS_WITH_ID(_id, _comp_class_id, _seek_method, _can_seek_method) \
+ __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_msg_iter_seek_beginning_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_BEGINNING_METHOD, _id, _comp_class_id, filter, _seek_method); \
+ __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_msg_iter_can_seek_beginning_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_BEGINNING_METHOD, _id, _comp_class_id, filter, _can_seek_method);
/*
* Defines a plugin descriptor with an automatic ID.
BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
/*
- * Defines an iterator "seek nanoseconds from origin" method attribute
- * attached to a source component class descriptor which is attached to
- * the automatic plugin descriptor.
- *
- * _name: Component class name (C identifier).
- * _x: Iterator "seek nanoseconds from origin" method
- * (bt_component_class_source_message_iterator_seek_ns_from_origin_method).
- */
-#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_NS_FROM_ORIGIN_METHOD(_name, _x) \
- BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_NS_FROM_ORIGIN_METHOD_WITH_ID(auto, _name, _x)
-
-/*
- * Defines an iterator "seek beginning" method attribute
- * attached to a source component class descriptor which is attached to
- * the automatic plugin descriptor.
- *
- * _name: Component class name (C identifier).
- * _x: Iterator "seek beginning" method
- * (bt_component_class_source_message_iterator_seek_beginning_method).
- */
-#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_BEGINNING_METHOD(_name, _x) \
- BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_BEGINNING_METHOD_WITH_ID(auto, _name, _x)
-
-/*
- * Defines an iterator "can seek nanoseconds from origin" method
- * attribute attached to a source component class descriptor which is
- * attached to the automatic plugin descriptor.
+ * Defines an iterator "seek nanoseconds from origin" and "can seek nanoseconds
+ * from origin" method attributes attached to a source component class
+ * descriptor which is attached to the automatic plugin descriptor.
*
- * _name: Component class name (C identifier).
- * _x: Iterator "can seek nanoseconds from origin" method
- * (bt_component_class_source_message_iterator_can_seek_ns_from_origin_method).
+ * _name: Component class name (C identifier).
+ * _seek_method: Iterator "seek nanoseconds from origin" method
+ * (bt_component_class_source_message_iterator_seek_ns_from_origin_method).
+ * _can_seek_method: Iterator "can seek nanoseconds from origin" method
+ * (bt_component_class_source_message_iterator_can_seek_ns_from_origin_method).
*/
-#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CAN_SEEK_NS_FROM_ORIGIN_METHOD(_name, _x) \
- BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CAN_SEEK_NS_FROM_ORIGIN_METHOD_WITH_ID(auto, _name, _x)
+#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_NS_FROM_ORIGIN_METHODS(_name, _seek_method, _can_seek_method) \
+ BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_NS_FROM_ORIGIN_METHODS_WITH_ID(auto, _name, _seek_method, _can_seek_method)
/*
- * Defines an iterator "can seek beginning" method attribute
- * attached to a source component class descriptor which is attached to
- * the automatic plugin descriptor.
+ * Defines an iterator "seek beginning" and "can seek beginning" method
+ * attributes attached to a source component class descriptor which is attached
+ * to the automatic plugin descriptor.
*
- * _name: Component class name (C identifier).
- * _x: Iterator "can seek beginning" method
- * (bt_component_class_source_message_iterator_can_seek_beginning_method).
+ * _name: Component class name (C identifier).
+ * _seek_method: Iterator "can seek beginning" method
+ * (bt_component_class_source_message_iterator_can_seek_beginning_method).
+ * _can_seek_method: Iterator "can seek beginning" method
+ * (bt_component_class_source_message_iterator_seek_beginning_method).
*/
-#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CAN_SEEK_BEGINNING_METHOD(_name, _x) \
- BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CAN_SEEK_BEGINNING_METHOD_WITH_ID(auto, _name, _x)
+#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_BEGINNING_METHODS(_name, _seek_method, _can_seek_method) \
+ BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_BEGINNING_METHODS_WITH_ID(auto, _name, _seek_method, _can_seek_method)
/*
* Defines an iterator initialization method attribute attached to a
BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
/*
- * Defines an iterator "seek nanoseconds from origin" method attribute
- * attached to a filter component class descriptor which is attached to
- * the automatic plugin descriptor.
+ * Defines an iterator "seek nanosecconds from origin" and "can seek
+ * nanoseconds from origin" method attributes attached to a filter component
+ * class descriptor which is attached to the automatic plugin descriptor.
*
- * _name: Component class name (C identifier).
- * _x: Iterator "seek nanoseconds from origin" method
- * (bt_component_class_filter_message_iterator_seek_ns_from_origin_method).
+ * _name: Component class name (C identifier).
+ * _seek_method: Iterator "seek nanoseconds from origin" method
+ * (bt_component_class_filter_message_iterator_seek_ns_from_origin_method).
+ * _can_seek_method: Iterator "can seek nanoseconds from origin" method
+ * (bt_component_class_filter_message_iterator_can_seek_ns_from_origin_method).
*/
-#define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_NS_FROM_ORIGIN_METHOD(_name, _x) \
- BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_NS_FROM_ORIGIN_METHOD_WITH_ID(auto, _name, _x)
+#define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_NS_FROM_ORIGIN_METHODS(_name, _seek_method, _can_seek_method) \
+ BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_NS_FROM_ORIGIN_METHODS_WITH_ID(auto, _name, _seek_method, _can_seek_method)
/*
- * Defines an iterator "seek beginning" method attribute
- * attached to a filter component class descriptor which is attached to
- * the automatic plugin descriptor.
+ * Defines an iterator "seek beginning" and "can seek beginning" method
+ * attributes attached to a filter component class descriptor which is attached
+ * to the automatic plugin descriptor.
*
- * _name: Component class name (C identifier).
- * _x: Iterator "seek beginning" method
- * (bt_component_class_filter_message_iterator_seek_beginning_method).
- */
-#define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_BEGINNING_METHOD(_name, _x) \
- BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_BEGINNING_METHOD_WITH_ID(auto, _name, _x)
-
-/*
- * Defines an iterator "can seek nanoseconds from origin" method
- * attribute attached to a filter component class descriptor which is
- * attached to the automatic plugin descriptor.
- *
- * _name: Component class name (C identifier).
- * _x: Iterator "can seek nanoseconds from origin" method
- * (bt_component_class_filter_message_iterator_can_seek_ns_from_origin_method).
- */
-#define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CAN_SEEK_NS_FROM_ORIGIN_METHOD(_name, _x) \
- BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CAN_SEEK_NS_FROM_ORIGIN_METHOD_WITH_ID(auto, _name, _x)
-
-/*
- * Defines an iterator "can seek beginning" method attribute
- * attached to a filter component class descriptor which is attached to
- * the automatic plugin descriptor.
- *
- * _name: Component class name (C identifier).
- * _x: Iterator "can seek beginning" method
- * (bt_component_class_filter_message_iterator_can_seek_beginning_method).
+ * _name: Component class name (C identifier).
+ * _seek_method: Iterator "seek beginning" method
+ * (bt_component_class_filter_message_iterator_seek_beginning_method).
+ * _can_seek_method: Iterator "can seek beginning" method
+ * (bt_component_class_filter_message_iterator_can_seek_beginning_method).
*/
-#define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CAN_SEEK_BEGINNING_METHOD(_name, _x) \
- BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CAN_SEEK_BEGINNING_METHOD_WITH_ID(auto, _name, _x)
+#define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_BEGINNING_METHODS(_name, _seek_method, _can_seek_method) \
+ BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_BEGINNING_METHODS_WITH_ID(auto, _name, _seek_method, _can_seek_method)
#define BT_PLUGIN_MODULE() \
static struct __bt_plugin_descriptor const * const __bt_plugin_descriptor_dummy __BT_PLUGIN_DESCRIPTOR_ATTRS = NULL; \
)
)
+ if hasattr(iter_cls, '_user_can_seek_ns_from_origin') and not hasattr(
+ iter_cls, '_user_seek_ns_from_origin'
+ ):
+ raise bt2._IncompleteUserClass(
+ "cannot create component class '{}': message iterator class implements _user_can_seek_ns_from_origin but not _user_seek_ns_from_origin".format(
+ cls.__name__
+ )
+ )
+
+ if hasattr(iter_cls, '_user_can_seek_beginning') and not hasattr(
+ iter_cls, '_user_seek_beginning'
+ ):
+ raise bt2._IncompleteUserClass(
+ "cannot create component class '{}': message iterator class implements _user_can_seek_beginning but not _user_seek_beginning".format(
+ cls.__name__
+ )
+ )
+
cls._iter_cls = iter_cls
@property
BT_ASSERT(ret == 0);
ret = bt_component_class_source_set_finalize_method(component_class_source, component_class_source_finalize);
BT_ASSERT(ret == 0);
- ret = bt_component_class_source_set_message_iterator_can_seek_beginning_method(component_class_source,
- component_class_can_seek_beginning);
- BT_ASSERT(ret == 0);
- ret = bt_component_class_source_set_message_iterator_seek_beginning_method(component_class_source,
- component_class_seek_beginning);
- ret = bt_component_class_source_set_message_iterator_can_seek_ns_from_origin_method(
- component_class_source, component_class_can_seek_ns_from_origin);
- BT_ASSERT(ret == 0);
- ret = bt_component_class_source_set_message_iterator_seek_ns_from_origin_method(
- component_class_source, component_class_seek_ns_from_origin);
+ ret = bt_component_class_source_set_message_iterator_seek_beginning_methods(component_class_source,
+ component_class_seek_beginning, component_class_can_seek_beginning);
+ ret = bt_component_class_source_set_message_iterator_seek_ns_from_origin_methods(
+ component_class_source, component_class_seek_ns_from_origin,
+ component_class_can_seek_ns_from_origin);
BT_ASSERT(ret == 0);
ret = bt_component_class_source_set_output_port_connected_method(component_class_source,
component_class_source_output_port_connected);
BT_ASSERT(ret == 0);
ret = bt_component_class_filter_set_finalize_method (component_class_filter, component_class_filter_finalize);
BT_ASSERT(ret == 0);
- ret = bt_component_class_filter_set_message_iterator_can_seek_beginning_method(component_class_filter,
- component_class_can_seek_beginning);
- BT_ASSERT(ret == 0);
- ret = bt_component_class_filter_set_message_iterator_seek_beginning_method(component_class_filter,
- component_class_seek_beginning);
- BT_ASSERT(ret == 0);
- ret = bt_component_class_filter_set_message_iterator_can_seek_ns_from_origin_method(
- component_class_filter, component_class_can_seek_ns_from_origin);
+ ret = bt_component_class_filter_set_message_iterator_seek_beginning_methods(component_class_filter,
+ component_class_seek_beginning, component_class_can_seek_beginning);
BT_ASSERT(ret == 0);
- ret = bt_component_class_filter_set_message_iterator_seek_ns_from_origin_method(
- component_class_filter, component_class_seek_ns_from_origin);
+ ret = bt_component_class_filter_set_message_iterator_seek_ns_from_origin_methods(
+ component_class_filter, component_class_seek_ns_from_origin,
+ component_class_can_seek_ns_from_origin);
ret = bt_component_class_filter_set_input_port_connected_method(component_class_filter,
component_class_filter_input_port_connected);
BT_ASSERT(ret == 0);
}
enum bt_component_class_set_method_status
-bt_component_class_filter_set_message_iterator_seek_ns_from_origin_method(
+bt_component_class_filter_set_message_iterator_seek_ns_from_origin_methods(
struct bt_component_class_filter *comp_cls,
- bt_component_class_filter_message_iterator_seek_ns_from_origin_method method)
+ bt_component_class_filter_message_iterator_seek_ns_from_origin_method seek_method,
+ bt_component_class_filter_message_iterator_can_seek_ns_from_origin_method can_seek_method)
{
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
- BT_ASSERT_PRE_NON_NULL(method, "Method");
+ BT_ASSERT_PRE_NON_NULL(seek_method, "Seek method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
- comp_cls->methods.msg_iter_seek_ns_from_origin = method;
+ comp_cls->methods.msg_iter_seek_ns_from_origin = seek_method;
+ comp_cls->methods.msg_iter_can_seek_ns_from_origin = can_seek_method;
BT_LIB_LOGD("Set filter component class's message iterator \"seek nanoseconds from origin\" method"
": %!+C", comp_cls);
return BT_FUNC_STATUS_OK;
}
enum bt_component_class_set_method_status
-bt_component_class_source_set_message_iterator_seek_ns_from_origin_method(
- struct bt_component_class_source *comp_cls,
- bt_component_class_source_message_iterator_seek_ns_from_origin_method method)
-{
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
- BT_ASSERT_PRE_NON_NULL(method, "Method");
- BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
- comp_cls->methods.msg_iter_seek_ns_from_origin = method;
- BT_LIB_LOGD("Set source component class's message iterator \"seek nanoseconds from origin\" method"
- ": %!+C", comp_cls);
- return BT_FUNC_STATUS_OK;
-}
-
-enum bt_component_class_set_method_status
-bt_component_class_filter_set_message_iterator_seek_beginning_method(
- struct bt_component_class_filter *comp_cls,
- bt_component_class_filter_message_iterator_seek_beginning_method method)
-{
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
- BT_ASSERT_PRE_NON_NULL(method, "Method");
- BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
- comp_cls->methods.msg_iter_seek_beginning = method;
- BT_LIB_LOGD("Set filter component class's message iterator \"seek beginning\" method"
- ": %!+C", comp_cls);
- return BT_FUNC_STATUS_OK;
-}
-
-enum bt_component_class_set_method_status
-bt_component_class_source_set_message_iterator_seek_beginning_method(
- struct bt_component_class_source *comp_cls,
- bt_component_class_source_message_iterator_seek_beginning_method method)
-{
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
- BT_ASSERT_PRE_NON_NULL(method, "Method");
- BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
- comp_cls->methods.msg_iter_seek_beginning = method;
- BT_LIB_LOGD("Set source component class's message iterator \"seek beginning\" method"
- ": %!+C", comp_cls);
- return BT_FUNC_STATUS_OK;
-}
-
-enum bt_component_class_set_method_status
-bt_component_class_filter_set_message_iterator_can_seek_beginning_method(
- struct bt_component_class_filter *comp_cls,
- bt_component_class_filter_message_iterator_can_seek_beginning_method method)
-{
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
- BT_ASSERT_PRE_NON_NULL(method, "Method");
- BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
- comp_cls->methods.msg_iter_can_seek_beginning = method;
- BT_LIB_LOGD("Set filter component class's message iterator \"can seek beginning\" method"
- ": %!+C", comp_cls);
- return BT_FUNC_STATUS_OK;
-}
-
-enum bt_component_class_set_method_status
-bt_component_class_source_set_message_iterator_can_seek_beginning_method(
+bt_component_class_source_set_message_iterator_seek_ns_from_origin_methods(
struct bt_component_class_source *comp_cls,
- bt_component_class_source_message_iterator_can_seek_beginning_method method)
+ bt_component_class_source_message_iterator_seek_ns_from_origin_method seek_method,
+ bt_component_class_source_message_iterator_can_seek_ns_from_origin_method can_seek_method)
{
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
- BT_ASSERT_PRE_NON_NULL(method, "Method");
+ BT_ASSERT_PRE_NON_NULL(seek_method, "Seek method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
- comp_cls->methods.msg_iter_can_seek_beginning = method;
- BT_LIB_LOGD("Set source component class's message iterator \"can seek beginning\" method"
+ comp_cls->methods.msg_iter_seek_ns_from_origin = seek_method;
+ comp_cls->methods.msg_iter_can_seek_ns_from_origin = can_seek_method;
+ BT_LIB_LOGD("Set source component class's message iterator \"seek nanoseconds from origin\" methods"
": %!+C", comp_cls);
return BT_FUNC_STATUS_OK;
}
enum bt_component_class_set_method_status
-bt_component_class_filter_set_message_iterator_can_seek_ns_from_origin_method(
+bt_component_class_filter_set_message_iterator_seek_beginning_methods(
struct bt_component_class_filter *comp_cls,
- bt_component_class_filter_message_iterator_can_seek_ns_from_origin_method method)
+ bt_component_class_filter_message_iterator_seek_beginning_method seek_method,
+ bt_component_class_filter_message_iterator_can_seek_beginning_method can_seek_method)
{
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
- BT_ASSERT_PRE_NON_NULL(method, "Method");
+ BT_ASSERT_PRE_NON_NULL(seek_method, "Seek method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
- comp_cls->methods.msg_iter_can_seek_ns_from_origin = method;
- BT_LIB_LOGD("Set filter component class's message iterator \"can seek nanoseconds from origin\" method"
+ comp_cls->methods.msg_iter_seek_beginning = seek_method;
+ comp_cls->methods.msg_iter_can_seek_beginning = can_seek_method;
+ BT_LIB_LOGD("Set filter component class's message iterator \"seek beginning\" methods"
": %!+C", comp_cls);
return BT_FUNC_STATUS_OK;
}
enum bt_component_class_set_method_status
-bt_component_class_source_set_message_iterator_can_seek_ns_from_origin_method(
+bt_component_class_source_set_message_iterator_seek_beginning_methods(
struct bt_component_class_source *comp_cls,
- bt_component_class_source_message_iterator_can_seek_ns_from_origin_method method)
+ bt_component_class_source_message_iterator_seek_beginning_method seek_method,
+ bt_component_class_source_message_iterator_can_seek_beginning_method can_seek_method)
{
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
- BT_ASSERT_PRE_NON_NULL(method, "Method");
+ BT_ASSERT_PRE_NON_NULL(seek_method, "Seek method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
- comp_cls->methods.msg_iter_can_seek_ns_from_origin = method;
- BT_LIB_LOGD("Set source component class's message iterator \"can seek nanoseconds from origin\" method"
+ comp_cls->methods.msg_iter_seek_beginning = seek_method;
+ comp_cls->methods.msg_iter_can_seek_beginning = can_seek_method;
+ BT_LIB_LOGD("Set source component class's message iterator \"seek beginning\" methods"
": %!+C", comp_cls);
return BT_FUNC_STATUS_OK;
}
if (can_seek_by_itself) {
/* The iterator knows how to seek to a particular time, let it handle this. */
- BT_ASSERT_PRE_DEV(iterator->methods.seek_ns_from_origin,
- "Message iterator does not implement `seek_ns_from_origin` method: %!+i",
- iterator);
+ BT_ASSERT(iterator->methods.seek_ns_from_origin);
BT_LIB_LOGD("Calling user's \"seek nanoseconds from origin\" method: "
"%![iter-]+i, ns=%" PRId64, iterator, ns_from_origin);
status = iterator->methods.seek_ns_from_origin(iterator,
struct {
bt_self_component_port_input_message_iterator_next_method next;
+
+ /* These two are always both set or both unset. */
bt_self_component_port_input_message_iterator_seek_ns_from_origin_method seek_ns_from_origin;
- bt_self_component_port_input_message_iterator_seek_beginning_method seek_beginning;
bt_self_component_port_input_message_iterator_can_seek_ns_from_origin_method can_seek_ns_from_origin;
+
+ /* These two are always both set or both unset. */
+ bt_self_component_port_input_message_iterator_seek_beginning_method seek_beginning;
bt_self_component_port_input_message_iterator_can_seek_beginning_method can_seek_beginning;
} methods;
}
if (cc_full_descr->methods.source.msg_iter_seek_ns_from_origin) {
- ret = bt_component_class_source_set_message_iterator_seek_ns_from_origin_method(
- src_comp_class,
- cc_full_descr->methods.source.msg_iter_seek_ns_from_origin);
- if (ret) {
- BT_LIB_LOGE_APPEND_CAUSE(
- "Cannot set source component class's message iterator \"seek nanoseconds from origin\" method.");
- status = BT_FUNC_STATUS_MEMORY_ERROR;
- BT_OBJECT_PUT_REF_AND_RESET(src_comp_class);
- goto end;
- }
- }
-
- if (cc_full_descr->methods.source.msg_iter_seek_beginning) {
- ret = bt_component_class_source_set_message_iterator_seek_beginning_method(
- src_comp_class,
- cc_full_descr->methods.source.msg_iter_seek_beginning);
- if (ret) {
- BT_LIB_LOGE_APPEND_CAUSE(
- "Cannot set source component class's message iterator \"seek beginning\" method.");
- status = BT_FUNC_STATUS_MEMORY_ERROR;
- BT_OBJECT_PUT_REF_AND_RESET(src_comp_class);
- goto end;
- }
- }
-
- if (cc_full_descr->methods.source.msg_iter_can_seek_ns_from_origin) {
- ret = bt_component_class_source_set_message_iterator_can_seek_ns_from_origin_method(
+ ret = bt_component_class_source_set_message_iterator_seek_ns_from_origin_methods(
src_comp_class,
+ cc_full_descr->methods.source.msg_iter_seek_ns_from_origin,
cc_full_descr->methods.source.msg_iter_can_seek_ns_from_origin);
if (ret) {
BT_LIB_LOGE_APPEND_CAUSE(
- "Cannot set source component class's message iterator \"can seek nanoseconds from origin\" method.");
+ "Cannot set source component class's message iterator \"seek nanoseconds from origin\" methods.");
status = BT_FUNC_STATUS_MEMORY_ERROR;
BT_OBJECT_PUT_REF_AND_RESET(src_comp_class);
goto end;
}
}
- if (cc_full_descr->methods.source.msg_iter_can_seek_beginning) {
- ret = bt_component_class_source_set_message_iterator_can_seek_beginning_method(
+ if (cc_full_descr->methods.source.msg_iter_seek_beginning) {
+ ret = bt_component_class_source_set_message_iterator_seek_beginning_methods(
src_comp_class,
+ cc_full_descr->methods.source.msg_iter_seek_beginning,
cc_full_descr->methods.source.msg_iter_can_seek_beginning);
if (ret) {
BT_LIB_LOGE_APPEND_CAUSE(
- "Cannot set source component class's message iterator \"can seek beginning\" method.");
+ "Cannot set source component class's message iterator \"seek beginning\" methods.");
status = BT_FUNC_STATUS_MEMORY_ERROR;
BT_OBJECT_PUT_REF_AND_RESET(src_comp_class);
goto end;
}
if (cc_full_descr->methods.filter.msg_iter_seek_ns_from_origin) {
- ret = bt_component_class_filter_set_message_iterator_seek_ns_from_origin_method(
- flt_comp_class,
- cc_full_descr->methods.filter.msg_iter_seek_ns_from_origin);
- if (ret) {
- BT_LIB_LOGE_APPEND_CAUSE(
- "Cannot set filter component class's message iterator \"seek nanoseconds from origin\" method.");
- status = BT_FUNC_STATUS_MEMORY_ERROR;
- BT_OBJECT_PUT_REF_AND_RESET(flt_comp_class);
- goto end;
- }
- }
-
- if (cc_full_descr->methods.filter.msg_iter_seek_beginning) {
- ret = bt_component_class_filter_set_message_iterator_seek_beginning_method(
- flt_comp_class,
- cc_full_descr->methods.filter.msg_iter_seek_beginning);
- if (ret) {
- BT_LIB_LOGE_APPEND_CAUSE(
- "Cannot set filter component class's message iterator \"seek beginning\" method.");
- status = BT_FUNC_STATUS_MEMORY_ERROR;
- BT_OBJECT_PUT_REF_AND_RESET(flt_comp_class);
- goto end;
- }
- }
-
- if (cc_full_descr->methods.filter.msg_iter_can_seek_ns_from_origin) {
- ret = bt_component_class_filter_set_message_iterator_can_seek_ns_from_origin_method(
+ ret = bt_component_class_filter_set_message_iterator_seek_ns_from_origin_methods(
flt_comp_class,
+ cc_full_descr->methods.filter.msg_iter_seek_ns_from_origin,
cc_full_descr->methods.filter.msg_iter_can_seek_ns_from_origin);
if (ret) {
BT_LIB_LOGE_APPEND_CAUSE(
- "Cannot set filter component class's message iterator \"can seek nanoseconds from origin\" method.");
+ "Cannot set filter component class's message iterator \"seek nanoseconds from origin\" methods.");
status = BT_FUNC_STATUS_MEMORY_ERROR;
BT_OBJECT_PUT_REF_AND_RESET(flt_comp_class);
goto end;
}
}
- if (cc_full_descr->methods.filter.msg_iter_can_seek_beginning) {
- ret = bt_component_class_filter_set_message_iterator_can_seek_beginning_method(
+ if (cc_full_descr->methods.filter.msg_iter_seek_beginning) {
+ ret = bt_component_class_filter_set_message_iterator_seek_beginning_methods(
flt_comp_class,
+ cc_full_descr->methods.filter.msg_iter_seek_beginning,
cc_full_descr->methods.filter.msg_iter_can_seek_beginning);
if (ret) {
BT_LIB_LOGE_APPEND_CAUSE(
- "Cannot set filter component class's message iterator \"can seek beginning\" method.");
+ "Cannot set filter component class's message iterator \"seek beginning\" methods.");
status = BT_FUNC_STATUS_MEMORY_ERROR;
BT_OBJECT_PUT_REF_AND_RESET(flt_comp_class);
goto end;
ctf_fs_iterator_init);
BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_FINALIZE_METHOD(fs,
ctf_fs_iterator_finalize);
-BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_BEGINNING_METHOD(fs,
- ctf_fs_iterator_seek_beginning);
+BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_BEGINNING_METHODS(fs,
+ ctf_fs_iterator_seek_beginning, NULL);
/* ctf.fs sink */
BT_PLUGIN_SINK_COMPONENT_CLASS(fs, ctf_fs_sink_consume);
debug_info, debug_info_comp_finalize);
BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_INITIALIZE_METHOD_WITH_ID(
lttng_utils, debug_info, debug_info_msg_iter_init);
-BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_BEGINNING_METHOD_WITH_ID(
- lttng_utils, debug_info, debug_info_msg_iter_seek_beginning);
-BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CAN_SEEK_BEGINNING_METHOD_WITH_ID(
- lttng_utils, debug_info, debug_info_msg_iter_can_seek_beginning);
+BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_BEGINNING_METHODS_WITH_ID(
+ lttng_utils, debug_info,
+ debug_info_msg_iter_seek_beginning,
+ debug_info_msg_iter_can_seek_beginning);
BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_FINALIZE_METHOD_WITH_ID(
lttng_utils, debug_info, debug_info_msg_iter_finalize);
dmesg_msg_iter_init);
BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_FINALIZE_METHOD(dmesg,
dmesg_msg_iter_finalize);
-BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_BEGINNING_METHOD(dmesg,
- dmesg_msg_iter_seek_beginning);
-BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CAN_SEEK_BEGINNING_METHOD(dmesg,
- dmesg_msg_iter_can_seek_beginning);
+BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_BEGINNING_METHODS(dmesg,
+ dmesg_msg_iter_seek_beginning, dmesg_msg_iter_can_seek_beginning);
/* details sink */
BT_PLUGIN_SINK_COMPONENT_CLASS(details, details_consume);
muxer_msg_iter_init);
BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_FINALIZE_METHOD(muxer,
muxer_msg_iter_finalize);
-BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_BEGINNING_METHOD(muxer,
- muxer_msg_iter_seek_beginning);
-BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CAN_SEEK_BEGINNING_METHOD(muxer,
- muxer_msg_iter_can_seek_beginning);
+BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_SEEK_BEGINNING_METHODS(muxer,
+ muxer_msg_iter_seek_beginning, muxer_msg_iter_can_seek_beginning);
class UserMessageIteratorSeekBeginningTestCase(unittest.TestCase):
+ def test_can_seek_beginning_without_seek_beginning(self):
+ with self.assertRaisesRegex(
+ bt2._IncompleteUserClass,
+ "cannot create component class 'MySource': message iterator class implements _user_can_seek_beginning but not _user_seek_beginning",
+ ):
+ _setup_seek_test(SimpleSink, user_can_seek_beginning=lambda: None)
+
def test_can_seek_beginning(self):
class MySink(bt2._UserSinkComponent):
def __init__(self, config, params, obj):
return input_port_iter_can_seek_beginning
graph = _setup_seek_test(
- MySink, user_can_seek_beginning=_user_can_seek_beginning
+ MySink,
+ user_can_seek_beginning=_user_can_seek_beginning,
+ user_seek_beginning=lambda: None,
)
input_port_iter_can_seek_beginning = True
raise ValueError('moustiquaire')
graph = _setup_seek_test(
- MySink, user_can_seek_beginning=_user_can_seek_beginning
+ MySink,
+ user_can_seek_beginning=_user_can_seek_beginning,
+ user_seek_beginning=lambda: None,
)
with self.assertRaises(bt2._Error) as ctx:
return 'Amqui'
graph = _setup_seek_test(
- MySink, user_can_seek_beginning=_user_can_seek_beginning
+ MySink,
+ user_can_seek_beginning=_user_can_seek_beginning,
+ user_seek_beginning=lambda: None,
)
with self.assertRaises(bt2._Error) as ctx:
class UserMessageIteratorSeekNsFromOriginTestCase(unittest.TestCase):
+ def test_can_seek_ns_from_origin_without_seek_ns_from_origin(self):
+ # Test the case where:
+ #
+ # - can_seek_ns_from_origin: Returns True (don't really care, as long
+ # as it's provided)
+ # - seek_ns_from_origin provided: No
+ # - can the iterator seek beginning: Don't care
+ # - can the iterator seek forward: Don't care
+ for can_seek_ns_from_origin in (False, True):
+ for iter_can_seek_beginning in (False, True):
+ for iter_can_seek_forward in (False, True):
+ with self.assertRaisesRegex(
+ bt2._IncompleteUserClass,
+ "cannot create component class 'MySource': message iterator class implements _user_can_seek_ns_from_origin but not _user_seek_ns_from_origin",
+ ):
+ self._can_seek_ns_from_origin_test(
+ None,
+ user_can_seek_ns_from_origin_ret_val=True,
+ user_seek_ns_from_origin_provided=False,
+ iter_can_seek_beginning=iter_can_seek_beginning,
+ iter_can_seek_forward=iter_can_seek_forward,
+ )
+
def test_can_seek_ns_from_origin_returns_true(self):
# Test the case where:
#
# - can_seek_ns_from_origin: returns True
- # - seek_ns_from_origin provided: Don't care
+ # - seek_ns_from_origin provided: Yes
# - can the iterator seek beginning: Don't care
# - can the iterator seek forward: Don't care
#
# We expect iter.can_seek_ns_from_origin to return True.
- for user_seek_ns_from_origin_provided in (False, True):
- for iter_can_seek_beginning in (False, True):
- for iter_can_seek_forward in (False, True):
- self._can_seek_ns_from_origin_test(
- expected_outcome=True,
- user_can_seek_ns_from_origin_ret_val=True,
- user_seek_ns_from_origin_provided=user_seek_ns_from_origin_provided,
- iter_can_seek_beginning=iter_can_seek_beginning,
- iter_can_seek_forward=iter_can_seek_forward,
- )
+ for iter_can_seek_beginning in (False, True):
+ for iter_can_seek_forward in (False, True):
+ self._can_seek_ns_from_origin_test(
+ expected_outcome=True,
+ user_can_seek_ns_from_origin_ret_val=True,
+ user_seek_ns_from_origin_provided=True,
+ iter_can_seek_beginning=iter_can_seek_beginning,
+ iter_can_seek_forward=iter_can_seek_forward,
+ )
def test_can_seek_ns_from_origin_returns_false_can_seek_beginning_forward_seekable(
self
# Test the case where:
#
# - can_seek_ns_from_origin: returns False
- # - seek_ns_from_origin provided: Don't care
+ # - seek_ns_from_origin provided: Yes
# - can the iterator seek beginning: Yes
# - can the iterator seek forward: Yes
#
# We expect iter.can_seek_ns_from_origin to return True.
- for user_seek_ns_from_origin_provided in (False, True):
- self._can_seek_ns_from_origin_test(
- expected_outcome=True,
- user_can_seek_ns_from_origin_ret_val=False,
- user_seek_ns_from_origin_provided=user_seek_ns_from_origin_provided,
- iter_can_seek_beginning=True,
- iter_can_seek_forward=True,
- )
+ self._can_seek_ns_from_origin_test(
+ expected_outcome=True,
+ user_can_seek_ns_from_origin_ret_val=False,
+ user_seek_ns_from_origin_provided=True,
+ iter_can_seek_beginning=True,
+ iter_can_seek_forward=True,
+ )
def test_can_seek_ns_from_origin_returns_false_can_seek_beginning_not_forward_seekable(
self
# Test the case where:
#
# - can_seek_ns_from_origin: returns False
- # - seek_ns_from_origin provided: Don't care
+ # - seek_ns_from_origin provided: Yes
# - can the iterator seek beginning: Yes
# - can the iterator seek forward: No
#
# We expect iter.can_seek_ns_from_origin to return False.
- for user_seek_ns_from_origin_provided in (False, True):
- self._can_seek_ns_from_origin_test(
- expected_outcome=False,
- user_can_seek_ns_from_origin_ret_val=False,
- user_seek_ns_from_origin_provided=user_seek_ns_from_origin_provided,
- iter_can_seek_beginning=True,
- iter_can_seek_forward=False,
- )
+ self._can_seek_ns_from_origin_test(
+ expected_outcome=False,
+ user_can_seek_ns_from_origin_ret_val=False,
+ user_seek_ns_from_origin_provided=True,
+ iter_can_seek_beginning=True,
+ iter_can_seek_forward=False,
+ )
def test_can_seek_ns_from_origin_returns_false_cant_seek_beginning_forward_seekable(
self
# Test the case where:
#
# - can_seek_ns_from_origin: returns False
- # - seek_ns_from_origin provided: Don't care
+ # - seek_ns_from_origin provided: Yes
# - can the iterator seek beginning: No
# - can the iterator seek forward: Yes
#
# We expect iter.can_seek_ns_from_origin to return False.
- # for user_seek_ns_from_origin_provided in (False, True):
self._can_seek_ns_from_origin_test(
expected_outcome=False,
user_can_seek_ns_from_origin_ret_val=False,
- user_seek_ns_from_origin_provided=False,
+ user_seek_ns_from_origin_provided=True,
iter_can_seek_beginning=False,
iter_can_seek_forward=True,
)
# Test the case where:
#
# - can_seek_ns_from_origin: returns False
- # - seek_ns_from_origin provided: Don't care
+ # - seek_ns_from_origin provided: Yes
# - can the iterator seek beginning: No
# - can the iterator seek forward: No
#
# We expect iter.can_seek_ns_from_origin to return False.
- for user_seek_ns_from_origin_provided in (False, True):
- self._can_seek_ns_from_origin_test(
- expected_outcome=False,
- user_can_seek_ns_from_origin_ret_val=False,
- user_seek_ns_from_origin_provided=user_seek_ns_from_origin_provided,
- iter_can_seek_beginning=False,
- iter_can_seek_forward=False,
- )
+ self._can_seek_ns_from_origin_test(
+ expected_outcome=False,
+ user_can_seek_ns_from_origin_ret_val=False,
+ user_seek_ns_from_origin_provided=True,
+ iter_can_seek_beginning=False,
+ iter_can_seek_forward=False,
+ )
def test_no_can_seek_ns_from_origin_seek_ns_from_origin(self):
# Test the case where:
raise ValueError('Joutel')
graph = _setup_seek_test(
- MySink, user_can_seek_ns_from_origin=_user_can_seek_ns_from_origin
+ MySink,
+ user_can_seek_ns_from_origin=_user_can_seek_ns_from_origin,
+ user_seek_ns_from_origin=lambda: None,
)
with self.assertRaises(bt2._Error) as ctx:
return 'Nitchequon'
graph = _setup_seek_test(
- MySink, user_can_seek_ns_from_origin=_user_can_seek_ns_from_origin
+ MySink,
+ user_can_seek_ns_from_origin=_user_can_seek_ns_from_origin,
+ user_seek_ns_from_origin=lambda: None,
)
with self.assertRaises(bt2._Error) as ctx: