1 # SPDX-License-Identifier: MIT
3 # Copyright (c) 2017 Philippe Proulx <pproulx@efficios.com>
5 from bt2
import native_bt
, object, utils
7 from bt2
import clock_class
as bt2_clock_class
11 @functools.total_ordering
12 class _ClockSnapshotConst(object._UniqueObject
):
14 def clock_class(self
):
15 cc_ptr
= native_bt
.clock_snapshot_borrow_clock_class_const(self
._ptr
)
16 assert cc_ptr
is not None
17 return bt2_clock_class
._ClockClassConst
._create
_from
_ptr
_and
_get
_ref
(cc_ptr
)
21 return native_bt
.clock_snapshot_get_value(self
._ptr
)
24 def ns_from_origin(self
):
25 status
, ns
= native_bt
.clock_snapshot_get_ns_from_origin(self
._ptr
)
26 utils
._handle
_func
_status
(
27 status
, "cannot get clock snapshot's nanoseconds from origin"
31 def __eq__(self
, other
):
32 if not isinstance(other
, numbers
.Integral
):
35 return self
.value
== int(other
)
37 def __lt__(self
, other
):
38 if not isinstance(other
, numbers
.Integral
):
41 return self
.value
< int(other
)
44 class _UnknownClockSnapshot
:
This page took 0.029928 seconds and 4 git commands to generate.