X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=bindings%2Fpython%2Fbt2%2Fbt2%2Fcomponent.py;h=ec8eb65a47609672d652a87dc48bc7b798339900;hb=3cdfbaeab23e6ed4268d606cb67c50ec9e8646a0;hp=fcd50785dcfef57f6ebcb950aed0c9c673c47b58;hpb=8c2367b884576ed438bc2e06cfc9205b2436838d;p=babeltrace.git diff --git a/bindings/python/bt2/bt2/component.py b/bindings/python/bt2/bt2/component.py index fcd50785..ec8eb65a 100644 --- a/bindings/python/bt2/bt2/component.py +++ b/bindings/python/bt2/bt2/component.py @@ -641,6 +641,15 @@ class _UserComponent(metaclass=_UserComponentType): return tc + def _create_clock_class(self): + ptr = self._as_self_component_ptr(self._ptr) + cc_ptr = native_bt.clock_class_create(ptr) + + if cc_ptr is None: + raise bt2.CreationError('could not create clock class') + + return bt2.ClockClass._create_from_ptr(cc_ptr) + class _UserSourceComponent(_UserComponent, _SourceComponent): _as_not_self_specific_component_ptr = staticmethod(native_bt.self_component_source_as_component_source)