X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=bindings%2Fpython%2Fbt2%2Fbt2%2Fcomponent.py;h=e500c982649feb1915611901e06fb264bf1b0310;hb=be7bbff934d18e407853436dd9f7da23c8c20743;hp=fcd50785dcfef57f6ebcb950aed0c9c673c47b58;hpb=fbbe93021d7cd3793003911931bb3abd5e69596a;p=babeltrace.git diff --git a/bindings/python/bt2/bt2/component.py b/bindings/python/bt2/bt2/component.py index fcd50785..e500c982 100644 --- a/bindings/python/bt2/bt2/component.py +++ b/bindings/python/bt2/bt2/component.py @@ -641,6 +641,39 @@ class _UserComponent(metaclass=_UserComponentType): return tc + def _create_clock_class(self, frequency=None, name=None, description=None, + precision=None, offset=None, origin_is_unix_epoch=True, + uuid=None): + 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') + + cc = bt2.clock_class._ClockClass._create_from_ptr(cc_ptr) + + if frequency is not None: + cc._frequency = frequency + + if name is not None: + cc._name = name + + if description is not None: + cc._description = description + + if precision is not None: + cc._precision = precision + + if offset is not None: + cc._offset = offset + + cc._origin_is_unix_epoch = origin_is_unix_epoch + + if uuid is not None: + cc._uuid = uuid + + return cc + class _UserSourceComponent(_UserComponent, _SourceComponent): _as_not_self_specific_component_ptr = staticmethod(native_bt.self_component_source_as_component_source)