/** * @param {IDirectKernelSettings} settings * @return {string[]}; * @abstract */ initPlugins(settings) { throw new Error(`"initPlugins" not defined on ${ this.constructor.name }`); }
getGqlInputType() { if (!this.constructor.type) { throw new Error(`${this.constructor.name} must have a static 'type' property`); } return `${this.constructor.type}RelateToManyInput`; }
requestFallback(args) { if (!this.onRequestFallback) { throw new Error(`"onRequestFallback" not defined on ${ this.constructor.name }`); } this.fallbackRequested = true; return this.onRequestFallback(args); }
constructor( driver, expectedElementSelector, waitMS = 30000 ) { this.name = this.constructor.name; this.driver = driver; this.expectedElementSelector = expectedElementSelector; this.explicitWaitMS = waitMS; }
constructor(error, qf) { const isSqlError = error instanceof npm.minify.SQLParsingError; const message = isSqlError ? `Failed to parse the SQL.` : error.message; super(message); this.name = this.constructor.name; if (isSqlError) { this.error = error; } this.file = qf.file; this.options = qf.options; Error.captureStackTrace(this, this.constructor); }
/** * Run async function in the background * @see Context#runInBackground * @param {Function} scope - the first args is an anonymous ctx */ runInBackground(scope) { const ctx = this.createAnonymousContext(); if (!scope.name) scope._name = eggUtils.getCalleeFromStack(true); ctx.runInBackground(scope); }
/** * @desc Destroys all memory associated with this kernel * @param {Boolean} [removeCanvasReferences] remove any associated canvas references */ destroy(removeCanvasReferences) { throw new Error(`"destroy" called on ${ this.constructor.name }`); }
/** * * @param {String} value */ prependString(value) { throw new Error(`"prependString" called on ${ this.constructor.name }`); }
/** * * @param {String} value * @return Boolean */ hasPrependString(value) { throw new Error(`"hasPrependString" called on ${ this.constructor.name }`); }
/** * * @returns {Function} */ toFunction() { throw new Error( `${this.constructor.name}-toFunction is not yet implemented` ); }
/** * @desc Run the kernel program, and send the output to renderOutput * <p> This method calls a helper method *renderOutput* to return the result. </p> * @returns {Float32Array|Float32Array[]|Float32Array[][]|void} Result The final output of the program, as float, and as Textures for reuse. * @abstract */ run() { throw new Error(`"run" not defined on ${ this.constructor.name }`) }
/** * @abstract * @return {Object} */ initContext() { throw new Error(`"initContext" not defined on ${ this.constructor.name }`); }
/** * @abstract * @param {Object} ast * @param {String[]} retArr * @returns {String[]} */ astFunction(ast, retArr) { throw new Error(`"astFunction" not defined on ${ this.constructor.name }`); }
/** * @abstract * @return {Object} */ initCanvas() { throw new Error(`"initCanvas" not defined on ${ this.constructor.name }`); }
/** * @desc Validate settings * @abstract */ validateSettings() { throw new Error(`"validateSettings" not defined on ${ this.constructor.name }`); }