bt2: namespace private attributes of inheritable classes
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Fri, 5 Jul 2019 05:11:10 +0000 (01:11 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 5 Jul 2019 20:49:51 +0000 (16:49 -0400)
commit85906b6b4c37140f8bdd4a6861ecbc82fc62f816
treec94fa4252a28a4355ad0d22e6935be80cf12ca9f
parent89b5033a9ebfe2fde020ae8a56dabd7c8af3354d
bt2: namespace private attributes of inheritable classes

Add `_bt` prefix to all private attributes and methods of classes of
which the user can inherit. This is done to prevent attribute name
clashes between the base class and the user class. We will document that
the user must not have any attribute with the `_bt_` prefix.

Here are the attribute and method names of inheritable classes with this
commit:
_UserSinkComponent:
  self._add_input_port
  self._bt_as_component_class_ptr
  self._bt_as_component_ptr
  self._bt_as_not_self_specific_component_ptr
  self._bt_as_self_component_ptr
  self._bt_borrow_component_class_ptr
  self._bt_cc_ptr
  self._bt_comp_cls_type
  self._bt_graph_is_configured_from_native
  self._bt_port_connected_from_native
  self._bt_ptr
  self._consume
  self._create_clock_class
  self._create_trace_class
  self._finalize
  self._input_ports
  self._port_connected
  self.addr
  self.cls
  self.logging_level
  self.name

_UserMessageIterator:
  self._bt_can_seek_beginning_from_native
  self._bt_init_from_native
  self._bt_next_from_native
  self._bt_ptr
  self._bt_seek_beginning_from_native
  self._bt_validate_stream_activity_message_default_clock_snapshot
  self._can_seek_beginning
  self._component
  self._create_discarded_events_message
  self._create_discarded_packets_message
  self._create_event_message
  self._create_message_iterator_inactivity_message
  self._create_packet_beginning_message
  self._create_packet_end_message
  self._create_stream_activity_beginning_message
  self._create_stream_activity_end_message
  self._create_stream_beginning_message
  self._create_stream_end_message
  self._finalize
  self._infinite_clock_snapshot
  self._seek_beginning
  self._unknown_clock_snapshot
  self.addr

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: Ia42f247038cc3d054199a8c94becddcb088b646a
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1626
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/bindings/python/bt2/bt2/component.py
src/bindings/python/bt2/bt2/graph.py
src/bindings/python/bt2/bt2/message_iterator.py
src/bindings/python/bt2/bt2/native_bt_component_class.i
src/bindings/python/bt2/bt2/plugin.py
src/bindings/python/bt2/bt2/query_executor.py
This page took 0.026867 seconds and 4 git commands to generate.