示例#1
0
    def __len__(self):
        count = 0

        for scope in _scopes:
            scope_ptr = nbt._bt_ctf_get_top_level_scope(self._e, scope)
            ret = nbt._bt_python_field_listcaller(self._e, scope_ptr)

            if isinstance(ret, list):
                count += ret[1]

        return count
示例#2
0
    def __len__(self):
        count = 0

        for scope in _scopes:
            scope_ptr = nbt._bt_ctf_get_top_level_scope(self._e, scope)
            ret = nbt._bt_python_field_listcaller(self._e, scope_ptr)

            if isinstance(ret, list):
                count += ret[1]

        return count
示例#3
0
    def _field_list_with_scope(self, scope):
        fields = []
        scope_ptr = nbt._bt_ctf_get_top_level_scope(self._e, scope)

        # Returns a list [list_ptr, count]. If list_ptr is NULL, SWIG will only
        # provide the "count" return value
        count = 0
        list_ptr = None
        ret = nbt._bt_python_field_listcaller(self._e, scope_ptr)

        if isinstance(ret, list):
            list_ptr, count = ret

        for i in range(count):
            definition_ptr = nbt._bt_python_field_one_from_list(list_ptr, i)

            if definition_ptr is not None:
                definition = _Definition(definition_ptr, scope)
                fields.append(definition)

        return fields
示例#4
0
    def _field_list_with_scope(self, scope):
        fields = []
        scope_ptr = nbt._bt_ctf_get_top_level_scope(self._e, scope)

        # Returns a list [list_ptr, count]. If list_ptr is NULL, SWIG will only
        # provide the "count" return value
        count = 0
        list_ptr = None
        ret = nbt._bt_python_field_listcaller(self._e, scope_ptr)

        if isinstance(ret, list):
            list_ptr, count = ret

        for i in range(count):
            definition_ptr = nbt._bt_python_field_one_from_list(list_ptr, i)

            if definition_ptr is not None:
                definition = _Definition(definition_ptr, scope)
                fields.append(definition)

        return fields