示例#1
0
    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
示例#2
0
    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
示例#3
0
    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
示例#4
0
    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
示例#5
0
 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)
示例#6
0
 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)
示例#7
0
 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
示例#8
0
 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)
示例#9
0
 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)
示例#10
0
 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