from bt2 import native_bt, object, utils
from bt2 import field_class as bt2_field_class
from bt2 import event_class as bt2_event_class
-from bt2 import trace_class as bt2_trace_class
from bt2 import clock_class as bt2_clock_class
from bt2 import value as bt2_value
import collections.abc
+def _bt2_trace_class():
+ from bt2 import trace_class as bt2_trace_class
+
+ return bt2_trace_class
+
+
class _StreamClassConst(object._SharedObject, collections.abc.Mapping):
_get_ref = staticmethod(native_bt.stream_class_get_ref)
_put_ref = staticmethod(native_bt.stream_class_put_ref)
_borrow_default_clock_class_ptr = staticmethod(
native_bt.stream_class_borrow_default_clock_class_const
)
+ _borrow_user_attributes_ptr = staticmethod(
+ native_bt.stream_class_borrow_user_attributes_const
+ )
_event_class_cls = property(lambda _: bt2_event_class._EventClassConst)
- _trace_class_cls = property(lambda _: bt2_trace_class._TraceClassConst)
+ _trace_class_cls = property(lambda _: _bt2_trace_class()._TraceClassConst)
_clock_class_cls = property(lambda _: bt2_clock_class._ClockClassConst)
def __getitem__(self, key):
@property
def user_attributes(self):
- ptr = native_bt.stream_class_borrow_user_attributes(self._ptr)
+ ptr = self._borrow_user_attributes_ptr(self._ptr)
assert ptr is not None
return bt2_value._create_from_ptr_and_get_ref(ptr)
_borrow_default_clock_class_ptr = staticmethod(
native_bt.stream_class_borrow_default_clock_class
)
+ _borrow_user_attributes_ptr = staticmethod(
+ native_bt.stream_class_borrow_user_attributes
+ )
+
_event_class_cls = property(lambda s: bt2_event_class._EventClass)
- _trace_class_cls = property(lambda s: bt2_trace_class._TraceClass)
+ _trace_class_cls = property(lambda s: _bt2_trace_class()._TraceClass)
_clock_class_cls = property(lambda s: bt2_clock_class._ClockClass)
def create_event_class(