Пример #1
0
    def new_method(self, *args, **kwargs):
        [id_value, watch_condition, check_node_list,
         parameter_list], _ = parse_user_args(method, *args, **kwargs)

        check_uint32(id_value, "id")
        check_uint32(watch_condition, "watch_condition")
        type_check(check_node_list, (dict, ), "check_node_list")
        for node_name, node_info in check_node_list.items():
            type_check(node_name, (str, ), "node_name")
            type_check(node_info, (dict, ), "node_info")
            for info_name, info_param in node_info.items():
                type_check(info_name, (str, ), "node parameter name")
                if info_name in ["device_id"]:
                    for param in info_param:
                        check_uint32(param, "device_id")
                elif info_name in ["root_graph_id"]:
                    for param in info_param:
                        check_uint32(param, "root_graph_id")
                elif info_name in ["is_parameter"]:
                    type_check(info_param, (bool, ), "is_parameter")
                else:
                    raise ValueError(
                        "Node parameter {} is not defined.".format(info_name))
        param_names = [
            "param_{0}".format(i) for i in range(len(parameter_list))
        ]
        type_check_list(parameter_list, (cds.Parameter, ), param_names)

        return method(self, *args, **kwargs)
Пример #2
0
    def new_method(self, *args, **kwargs):
        [node_name, slot, iteration, device_id, root_graph_id,
         is_parameter], _ = parse_user_args(method, *args, **kwargs)

        type_check(node_name, (str, ), "node_name")
        check_uint32(slot, "slot")
        check_uint32(iteration, "iteration")
        check_uint32(device_id, "device_id")
        check_uint32(root_graph_id, "root_graph_id")
        type_check(is_parameter, (bool, ), "is_parameter")

        return method(self, *args, **kwargs)
Пример #3
0
    def new_method(self, *args, **kwargs):
        [
            name, slot, condition, watchpoint_id, parameters, error_code,
            device_id, root_graph_id
        ], _ = parse_user_args(method, *args, **kwargs)

        type_check(name, (str, ), "name")
        check_uint32(slot, "slot")
        type_check(condition, (int, ), "condition")
        check_uint32(watchpoint_id, "watchpoint_id")
        param_names = ["param_{0}".format(i) for i in range(len(parameters))]
        type_check_list(parameters, (cds.Parameter, ), param_names)
        type_check(error_code, (int, ), "error_code")
        check_uint32(device_id, "device_id")
        check_uint32(root_graph_id, "root_graph_id")

        return method(self, *args, **kwargs)
Пример #4
0
    def new_method(self, *args, **kwargs):
        [id_value], _ = parse_user_args(method, *args, **kwargs)

        check_uint32(id_value, "id")

        return method(self, *args, **kwargs)
Пример #5
0
    def new_method(self, *args, **kwargs):
        [iteration], _ = parse_user_args(method, *args, **kwargs)

        check_uint32(iteration, "iteration")

        return method(self, *args, **kwargs)