示例#1
0
    def get_config(self, cb=None):
        """
        Return this algorithm's current configuration.

        As algorithms are named, the configuration returned will be contained
        inside a sub-block whose name matches this algorithm's name in order
        to separate

        :param cb: An optional existing ConfigBlock instance to add this
            algorithm's configuration to.
        :type cb: ConfigBlock

        :return: This named algorithm's current configuration. If a config block
            was given to this method, the same config block is returned.
        :rtype: vital.ConfigBlock

        """
        if cb is None:
            cb = ConfigBlock()

        self._call_cfunc(
            'vital_algorithm_%s_get_type_config' % self.type_name(),
            [ctypes.c_char_p, self.C_TYPE_PTR,
             ConfigBlock.c_ptr_type()], [self.name, self, cb],
            ConfigBlock.c_ptr_type())

        return cb
示例#2
0
    def get_config(self, cb=None):
        """
        Return this algorithm's current configuration.

        As algorithms are named, the configuration returned will be contained
        inside a sub-block whose name matches this algorithm's name in order
        to separate

        :param cb: An optional existing ConfigBlock instance to add this
            algorithm's configuration to.
        :type cb: ConfigBlock

        :return: This named algorithm's current configuration. If a config block
            was given to this method, the same config block is returned.
        :rtype: vital.ConfigBlock

        """
        if cb is None:
            cb = ConfigBlock()

        self._call_cfunc(
            'vital_algorithm_%s_get_type_config' % self.type_name(),
            [ctypes.c_char_p, self.C_TYPE_PTR, ConfigBlock.c_ptr_type()],
            [self.name, self, cb],
            ConfigBlock.c_ptr_type()
        )

        return cb
示例#3
0
    def check_config(self, cb):
        """
        Check the given configuration block for valid algorithm configuration

        :param cb: Configuration to check.
        :type cb: ConfigBlock

        :return: True if the given configuration block contains a valid
            configuration for this algorithm type and implementation.
        :rtype: bool

        """
        return self._call_cfunc(
            'vital_algorithm_%s_check_type_config' % self.type_name(),
            [ctypes.c_char_p, ConfigBlock.c_ptr_type()], [self.name, cb],
            ctypes.c_bool)
示例#4
0
    def check_config(self, cb):
        """
        Check the given configuration block for valid algorithm configuration

        :param cb: Configuration to check.
        :type cb: ConfigBlock

        :return: True if the given configuration block contains a valid
            configuration for this algorithm type and implementation.
        :rtype: bool

        """
        return self._call_cfunc(
            'vital_algorithm_%s_check_type_config' % self.type_name(),
            [ctypes.c_char_p, ConfigBlock.c_ptr_type()],
            [self.name, cb],
            ctypes.c_bool
        )