def __init__(self, stream): utils._check_type(stream, bt2.stream._Stream) ptr = native_bt.message_stream_end_create(stream._ptr) if ptr is None: raise bt2.CreationError('cannot create stream end message object') super().__init__(ptr)
def _create_stream_end_message(self, stream, default_clock_snapshot=None): utils._check_type(stream, bt2_stream._Stream) ptr = native_bt.message_stream_end_create(self._bt_ptr, stream._ptr) if ptr is None: raise bt2._MemoryError('cannot create stream end message object') msg = bt2_message._StreamEndMessage(ptr) if default_clock_snapshot is not None: msg._default_clock_snapshot = default_clock_snapshot return msg