# pointer to a 'bt_component_class *'.
-class _GenericComponentClass(object._SharedObject):
+class _ComponentClass(object._SharedObject):
@property
def name(self):
ptr = self._bt_as_component_class_ptr(self._ptr)
return self._bt_as_component_class_ptr(self._ptr)
def __eq__(self, other):
- if not isinstance(other, _GenericComponentClass):
+ if not isinstance(other, _ComponentClass):
try:
if not issubclass(other, _UserComponent):
return False
return self.addr == other.addr
-class _GenericSourceComponentClass(_GenericComponentClass):
+class _SourceComponentClass(_ComponentClass):
_get_ref = staticmethod(native_bt.component_class_source_get_ref)
_put_ref = staticmethod(native_bt.component_class_source_put_ref)
_bt_as_component_class_ptr = staticmethod(
)
-class _GenericFilterComponentClass(_GenericComponentClass):
+class _FilterComponentClass(_ComponentClass):
_get_ref = staticmethod(native_bt.component_class_filter_get_ref)
_put_ref = staticmethod(native_bt.component_class_filter_put_ref)
_bt_as_component_class_ptr = staticmethod(
)
-class _GenericSinkComponentClass(_GenericComponentClass):
+class _SinkComponentClass(_ComponentClass):
_get_ref = staticmethod(native_bt.component_class_sink_get_ref)
_put_ref = staticmethod(native_bt.component_class_sink_put_ref)
_bt_as_component_class_ptr = staticmethod(
_bt_as_component_ptr = staticmethod(native_bt.component_sink_as_component_const)
-# This is analogous to _GenericSourceComponentClass, but for source
+# This is analogous to _SourceComponentClass, but for source
# component objects.
class _GenericSourceComponent(object._SharedObject, _SourceComponent):
_get_ref = staticmethod(native_bt.component_source_get_ref)
)
-# This is analogous to _GenericFilterComponentClass, but for filter
+# This is analogous to _FilterComponentClass, but for filter
# component objects.
class _GenericFilterComponent(object._SharedObject, _FilterComponent):
_get_ref = staticmethod(native_bt.component_filter_get_ref)
)
-# This is analogous to _GenericSinkComponentClass, but for sink
+# This is analogous to _SinkComponentClass, but for sink
# component objects.
class _GenericSinkComponent(object._SharedObject, _SinkComponent):
_get_ref = staticmethod(native_bt.component_sink_get_ref)
_COMP_CLS_TYPE_TO_GENERIC_COMP_CLS_PYCLS = {
- native_bt.COMPONENT_CLASS_TYPE_SOURCE: _GenericSourceComponentClass,
- native_bt.COMPONENT_CLASS_TYPE_FILTER: _GenericFilterComponentClass,
- native_bt.COMPONENT_CLASS_TYPE_SINK: _GenericSinkComponentClass,
+ native_bt.COMPONENT_CLASS_TYPE_SOURCE: _SourceComponentClass,
+ native_bt.COMPONENT_CLASS_TYPE_FILTER: _FilterComponentClass,
+ native_bt.COMPONENT_CLASS_TYPE_SINK: _SinkComponentClass,
}
# Create a component class Python object of type
-# _GenericSourceComponentClass, _GenericFilterComponentClass or
-# _GenericSinkComponentClass, depending on comp_cls_type.
+# _SourceComponentClass, _FilterComponentClass or
+# _SinkComponentClass, depending on comp_cls_type.
#
# Acquires a new reference to ptr.
# creates a native BT component class of the corresponding type and
# associates it with this user-defined class. The metaclass also defines
# class methods like the `name` and `description` properties to match
-# the _GenericComponentClass interface.
+# the _ComponentClass interface.
#
# The component class name which is used is either:
#
params=None,
logging_level=bt2.logging.LoggingLevel.NONE,
):
- if isinstance(component_class, bt2.component._GenericSourceComponentClass):
+ if isinstance(component_class, bt2.component._SourceComponentClass):
cc_ptr = component_class._ptr
add_fn = native_bt.graph_add_source_component
cc_type = native_bt.COMPONENT_CLASS_TYPE_SOURCE
- elif isinstance(component_class, bt2.component._GenericFilterComponentClass):
+ elif isinstance(component_class, bt2.component._FilterComponentClass):
cc_ptr = component_class._ptr
add_fn = native_bt.graph_add_filter_component
cc_type = native_bt.COMPONENT_CLASS_TYPE_FILTER
- elif isinstance(component_class, bt2.component._GenericSinkComponentClass):
+ elif isinstance(component_class, bt2.component._SinkComponentClass):
cc_ptr = component_class._ptr
add_fn = native_bt.graph_add_sink_component
cc_type = native_bt.COMPONENT_CLASS_TYPE_SINK