1 # SPDX-License-Identifier: MIT
3 # Copyright (c) 2017 Philippe Proulx <pproulx@efficios.com>
5 from bt2
import native_bt
6 from bt2
import object as bt2_object
7 from bt2
import utils
as bt2_utils
9 from bt2
import clock_class
as bt2_clock_class
13 @functools.total_ordering
14 class _ClockSnapshotConst(bt2_object
._UniqueObject
):
16 def clock_class(self
):
17 cc_ptr
= native_bt
.clock_snapshot_borrow_clock_class_const(self
._ptr
)
18 assert cc_ptr
is not None
19 return bt2_clock_class
._ClockClassConst
._create
_from
_ptr
_and
_get
_ref
(cc_ptr
)
23 return native_bt
.clock_snapshot_get_value(self
._ptr
)
26 def ns_from_origin(self
):
27 status
, ns
= native_bt
.clock_snapshot_get_ns_from_origin(self
._ptr
)
28 bt2_utils
._handle
_func
_status
(
29 status
, "cannot get clock snapshot's nanoseconds from origin"
33 def __eq__(self
, other
):
34 if not isinstance(other
, numbers
.Integral
):
37 return self
.value
== int(other
)
39 def __lt__(self
, other
):
40 if not isinstance(other
, numbers
.Integral
):
43 return self
.value
< int(other
)
46 class _UnknownClockSnapshot
:
This page took 0.034492 seconds and 5 git commands to generate.