def __next__(self): if self._at == len(self._variant_field_type): raise StopIteration ret, name, field_type_ptr = native_bt.ctf_field_type_variant_get_field(self._variant_field_type._ptr, self._at) utils._handle_ret(ret, "cannot get variant field type object's field") native_bt.put(field_type_ptr) self._at += 1 return name
def __len__(self): if self._is_private: pub_ptr = native_bt.component_from_private(self._component._ptr) count = self._get_port_count_fn(pub_ptr) native_bt.put(pub_ptr) else: count = self._get_port_count_fn(self._component._ptr) assert(count >= 0) return count
def __len__(self): if self._is_private: pub_ptr = native_bt.component_from_private(self._component._ptr) count = self._get_port_count_fn(pub_ptr) native_bt.put(pub_ptr) else: count = self._get_port_count_fn(self._component._ptr) assert (count >= 0) return count
def __next__(self): if self._at == len(self._variant_field_class): raise StopIteration ret, name, field_class_ptr = native_bt.field_class_variant_get_field_by_index( self._variant_field_class._ptr, self._at) assert (ret == 0) native_bt.put(field_class_ptr) self._at += 1 return name
def __next__(self): if self._at == len(self._variant_field_class): raise StopIteration ret, name, field_class_ptr = native_bt.field_class_variant_get_field_by_index(self._variant_field_class._ptr, self._at) assert(ret == 0) native_bt.put(field_class_ptr) self._at += 1 return name
def _get_clock_value_cycles(self, clock_class_ptr): clock_value_ptr = native_bt.ctf_event_get_clock_value(self._ptr, clock_class_ptr) if clock_value_ptr is None: return ret, cycles = native_bt.ctf_clock_value_get_value(clock_value_ptr) native_bt.put(clock_value_ptr) utils._handle_ret(ret, "cannot get clock value object's cycles") return cycles
def _get_clock_value_cycles(self, clock_class_ptr): clock_value_ptr = native_bt.ctf_event_get_clock_value( self._ptr, clock_class_ptr) if clock_value_ptr is None: return ret, cycles = native_bt.ctf_clock_value_get_value(clock_value_ptr) native_bt.put(clock_value_ptr) utils._handle_ret(ret, "cannot get clock value object's cycles") return cycles
def component(self): comp_ptr = native_bt.private_port_get_private_component(self._ptr) if comp_ptr is None: return pub_comp_ptr = native_bt.component_from_private(comp_ptr) assert (pub_comp_ptr) comp = bt2.component._create_generic_component_from_ptr(pub_comp_ptr) native_bt.put(comp_ptr) return comp
def __next__(self): if self._at == len(self._struct_field_class): raise StopIteration get_fc_by_index = native_bt.field_class_structure_get_field_by_index ret, name, field_class_ptr = get_fc_by_index( self._struct_field_class._ptr, self._at) assert (ret == 0) native_bt.put(field_class_ptr) self._at += 1 return name
def __next__(self): if self._at == len(self._struct_field_class): raise StopIteration get_fc_by_index = native_bt.field_class_structure_get_field_by_index ret, name, field_class_ptr = get_fc_by_index(self._struct_field_class._ptr, self._at) assert(ret == 0) native_bt.put(field_class_ptr) self._at += 1 return name
def component(self): comp_ptr = native_bt.private_port_get_private_component(self._ptr) if comp_ptr is None: return pub_comp_ptr = native_bt.component_from_private(comp_ptr) assert(pub_comp_ptr) comp = bt2.component._create_generic_component_from_ptr(pub_comp_ptr) native_bt.put(comp_ptr) return comp
def __next__(self): if self._at == len(self._trace_clock_classes): raise StopIteration trace_ptr = self._trace_clock_classes._trace._ptr cc_ptr = native_bt.ctf_trace_get_clock_class(trace_ptr, self._at) utils._handle_ptr(cc_ptr, "cannot get trace class object's clock class") name = native_bt.ctf_clock_class_get_name(cc_ptr) native_bt.put(cc_ptr) utils._handle_ptr(name, "cannot get clock class object's name") self._at += 1 return name
def __next__(self): if self._at == len(self._trace_clock_classes): raise StopIteration trace_ptr = self._trace_clock_classes._trace._ptr cc_ptr = native_bt.trace_get_clock_class_by_index(trace_ptr, self._at) assert(cc_ptr) name = native_bt.clock_class_get_name(cc_ptr) native_bt.put(cc_ptr) assert(name is not None) self._at += 1 return name
def __next__(self): if self._at == len(self._stream_class): raise StopIteration ec_ptr = native_bt.ctf_stream_class_get_event_class(self._stream_class._ptr, self._at) utils._handle_ptr(ec_ptr, "cannot get stream class object's event class object") name = native_bt.ctf_event_class_get_name(ec_ptr) native_bt.put(ec_ptr) utils._handle_ptr(name, "cannot get event class object's name") self._at += 1 return name
def __next__(self): if self._at == len(self._trace): raise StopIteration sc_ptr = native_bt.trace_get_stream_class_by_index(self._trace._ptr, self._at) assert(sc_ptr) id = native_bt.stream_class_get_id(sc_ptr) native_bt.put(sc_ptr) assert(id >= 0) self._at += 1 return id
def __next__(self): if self._at == len(self._stream_class): raise StopIteration ec_ptr = native_bt.stream_class_get_event_class_by_index(self._stream_class._ptr, self._at) assert(ec_ptr) ev_id = native_bt.event_class_get_id(ec_ptr) native_bt.put(ec_ptr) utils._handle_ret(ev_id, "cannot get event class object's ID") self._at += 1 return ev_id
def __next__(self): if self._at == len(self._stream_class): raise StopIteration ec_ptr = native_bt.ctf_stream_class_get_event_class( self._stream_class._ptr, self._at) utils._handle_ptr( ec_ptr, "cannot get stream class object's event class object") name = native_bt.ctf_event_class_get_name(ec_ptr) native_bt.put(ec_ptr) utils._handle_ptr(name, "cannot get event class object's name") self._at += 1 return name
def __next__(self): if self._at == len(self._trace): raise StopIteration sc_ptr = native_bt.ctf_trace_get_stream_class(self._trace._ptr, self._at) utils._handle_ptr(sc_ptr, "cannot get trace class object's stream class object") id = native_bt.ctf_stream_class_get_id(sc_ptr) native_bt.put(sc_ptr) if utils._is_m1ull(id): raise bt2.Error("cannot get stream class object's ID") self._at += 1 return id
def __next__(self): if self._at == len(self._trace): raise StopIteration sc_ptr = native_bt.ctf_trace_get_stream_class(self._trace._ptr, self._at) utils._handle_ptr( sc_ptr, "cannot get trace class object's stream class object") id = native_bt.ctf_stream_class_get_id(sc_ptr) native_bt.put(sc_ptr) if utils._is_m1ull(id): raise bt2.Error("cannot get stream class object's ID") self._at += 1 return id
def __len__(self): count = 0 total = native_bt.plugin_get_component_class_count(self._plugin._ptr) for at in range(total): comp_cls_ptr = native_bt.plugin_get_component_class_by_index( self._plugin._ptr, at) assert (comp_cls_ptr) cc_type = native_bt.component_class_get_type(comp_cls_ptr) if cc_type == self._comp_cls_type: count += 1 native_bt.put(comp_cls_ptr) return count
def __len__(self): count = 0 total = native_bt.plugin_get_component_class_count(self._plugin._ptr) for at in range(total): comp_cls_ptr = native_bt.plugin_get_component_class_by_index(self._plugin._ptr, at) assert(comp_cls_ptr) cc_type = native_bt.component_class_get_type(comp_cls_ptr) if cc_type == self._comp_cls_type: count += 1 native_bt.put(comp_cls_ptr) return count
def __next__(self): if self._at == len(self._comp_ports): raise StopIteration comp_ports = self._comp_ports comp_ptr = comp_ports._component._ptr port_ptr = comp_ports._get_port_at_index_fn(comp_ptr, self._at) assert(port_ptr) if comp_ports._is_private: port_pub_ptr = native_bt.port_from_private(port_ptr) name = native_bt.port_get_name(port_pub_ptr) native_bt.put(port_pub_ptr) else: name = native_bt.port_get_name(port_ptr) assert(name is not None) native_bt.put(port_ptr) self._at += 1 return name
def __next__(self): if self._at == len(self._comp_ports): raise StopIteration comp_ports = self._comp_ports comp_ptr = comp_ports._component._ptr port_ptr = comp_ports._get_port_at_index_fn(comp_ptr, self._at) assert (port_ptr) if comp_ports._is_private: port_pub_ptr = native_bt.port_from_private(port_ptr) name = native_bt.port_get_name(port_pub_ptr) native_bt.put(port_pub_ptr) else: name = native_bt.port_get_name(port_ptr) assert (name is not None) native_bt.put(port_ptr) self._at += 1 return name
def __next__(self): plugin_ptr = self._plugin_comp_cls._plugin._ptr comp_cls_type = self._plugin_comp_cls._comp_cls_type total = native_bt.plugin_get_component_class_count(plugin_ptr) while True: if self._at == total: raise StopIteration comp_cls_ptr = native_bt.plugin_get_component_class_by_index( plugin_ptr, self._at) assert (comp_cls_ptr) cc_type = native_bt.component_class_get_type(comp_cls_ptr) self._at += 1 if cc_type == comp_cls_type: break native_bt.put(comp_cls_ptr) name = native_bt.component_class_get_name(comp_cls_ptr) native_bt.put(comp_cls_ptr) assert (name is not None) return name
def __next__(self): plugin_ptr = self._plugin_comp_cls._plugin._ptr comp_cls_type = self._plugin_comp_cls._comp_cls_type total = native_bt.plugin_get_component_class_count(plugin_ptr) while True: if self._at == total: raise StopIteration comp_cls_ptr = native_bt.plugin_get_component_class_by_index(plugin_ptr, self._at) assert(comp_cls_ptr) cc_type = native_bt.component_class_get_type(comp_cls_ptr) self._at += 1 if cc_type == comp_cls_type: break native_bt.put(comp_cls_ptr) name = native_bt.component_class_get_name(comp_cls_ptr) native_bt.put(comp_cls_ptr) assert(name is not None) return name
def __del__(self): ptr = getattr(self, '_ptr', None) native_bt.put(ptr) self._ptr = None
def name(self): pub_ptr = native_bt.component_from_private(self._ptr) name = native_bt.component_get_name(pub_ptr) native_bt.put(pub_ptr) assert (name is not None) return name
def graph(self): pub_ptr = native_bt.component_from_private(self._ptr) ptr = native_bt.component_get_graph(pub_ptr) native_bt.put(pub_ptr) assert (ptr) return bt2.Graph._create_from_ptr(ptr)
def component_class(self): pub_ptr = native_bt.component_from_private(self._ptr) cc_ptr = native_bt.component_get_class(pub_ptr) native_bt.put(pub_ptr) assert (cc_ptr) return _create_generic_component_class_from_ptr(cc_ptr)
def __del__(self): if not self._belongs_to_native_component: self._belongs_to_native_component = True native_bt.py3_component_on_del(self) native_bt.put(self._ptr)
def __del__(cls): if hasattr(cls, '_cc_ptr'): native_bt.put(cls._cc_ptr)
def name(self): pub_ptr = native_bt.component_from_private(self._ptr) name = native_bt.component_get_name(pub_ptr) native_bt.put(pub_ptr) assert(name is not None) return name
def graph(self): pub_ptr = native_bt.component_from_private(self._ptr) ptr = native_bt.component_get_graph(pub_ptr) native_bt.put(pub_ptr) assert(ptr) return bt2.Graph._create_from_ptr(ptr)
def component_class(self): pub_ptr = native_bt.component_from_private(self._ptr) cc_ptr = native_bt.component_get_class(pub_ptr) native_bt.put(pub_ptr) assert(cc_ptr) return _create_generic_component_class_from_ptr(cc_ptr)
def __del__(self): pub_ptr = getattr(self, '_pub_ptr', None) native_bt.put(pub_ptr) self._pub_ptr = None super().__del__()
def __del__(self): ptr = getattr(self, '_ptr', None) native_bt.put(ptr)