1 # SPDX-License-Identifier: MIT
3 # Copyright (c) 2017 Philippe Proulx <pproulx@efficios.com>
8 from bt2
import utils
as bt2_utils
9 from bt2
import object as bt2_object
10 from bt2
import native_bt
11 from bt2
import clock_class
as bt2_clock_class
14 @functools.total_ordering
15 class _ClockSnapshotConst(bt2_object
._UniqueObject
):
17 def clock_class(self
):
18 cc_ptr
= native_bt
.clock_snapshot_borrow_clock_class_const(self
._ptr
)
19 assert cc_ptr
is not None
20 return bt2_clock_class
._ClockClassConst
._create
_from
_ptr
_and
_get
_ref
(cc_ptr
)
24 return native_bt
.clock_snapshot_get_value(self
._ptr
)
27 def ns_from_origin(self
):
28 status
, ns
= native_bt
.clock_snapshot_get_ns_from_origin(self
._ptr
)
29 bt2_utils
._handle
_func
_status
(
30 status
, "cannot get clock snapshot's nanoseconds from origin"
34 def __eq__(self
, other
):
35 if not isinstance(other
, numbers
.Integral
):
38 return self
.value
== int(other
)
40 def __lt__(self
, other
):
41 if not isinstance(other
, numbers
.Integral
):
44 return self
.value
< int(other
)
47 class _UnknownClockSnapshot
:
This page took 0.030289 seconds and 4 git commands to generate.