This makes it match what we have for the class of an event object, the
class of a stream object, and the class of a trace object (`cls`
properties).
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I5dd6f837a7f79b05ca933cd30bd281da2fbe5728
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1919
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
return self._spec_eq(other)
@property
return self._spec_eq(other)
@property
field_class_ptr = native_bt.field_borrow_class_const(self._ptr)
assert field_class_ptr is not None
return bt2_field_class._create_field_class_from_ptr_and_get_ref(field_class_ptr)
field_class_ptr = native_bt.field_borrow_class_const(self._ptr)
assert field_class_ptr is not None
return bt2_field_class._create_field_class_from_ptr_and_get_ref(field_class_ptr)
return str(self.value_as_integer)
def __len__(self):
return str(self.value_as_integer)
def __len__(self):
- return self.field_class.length
@functools.total_ordering
@functools.total_ordering
_NAME = 'Structure'
def _count(self):
_NAME = 'Structure'
def _count(self):
- return len(self.field_class)
def __setitem__(self, key, value):
# raises if key is somehow invalid
def __setitem__(self, key, value):
# raises if key is somehow invalid
def __iter__(self):
# same name iterator
def __iter__(self):
# same name iterator
- return iter(self.field_class)
def _spec_eq(self, other):
if not isinstance(other, collections.abc.Mapping):
def _spec_eq(self, other):
if not isinstance(other, collections.abc.Mapping):
def test_context_field(self):
packet, stream, pc_fc = self._create_packet(with_pc=True)
def test_context_field(self):
packet, stream, pc_fc = self._create_packet(with_pc=True)
- self.assertEqual(packet.context_field.field_class.addr, pc_fc.addr)
+ self.assertEqual(packet.context_field.cls.addr, pc_fc.addr)
def test_no_context_field(self):
packet, _, _ = self._create_packet(with_pc=False)
def test_no_context_field(self):
packet, _, _ = self._create_packet(with_pc=False)