diff --git a/date-fns/index.d.ts b/date-fns/index.d.ts index d0582c2571..bb78fe74e2 100644 --- a/date-fns/index.d.ts +++ b/date-fns/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for date-fns +// Type definitions for date-fns v2.5.1 // Project: https://date-fns.org/ // Definitions by: Matt Lewis // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/levenshtein/index.d.ts b/levenshtein/index.d.ts new file mode 100644 index 0000000000..d0b1108aa0 --- /dev/null +++ b/levenshtein/index.d.ts @@ -0,0 +1,47 @@ +// Type definitions for levenshtein v1.0 +// Project: https://github.com/gf3/Levenshtein +// Definitions by: Joshua DeVinney +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare class Levenshtein { + /** + * Levenshtein string difference + * @param m First string + * @param n Second string + */ + constructor(m: string, n: string); + + /** + * Distance between strings + */ + distance: number; + + /** + * Distance between strings + * Alias of distance + */ + valueOf(): number; + + /** + * Pretty print Levenshtein table. + */ + inspect(): string; + + /** + * Pretty print Levenshtein table. + * Alias of inspect() + */ + toString(): string; + + /** + * Return the Levenshtein table. + */ + getMatrix(): number[][]; +} + +// Required to make import as syntax work +declare namespace Levenshtein { + +} + +export = Levenshtein; diff --git a/levenshtein/levenshtein-tests.ts b/levenshtein/levenshtein-tests.ts new file mode 100644 index 0000000000..1f94164233 --- /dev/null +++ b/levenshtein/levenshtein-tests.ts @@ -0,0 +1,15 @@ +import * as Levenshtein from 'levenshtein'; + +// Using standard methods +let l1 = new Levenshtein('kitten', 'sitting'); +let num1: number = l1.distance; +let str1: string = l1.inspect(); + +// Using alias methods +let l2 = new Levenshtein('Saturday', 'Sunday'); +let num2: number = l2.valueOf(); +let str2: string = l2.toString(); + +// Levenshtein matrix can be retrieved +let l3 = new Levenshtein('kitten', 'sitting'); +l3.getMatrix()[0].length; diff --git a/levenshtein/tsconfig.json b/levenshtein/tsconfig.json new file mode 100644 index 0000000000..ce5f1122ef --- /dev/null +++ b/levenshtein/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "levenshtein-tests.ts" + ] +} \ No newline at end of file diff --git a/n3/index.d.ts b/n3/index.d.ts new file mode 100644 index 0000000000..4e2dc55ce0 --- /dev/null +++ b/n3/index.d.ts @@ -0,0 +1,125 @@ +// Type definitions for N3 +// Project: https://github.com/RubenVerborgh/N3.js +// Definitions by: Fred Eisele +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + + +import * as fs from "fs"; +import * as stream from "stream"; + +declare namespace N3 { + + type ErrorCallback = (err: Error, result: any) => void; + + interface Prefixes { + [key: string]: string; + } + + interface LiteralValue { + value: string | number; + } + + interface Triple { + subject: string, + predicate: string, + object: string, + graph?: string + } + + interface BlankTriple { + predicate: string, + object: string + } + + + interface ParserConstructor { + new (options?: ParserOptions): N3Parser; + (options?: ParserOptions): N3Parser; + } + const Parser: ParserConstructor; + + interface StreamParserConstructor { + new (options?: ParserOptions): N3StreamParser; + (options?: ParserOptions): N3StreamParser; + } + const StreamParser: StreamParserConstructor; + + interface ParserOptions { + format?: string, + prefixes?: string[] + } + + interface ParseCallback { + (error: Error, triple: Triple, prefixes: Prefixes): void; + } + + interface Logger { + (message?: any, ...optionalParams: any[]): void; + } + interface N3Parser { + parse(input: string, callback: ParseCallback): void; + parse(subject: string, predicate: string, object: string): void; + parse(triple: Triple): void; + parse(stream: fs.ReadStream, log: Logger): void; + } + + interface N3StreamParser extends N3Parser, fs.WriteStream { + pipe(consumer: stream.Writable | N3StreamWriter): void; + } + + + interface WriterConstructor { + new (options?: WriterOptions): N3Writer; + (options?: WriterOptions): N3Writer; + + new (fd: any, options?: WriterOptions): N3Writer; + (fd: any, options?: WriterOptions): N3Writer; + } + const Writer: WriterConstructor; + + interface N3Writer { + addTriple(subject: string, predicate: string, object: string): void; + addTriple(subject: string, predicate: string, object: string[]): void; + addTriple(triple: Triple): void; + end(err?: ErrorCallback, result?: any): void; + blank(ns: string, name: string): string; + blank(triple: BlankTriple[]): string; + list(triple: string[]): string[]; + } + + function StreamWriter(options: WriterOptions): N3StreamWriter; + + interface N3StreamWriter extends N3Writer { + pipe(consumer: NodeJS.WritableStream): void; + pipe(consumer: stream.Writable): void; + } + + interface WriterOptions { + format?: string, + prefixes?: Prefixes + } + + interface N3StoreWriter extends N3Writer { + find(subject: string, predicate: string | null, object: string | null): Triple[]; + } + function Store(): N3StoreWriter; + + namespace Util { + function createLiteral(value: any): string; + function createLiteral(value: any, type: string): string; + + function isIRI(value: string): boolean; + function isLiteral(value: string): boolean; + function getLiteralValue(value: string): string; + function getLiteralLanguage(value: string): string; + function getLiteralType(value: string): string; + function isBlank(value: string): boolean; + function isPrefixedName(name: string): boolean; + function expandPrefixedName(name: string, prefixes: Prefixes): string; + } +} + +export = N3; + diff --git a/n3/n3-tests.ts b/n3/n3-tests.ts index 0ca9c5385c..a7e529bc7d 100644 --- a/n3/n3-tests.ts +++ b/n3/n3-tests.ts @@ -1,5 +1,4 @@ -/// -/// +/// import * as N3 from "n3"; import * as fs from "fs"; @@ -63,7 +62,7 @@ function test_doc_rdf_stream_to_triples_1() { var streamParser = N3.StreamParser(); var rdfStream = fs.createReadStream('cartoons.ttl'); - // rdfStream.pipe(streamParser); + rdfStream.pipe(streamParser); streamParser.pipe(new SlowConsumer()); class SlowConsumer extends stream.Writable { @@ -107,12 +106,12 @@ function test_doc_from_triples_to_rdf_stream() { } function test_doc_from_triple_stream_to_rdf_stream() { - var streamParser = N3.StreamParser(), - // inputStream = fs.createReadStream('cartoons.ttl'), - streamWriter = N3.StreamWriter({ prefixes: { c: 'http://example.org/cartoons#' } }); - // inputStream.pipe(streamParser); + var streamParser = new N3.StreamParser(), + inputStream = fs.createReadStream('cartoons.ttl'), + streamWriter = /* new */ N3.StreamWriter({ prefixes: { c: 'http://example.org/cartoons#' } }); + inputStream.pipe(streamParser); streamParser.pipe(streamWriter); - // streamWriter.pipe(process.stdout); + streamWriter.pipe(process.stdout); } function test_doc_blank_nodes_and_lists() { @@ -168,7 +167,7 @@ function test_doc_utility() { N3Util.isLiteral('"This word is "quoted"!"'); // true N3Util.isLiteral('"3"^^http://www.w3.org/2001/XMLSchema#integer'); // true - N3.Parser().parse(' "This word is \\"quoted\\"!".', console.log); + new N3.Parser().parse(' "This word is \\"quoted\\"!".', console.log); // { subject: 'a', predicate: 'b', object: '"This word is "quoted"!"' } N3Util.createLiteral('My text', 'en-gb'); diff --git a/n3/tsconfig.json b/n3/tsconfig.json new file mode 100644 index 0000000000..53af13b215 --- /dev/null +++ b/n3/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [ + "node" + ], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "n3-tests.ts" + ] +} \ No newline at end of file diff --git a/samchon-framework/index.d.ts b/samchon-framework/index.d.ts index fb3e02bf53..3d88d95868 100644 --- a/samchon-framework/index.d.ts +++ b/samchon-framework/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Samchon Framework v2.0.0-gamma.4 +// Type definitions for Samchon Framework v2.0.0-gamma.9 // Project: https://github.com/samchon/framework // Definitions by: Jeongho Nam // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -11,12 +11,12 @@ declare module "samchon-framework" } /** - *

Samchon-Framework

+ * # Samchon-Framework * *
* * - * Samchon, a SDN (Software Defined Network) framework. + * Samchon, a OON (Object-Oriented Network) framework. * * With Samchon Framework, you can implement distributed processing system within framework of OOD like handling S/W * objects (classes). You can realize cloud and distributed system very easily with provided system templates and even @@ -355,9 +355,6 @@ declare namespace samchon.collections { preventDefault(): void; } } -/** - * @hidden - */ declare namespace samchon.collections.CollectionEvent { const INSERT: "insert"; const ERASE: "erase"; @@ -1025,6 +1022,27 @@ declare namespace samchon.collections { removeEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; } } +/** + * Collections, elements I/O detectable STL containers. + * + * STL Containers | Collections + * ---------------------|------------------- + * {@link Vector} | {@link ArrayCollection} + * {@link List} | {@link ListCollection} + * {@link Deque} | {@link DequeCollection} + * | + * {@link TreeSet} | {@link TreeSetCollection} + * {@link HashSet} | {@link HashSetCollection} + * {@link TreeMultiSet} | {@link TreeMultiSetCollection} + * {@link HashMultiSet} | {@link HashMultiSetCollection} + * | + * {@link TreeMap} | {@link TreeMapCollection} + * {@link HashMap} | {@link HashMapCollection} + * {@link TreeMultiMap} | {@link TreeMultiMapCollection} + * {@link HashMultiMap} | {@link HashMultiMapCollection} + * + * @author Jeongho Nam + */ declare namespace samchon.collections { /** * An interface for {@link IContainer containers} who can detect element I/O events. @@ -2976,6 +2994,27 @@ declare namespace samchon.library { * @return value. */ getValue(): string; + /** + * Get iterator to property element. + * + * Searches the {@link getPropertyMap properties} for an element with a identifier equivalent to key + * and returns an iterator to it if found, otherwise it returns an iterator to {@link HashMap.end end()}. + * + *

Two keys are considered equivalent if the properties' comparison object returns false reflexively + * (i.e., no matter the order in which the elements are passed as arguments).

+ * + * Another member function, {@link hasProperty hasProperty()} can be used to just check whether a particular + * key exists. + * + * ```xml + * {value} + * ``` + * + * @param key Key to be searched for + * @return An iterator to the element, if an element with specified key is found, or + * {@link end HashMap.end()} otherwise. + */ + findProperty(key: string): std.MapIterator; /** * Test whether a property exists. * @@ -3114,7 +3153,7 @@ declare namespace samchon.library { * * @param obj Target {@link XML} object to copy properties. */ - addAllProperties(obj: XML): void; + insertAllProperties(obj: XML): void; /** * Clear properties. * @@ -3528,7 +3567,7 @@ declare namespace samchon.templates.external { * @handbook [Templates - External System](https://github.com/samchon/framework/wiki/TypeScript-Templates-External_System) * @author Jeongho Nam */ - abstract class ExternalSystemArray extends protocol.EntityDequeCollection implements protocol.IProtocol { + abstract class ExternalSystemArray extends protocol.EntityDequeCollection implements protocol.IProtocol { /** * Default Constructor. */ @@ -3645,7 +3684,7 @@ declare namespace samchon.templates.parallel { * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System) * @author Jeongho Nam */ - abstract class ParallelSystemArray extends external.ExternalSystemArray { + abstract class ParallelSystemArray extends external.ExternalSystemArray { /** * @hidden */ @@ -3654,10 +3693,6 @@ declare namespace samchon.templates.parallel { * Default Constructor. */ constructor(); - /** - * @inheritdoc - */ - at(index: number): ParallelSystem; /** * Send an {@link Invoke} message with segment size. * @@ -3682,9 +3717,11 @@ declare namespace samchon.templates.parallel { * @param invoke An {@link Invoke} message requesting parallel process. * @param size Number of pieces to segment. * + * @return Number of {@link ParallelSystem slave systems} participating in the *Parallel Process*. + * * @see {@link sendPieceData}, {@link ParallelSystem.getPerformacen} */ - sendSegmentData(invoke: protocol.Invoke, size: number): void; + sendSegmentData(invoke: protocol.Invoke, size: number): number; /** * Send an {@link Invoke} message with range of pieces. * @@ -3713,9 +3750,11 @@ declare namespace samchon.templates.parallel { * all the pieces' indices between *first* and *last*, including the piece pointed by index * *first*, but not the piece pointed by the index *last*. * + * @return Number of {@link ParallelSystem slave systems} participating in the *Parallel Process*. + * * @see {@link sendSegmentData}, {@link ParallelSystem.getPerformacen} */ - sendPieceData(invoke: protocol.Invoke, first: number, last: number): void; + sendPieceData(invoke: protocol.Invoke, first: number, last: number): number; /** * @hidden */ @@ -3755,11 +3794,11 @@ declare namespace samchon.templates.distributed { * **distributed process** through the {@link DistributedProcess} object. You can access the * {@link DistributedProcess} object(s) with those methods: * - * - {@link hasRole} - * - {@link getRole} - * - {@link insertRole} - * - {@link eraseRole} - * - {@link getRoleMap} + * - {@link hasProcess} + * - {@link getProcess} + * - {@link insertProcess} + * - {@link eraseProcess} + * - {@link getProcessMap} * * When you need the **distributed process**, call the {@link DistributedProcess.sendData} method. Then the * {@link DistributedProcess} will find the most idle {@link DistributedSystem} object who represents a distributed @@ -3812,7 +3851,7 @@ declare namespace samchon.templates.distributed { * @handbook [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) * @author Jeongho Nam */ - abstract class DistributedSystemArray extends parallel.ParallelSystemArray { + abstract class DistributedSystemArray extends parallel.ParallelSystemArray { /** * @hidden */ @@ -3832,10 +3871,6 @@ declare namespace samchon.templates.distributed { * @return A new {@link DistributedProcess} object. */ protected abstract createProcess(xml: library.XML): DistributedProcess; - /** - * @inheritdoc - */ - at(index: number): DistributedSystem; /** * Get process map. * @@ -3880,7 +3915,7 @@ declare namespace samchon.templates.distributed { /** * @hidden */ - private estimate_role_performance(history); + private estimate_process_resource(history); /** * @hidden */ @@ -3903,7 +3938,7 @@ declare namespace samchon.templates.distributed { * system at the same time. This {@link DistributedSystemArrayMediator} be a master system, containing and managing * {@link DistributedSystem} objects, which represent distributed slave systems, by extending * {@link DistributedSystemArray} class. Also, be a slave system through {@link getMediator mediator} object, which is - * derived from the {@link SlavSystem} class. + * derived from the {@link SlaveSystem} class. * * As a master, you can specify this {@link DistributedSystemArrayMediator} class to be a master server accepting * slave clients or a master client to connecting slave servers. Even both of them is possible. Extends one @@ -3925,6 +3960,7 @@ declare namespace samchon.templates.distributed { * - A server slave accepting master client: * - {@link MediatorServer} * - {@link MediatorWebServer} + * - {@link MediatorDedicatedWorkerServer} * - {@link MediatorSharedWorkerServer} * * #### [Inherited] {@link DistributedSystemArray} @@ -3938,11 +3974,11 @@ declare namespace samchon.templates.distributed { * **distributed process** through the {@link DistributedProcess} object. You can access the * {@link DistributedProcess} object(s) with those methods: * - * - {@link hasRole} - * - {@link getRole} - * - {@link insertRole} - * - {@link eraseRole} - * - {@link getRoleMap} + * - {@link hasProcess} + * - {@link getProcess} + * - {@link insertProcess} + * - {@link eraseProcess} + * - {@link getProcessMap} * * When you need the **distributed process**, call the {@link DistributedProcess.sendData} method. Then the * {@link DistributedProcess} will find the most idle {@link DistributedSystem} object who represents a distributed @@ -3995,7 +4031,7 @@ declare namespace samchon.templates.distributed { * @handbook [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) * @author Jeongho Nam */ - abstract class DistributedSystemArrayMediator extends DistributedSystemArray { + abstract class DistributedSystemArrayMediator extends DistributedSystemArray { /** * @hidden */ @@ -4023,6 +4059,7 @@ declare namespace samchon.templates.distributed { * - A server slave accepting master client: * - {@link MediatorServer} * - {@link MediatorWebServer} + * - {@link MediatorDedicatedWorkerServer} * - {@link MediatorSharedWorkerServer} * * @return A newly created {@link MediatorSystem} object. @@ -4354,6 +4391,54 @@ declare namespace samchon.protocol { protected handle_close(): void; } } +declare namespace samchon.protocol { + /** + * A communicator for shared worker. + * + * {@link DedicatedWorkerCommunicator} is an abstract class for communication between DedicatedWorker and Web-browser. + * This {@link DedicatedWorkerCommunicator} is specified to {@link DedicatedWorkerServerConnector} and + * {@link DedicatedWorkerClientDriver} whether the remote system is a server (that my system is connecting to) or a + * client (a client conneting to to my server). + * + * #### Why DedicatedWorker be a server? + * In JavaScript environment, there's no way to implement multi-threading function. Instead, JavaScript supports the + * **Worker**, creating a new process. However, the **Worker** does not shares memory addresses. To integrate the + * **Worker** with its master, only communication with string or binary data is allowed. Doesn't it seem like a network + * communication? Furthermore, there's not any difference between the worker communication and network communication. + * It's the reason why Samchon Framework considers the **Worker** as a network node. + * + * The class {@link DedicatedWorkerCommunicator} is designed make such relationship. From now on, DedicatedWorker is a + * {@link DedicatedWorkerServer server} and {@link DedicatedWorkerServerConnector browser} is a client. Integrate the + * server and clients with this {@link DedicatedWorkerCommunicator}. + * + * #### [Inherited] {@link ICommunicator} + * {@link ICommunicator} is an interface for communicator classes who take full charge of network communication with + * remote system, without reference to whether the remote system is a server or a client. Type of the + * {@link ICommunicator} is specified to {@link IServerConnector} and {@link IClientDriver} whether the remote system + * is a server (that I've to connect) or a client (a client connected to my server). + * + * Whenever a replied message comes from the remote system, the message will be converted to an {@link Invoke} class + * and the {@link Invoke} object will be shifted to the {@link IProtocol listener}'s + * {@link IProtocol.replyData IProtocol.replyData()} method. + * + * + * + * + * + * @see {@link DedicatedWorkerClientDriver}, {@link DedicatedWorkerServerConnector}, {@link IProtocol} + * @reference https://developer.mozilla.org/en-US/docs/Web/API/DedicatedWorker + * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#icommunicator) + * @author Jeongho Nam + */ + abstract class DedicatedWorkerCommunicator extends CommunicatorBase { + /** + * @hidden + */ + protected handle_message(event: MessageEvent): void; + } +} declare namespace samchon.protocol { /** * A communicator for shared worker. @@ -4427,11 +4512,12 @@ declare namespace samchon.protocol { * {@link IServer.addClient IServer.addClient()}. Those are derived types from this {@link IClientDriver}, being * created by the matched {@link IServer} object. * - * Protocol | Derived Type | Created By - * ------------------------|----------------------------------|---------------------------- - * Samchon Framework's own | {@link ClientDriver} | {@link Server} - * Web-socket protocol | {@link WebClientDriver} | {@link WebServer} - * SharedWorker | {@link SharedWorkerClientDriver} | {@link SharedWorkerServer} + * Protocol | Derived Type | Created By + * ------------------------|-------------------------------------|---------------------------- + * Samchon Framework's own | {@link ClientDriver} | {@link Server} + * Web-socket protocol | {@link WebClientDriver} | {@link WebServer} + * DedicatedWorker | {@link DedicatedWorkerClinetDriver} | {@link DedicatedWorkerServer} + * SharedWorker | {@link SharedWorkerClientDriver} | {@link SharedWorkerServer} * * When you've got an {@link IClientDriver} object from the {@link IServer.addClient IServer.addClient()}, then * specify {@link IProtocol listener} with {@link IClient.listen IClient.listen()}. Whenever a replied message comes @@ -4482,11 +4568,12 @@ declare namespace samchon.protocol { * {@link IServer.addClient IServer.addClient()}. Those are derived types from this {@link IClientDriver}, being * created by the matched {@link IServer} object. * - * Protocol | Derived Type | Created By - * ------------------------|----------------------------------|---------------------------- - * Samchon Framework's own | {@link ClientDriver} | {@link Server} - * Web-socket protocol | {@link WebClientDriver} | {@link WebServer} - * SharedWorker | {@link SharedWorkerClientDriver} | {@link SharedWorkerServer} + * Protocol | Derived Type | Created By + * ------------------------|-------------------------------------|---------------------------- + * Samchon Framework's own | {@link ClientDriver} | {@link Server} + * Web-socket protocol | {@link WebClientDriver} | {@link WebServer} + * DedicatedWorker | {@link DedicatedWorkerClinetDriver} | {@link DedicatedWorkerServer} + * SharedWorker | {@link SharedWorkerClientDriver} | {@link SharedWorkerServer} * * When you've got an {@link IClientDriver} object from the {@link IServer.addClient IServer.addClient()}, then * specify {@link IProtocol listener} with {@link IClient.listen IClient.listen()}. Whenever a replied message comes @@ -4541,11 +4628,12 @@ declare namespace samchon.protocol { * {@link IServer.addClient IServer.addClient()}. Those are derived types from this {@link IClientDriver}, being * created by the matched {@link IServer} object. * - * Protocol | Derived Type | Created By - * ------------------------|----------------------------------|---------------------------- - * Samchon Framework's own | {@link ClientDriver} | {@link Server} - * Web-socket protocol | {@link WebClientDriver} | {@link WebServer} - * SharedWorker | {@link SharedWorkerClientDriver} | {@link SharedWorkerServer} + * Protocol | Derived Type | Created By + * ------------------------|-------------------------------------|---------------------------- + * Samchon Framework's own | {@link ClientDriver} | {@link Server} + * Web-socket protocol | {@link WebClientDriver} | {@link WebServer} + * DedicatedWorker | {@link DedicatedWorkerClinetDriver} | {@link DedicatedWorkerServer} + * SharedWorker | {@link SharedWorkerClientDriver} | {@link SharedWorkerServer} * * When you've got an {@link IClientDriver} object from the {@link IServer.addClient IServer.addClient()}, then * specify {@link IProtocol listener} with {@link IClient.listen IClient.listen()}. Whenever a replied message comes @@ -4600,6 +4688,79 @@ declare namespace samchon.protocol { getSessionID(): string; } } +declare namespace samchon.protocol { + /** + * Communicator with master web-browser. + * + * {@link DedicatedWorkerClientDriver} is a class taking full charge of network communication with web browsers. This + * {@link DedicatedWorkerClientDriver} object is always created by {@link DedicatedWorkerServer} class. When you got + * this {@link DedicatedWorkerClientDriver} object from + * {@link DedicatedWorkerServer.addClient DedicatedWorkerServer.addClient()}, then specify {@link IProtocol listener} + * with the {@link DedicatedWorkerClientDriver.listen DedicatedWorkerClientDriver.listen()} method. + * + * #### Why DedicatedWorker be a server? + * In JavaScript environment, there's no way to implement multi-threading function. Instead, JavaScript supports the + * **Worker**, creating a new process. However, the **Worker** does not shares memory addresses. To integrate the + * **Worker** with its master, only communication with string or binary data is allowed. Doesn't it seem like a network + * communication? Furthermore, there's not any difference between the worker communication and network communication. + * It's the reason why Samchon Framework considers the **Worker** as a network node. + * + * The class {@link DedicatedWorkerCommunicator} is designed make such relationship. From now on, DedicatedWorker is a + * {@link DedicatedWorkerServer server} and {@link DedicatedWorkerServerConnector browser} is a client. Integrate the + * server and clients with this {@link DedicatedWorkerCommunicator}. + * + * #### [Inherited] {@link IClientDriver} + * {@link IClientDriver} is a type of {@link ICommunicator}, specified for communication with remote client who has + * connected in a {@link IServer server}. It takes full charge of network communication with the remote client. + * + * The {@link IClientDriver} object is created and delivered from {@link IServer} and + * {@link IServer.addClient IServer.addClient()}. Those are derived types from this {@link IClientDriver}, being + * created by the matched {@link IServer} object. + * + * Protocol | Derived Type | Created By + * ------------------------|-------------------------------------|---------------------------- + * Samchon Framework's own | {@link ClientDriver} | {@link Server} + * Web-socket protocol | {@link WebClientDriver} | {@link WebServer} + * DedicatedWorker | {@link DedicatedWorkerClinetDriver} | {@link DedicatedWorkerServer} + * SharedWorker | {@link SharedWorkerClientDriver} | {@link SharedWorkerServer} + * + * When you've got an {@link IClientDriver} object from the {@link IServer.addClient IServer.addClient()}, then + * specify {@link IProtocol listener} with {@link IClient.listen IClient.listen()}. Whenever a replied message comes + * from the remote system, the message will be converted to an {@link Invoke} class and the {@link Invoke} object + * will be shifted to the {@link IProtocol listener}'s {@link IProtocol.replyData IProtocol.replyData()} method. + * Below code is an example specifying and managing the {@link IProtocol listener} objects. + * + * - https://github.com/samchon/framework/blob/master/ts/examples/calculator/calculator-server.ts + * + * + * + * + * + * @see {@link DedicatedWorkerServer}, {@link IProtocol} + * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iclientdriver) + * @author Jeongho Nam + */ + class DedicatedWorkerClientDriver extends DedicatedWorkerCommunicator implements IClientDriver { + /** + * Default Constructor. + */ + constructor(); + /** + * @inheritdoc + */ + listen(listener: IProtocol): void; + /** + * @inheritdoc + */ + close(): void; + /** + * @inheritdoc + */ + sendData(invoke: Invoke): void; + } +} declare namespace samchon.protocol { /** * Communicator with remote web-browser. @@ -4628,11 +4789,12 @@ declare namespace samchon.protocol { * {@link IServer.addClient IServer.addClient()}. Those are derived types from this {@link IClientDriver}, being * created by the matched {@link IServer} object. * - * Protocol | Derived Type | Created By - * ------------------------|----------------------------------|---------------------------- - * Samchon Framework's own | {@link ClientDriver} | {@link Server} - * Web-socket protocol | {@link WebClientDriver} | {@link WebServer} - * SharedWorker | {@link SharedWorkerClientDriver} | {@link SharedWorkerServer} + * Protocol | Derived Type | Created By + * ------------------------|-------------------------------------|---------------------------- + * Samchon Framework's own | {@link ClientDriver} | {@link Server} + * Web-socket protocol | {@link WebClientDriver} | {@link WebServer} + * DedicatedWorker | {@link DedicatedWorkerClinetDriver} | {@link DedicatedWorkerServer} + * SharedWorker | {@link SharedWorkerClientDriver} | {@link SharedWorkerServer} * * When you've got an {@link IClientDriver} object from the {@link IServer.addClient IServer.addClient()}, then * specify {@link IProtocol listener} with {@link IClient.listen IClient.listen()}. Whenever a replied message comes @@ -4664,48 +4826,13 @@ declare namespace samchon.protocol { listen(listener: IProtocol): void; } } -declare namespace samchon.protocol { - abstract class DedicatedWorker implements IProtocol { - private communicator_; - /** - * Default Constructor. - */ - constructor(); - abstract replyData(invoke: protocol.Invoke): void; - sendData(invoke: Invoke): void; - } -} -declare namespace samchon.protocol { - class DedicatedWorkerConnector extends CommunicatorBase implements IServerConnector { - private worker; - /** - * @inheritdoc - */ - onConnect: Function; - /** - * @inheritdoc - */ - onClose: Function; - constructor(listener: IProtocol); - /** - * @inheritdoc - */ - connect(jsFile: string): void; - /** - * @inheritdoc - */ - close(): void; - sendData(invoke: Invoke): void; - replyData(invoke: Invoke): void; - private handle_message(event); - } -} declare namespace samchon.protocol { /** * A container of entity, and it's a type of entity, too. * * ![Class Diagram](http://samchon.github.io/framework/images/design/ts_class_diagram/protocol_message_protocol.png) * + * @handbook [Protocol - Standard Message](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Standard_Message) * @author Jeongho Nam */ interface IEntityGroup extends IEntity, std.base.IContainer { @@ -5007,8 +5134,18 @@ declare namespace samchon.protocol { getArguments(): Array; /** * Apply to a matched function. + * + * @param obj Target {@link IProtocol} object to find matched function. + * @return Whether succeded to find matched function. */ apply(obj: IProtocol): boolean; + /** + * Apply to a function. + * + * @param thisArg Owner of the function. + * @param func Function to call. + */ + apply(thisArg: IProtocol, func: Function): void; /** * @inheritdoc */ @@ -5236,11 +5373,12 @@ declare namespace samchon.protocol { * overrides {@link addClient addClient()} method who accepts a newly connected client as an {@link IClientDriver} * object. Then at last, call {@link open open()} method with specified port number. * - * Protocol | Derived Type | Related {@link IClientDriver} - * ---------|--------------|------------------------------- - * Samchon Framework's own | {@link Server} | {@link ClientDriver} - * Web-socket protocol | {@link WebServer} | {@link WebClientDriver} - * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerClientDriver} + * Protocol | Derived Type | Related {@link IClientDriver} + * ------------------------|-------------------------------|------------------------------------- + * Samchon Framework's own | {@link Server} | {@link ClientDriver} + * Web-socket protocol | {@link WebServer} | {@link WebClientDriver} + * DedicatedWorker | {@link DedicatedWorkerServer} | {@link DedicatedWorkerClientDriver} + * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerClientDriver} * * Below codes and classes will be good examples for comprehending how to open a server and handle remote clients. * - https://github.com/samchon/framework/blob/master/ts/examples/calculator/calculator-server.ts @@ -5311,11 +5449,12 @@ declare namespace samchon.protocol { * overrides {@link addClient addClient()} method who accepts a newly connected client as an {@link IClientDriver} * object. Then at last, call {@link open open()} method with specified port number. * - * Protocol | Derived Type | Related {@link IClientDriver} - * ---------|--------------|------------------------------- - * Samchon Framework's own | {@link Server} | {@link ClientDriver} - * Web-socket protocol | {@link WebServer} | {@link WebClientDriver} - * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerClientDriver} + * Protocol | Derived Type | Related {@link IClientDriver} + * ------------------------|-------------------------------|------------------------------------- + * Samchon Framework's own | {@link Server} | {@link ClientDriver} + * Web-socket protocol | {@link WebServer} | {@link WebClientDriver} + * DedicatedWorker | {@link DedicatedWorkerServer} | {@link DedicatedWorkerClientDriver} + * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerClientDriver} * * Below codes and classes will be good examples for comprehending how to open a server and handle remote clients. * - https://github.com/samchon/framework/blob/master/ts/examples/calculator/calculator-server.ts @@ -5375,11 +5514,12 @@ declare namespace samchon.protocol { * overrides {@link addClient addClient()} method who accepts a newly connected client as an {@link IClientDriver} * object. Then at last, call {@link open open()} method with specified port number. * - * Protocol | Derived Type | Related {@link IClientDriver} - * ---------|--------------|------------------------------- - * Samchon Framework's own | {@link Server} | {@link ClientDriver} - * Web-socket protocol | {@link WebServer} | {@link WebClientDriver} - * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerClientDriver} + * Protocol | Derived Type | Related {@link IClientDriver} + * ------------------------|-------------------------------|------------------------------------- + * Samchon Framework's own | {@link Server} | {@link ClientDriver} + * Web-socket protocol | {@link WebServer} | {@link WebClientDriver} + * DedicatedWorker | {@link DedicatedWorkerServer} | {@link DedicatedWorkerClientDriver} + * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerClientDriver} * * Below codes and classes will be good examples for comprehending how to open a server and handle remote clients. * - https://github.com/samchon/framework/blob/master/ts/examples/calculator/calculator-server.ts @@ -5443,13 +5583,82 @@ declare namespace samchon.protocol { private issue_session_id(); } } +declare namespace samchon.protocol { + /** + * A SharedWorker server. + * + * The {@link DedicatedWorkerServer} is an abstract class is realized to open a DedicatedWorker server and accept + * web-browser client (master). Extends this {@link DedicatedWorkerServer} class and overrides + * {@link addClient addClient()} method to define what to do with a newly connected + * {@link DedicatedWorkerClientDriver remote client}. + * + * #### Why DedicatedWorker be a server? + * In JavaScript environment, there's no way to implement multi-threading function. Instead, JavaScript supports the + * **Worker**, creating a new process. However, the **Worker** does not shares memory addresses. To integrate the + * **Worker** with its master, only communication with string or binary data is allowed. Doesn't it seem like a network + * communication? Furthermore, there's not any difference between the worker communication and network communication. + * It's the reason why Samchon Framework considers the **Worker** as a network node. + * + * The class {@link DedicatedWorkerCommunicator} is designed make such relationship. From now on, DedicatedWorker is a + * {@link DedicatedWorkerServer server} and {@link DedicatedWorkerServerConnector browser} is a client. Integrate the + * server and clients with this {@link DedicatedWorkerCommunicator}. + * + * #### [Inherited] {@link IServer} + * {@link IServer} is an interfaec for server classes who are providing methods for {@link open opening a server} and + * {@link IClientDriver accepting clients}. + * + * To open a server, extends one of derived class under below considedring which protocol to follow first. At next, + * overrides {@link addClient addClient()} method who accepts a newly connected client as an {@link IClientDriver} + * object. Then at last, call {@link open open()} method with specified port number. + * + * Protocol | Derived Type | Related {@link IClientDriver} + * ------------------------|-------------------------------|------------------------------------- + * Samchon Framework's own | {@link Server} | {@link ClientDriver} + * Web-socket protocol | {@link WebServer} | {@link WebClientDriver} + * DedicatedWorker | {@link DedicatedWorkerServer} | {@link DedicatedWorkerClientDriver} + * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerClientDriver} + * + * Below codes and classes will be good examples for comprehending how to open a server and handle remote clients. + * - https://github.com/samchon/framework/blob/master/ts/examples/calculator/calculator-server.ts + * - https://github.com/samchon/framework/blob/master/ts/examples/chat-server/server.ts + * - {@link service.Server} + * - {@link external.ExternalClientArray} + * - {@link slave.SlaveServer} + * + * If you're embarrased because your class already extended another one, then use {@link IServerBase}. + * + * + * + * + * + * @see {@link DedicatedWorkerClientDriver}, {@link DedicatedWorkerServerBase} + * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iserver) + * @author Jeongho Nam + */ + abstract class DedicatedWorkerServer implements IServer { + /** + * @inheritdoc + */ + open(): void; + /** + * @inheritdoc + */ + close(): void; + /** + * @inheritdoc + */ + abstract addClient(driver: DedicatedWorkerClientDriver): void; + } +} declare namespace samchon.protocol { /** * A SharedWorker server. * * The {@link SharedWorker} is an abstract class is realized to open a SharedWorker server and accept web-browser * clients. Extends this {@link SharedWorkerServer} class and overrides {@link addClient addClient()} method to - * define what to do with newly connected {@link ClientDriver remote clients}. + * define what to do with newly connected {@link SharedWorkerClientDriver remote clients}. * * #### Why SharedWorker be a server? * SharedWorker, it allows only an instance (process) to be created whether the SharedWorker is declared in a browser @@ -5469,11 +5678,12 @@ declare namespace samchon.protocol { * overrides {@link addClient addClient()} method who accepts a newly connected client as an {@link IClientDriver} * object. Then at last, call {@link open open()} method with specified port number. * - * Protocol | Derived Type | Related {@link IClientDriver} - * ---------|--------------|------------------------------- - * Samchon Framework's own | {@link Server} | {@link ClientDriver} - * Web-socket protocol | {@link WebServer} | {@link WebClientDriver} - * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerClientDriver} + * Protocol | Derived Type | Related {@link IClientDriver} + * ------------------------|-------------------------------|------------------------------------- + * Samchon Framework's own | {@link Server} | {@link ClientDriver} + * Web-socket protocol | {@link WebServer} | {@link WebClientDriver} + * DedicatedWorker | {@link DedicatedWorkerServer} | {@link DedicatedWorkerClientDriver} + * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerClientDriver} * * Below codes and classes will be good examples for comprehending how to open a server and handle remote clients. * - https://github.com/samchon/framework/blob/master/ts/examples/calculator/calculator-server.ts @@ -5524,11 +5734,12 @@ declare namespace samchon.protocol { * the {@link IServer} interface, create an {@link IServerBase} member, and write simple hooks to route calls into * the aggregated {@link IServerBase}. * - * Protocol | {@link IServer} | {@link IServerBase} | {@link IClientDriver} - * ---------|-----------------|---------------------|----------------------- - * Samchon Framework's own | {@link Server} | {@link ServerBase} | {@link ClientDriver} - * Web-socket protocol | {@link WebServer} | {@link WebServerBase} | {@link WebClientDriver} - * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerServerBase} | {@link SharedWorkerClientDriver} + * Protocol | {@link IServer} | {@link IServerBase} | {@link IClientDriver} + * ------------------------|-------------------------------|-----------------------------------|------------------------------------- + * Samchon Framework's own | {@link Server} | {@link ServerBase} | {@link ClientDriver} + * Web-socket protocol | {@link WebServer} | {@link WebServerBase} | {@link WebClientDriver} + * DedicatedWorker | {@link DedicatedWorkerServer} | {@link DedicatedWorkerServerBase} | {@link DedicatedWorkerClientDriver} + * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerServerBase} | {@link SharedWorkerClientDriver} * * After the hooking to aggregated {@link IServerBase} object, overrides {@link addClient addClient()} method who * accepts a newly connected client as an {@link IClientDriver} object. At last, call {@link open open()} method with @@ -5582,11 +5793,12 @@ declare namespace samchon.protocol { * the {@link IServer} interface, create an {@link IServerBase} member, and write simple hooks to route calls into * the aggregated {@link IServerBase}. * - * Protocol | {@link IServer} | {@link IServerBase} | {@link IClientDriver} - * ---------|-----------------|---------------------|----------------------- - * Samchon Framework's own | {@link Server} | {@link ServerBase} | {@link ClientDriver} - * Web-socket protocol | {@link WebServer} | {@link WebServerBase} | {@link WebClientDriver} - * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerServerBase} | {@link SharedWorkerClientDriver} + * Protocol | {@link IServer} | {@link IServerBase} | {@link IClientDriver} + * ------------------------|-------------------------------|-----------------------------------|------------------------------------- + * Samchon Framework's own | {@link Server} | {@link ServerBase} | {@link ClientDriver} + * Web-socket protocol | {@link WebServer} | {@link WebServerBase} | {@link WebClientDriver} + * DedicatedWorker | {@link DedicatedWorkerServer} | {@link DedicatedWorkerServerBase} | {@link DedicatedWorkerClientDriver} + * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerServerBase} | {@link SharedWorkerClientDriver} * * After the hooking to aggregated {@link IServerBase} object, overrides {@link addClient addClient()} method who * accepts a newly connected client as an {@link IClientDriver} object. At last, call {@link open open()} method with @@ -5647,6 +5859,7 @@ declare namespace samchon.protocol { * * The {@link WebServerBase} is a substitute class who subrogates {@link WebServer}'s responsibility. * + * #### [Inherited] {@link IServerBase} * {@link IServerBase} is an interface for substitue server classes who subrogate server's role. * * The easiest way to defining a server class is to extending one of them below, who implemented the {@link IServer}. @@ -5654,11 +5867,12 @@ declare namespace samchon.protocol { * the {@link IServer} interface, create an {@link IServerBase} member, and write simple hooks to route calls into * the aggregated {@link IServerBase}. * - * Protocol | {@link IServer} | {@link IServerBase} | {@link IClientDriver} - * ---------|-----------------|---------------------|----------------------- - * Samchon Framework's own | {@link Server} | {@link ServerBase} | {@link ClientDriver} - * Web-socket protocol | {@link WebServer} | {@link WebServerBase} | {@link WebClientDriver} - * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerServerBase} | {@link SharedWorkerClientDriver} + * Protocol | {@link IServer} | {@link IServerBase} | {@link IClientDriver} + * ------------------------|-------------------------------|-----------------------------------|------------------------------------- + * Samchon Framework's own | {@link Server} | {@link ServerBase} | {@link ClientDriver} + * Web-socket protocol | {@link WebServer} | {@link WebServerBase} | {@link WebClientDriver} + * DedicatedWorker | {@link DedicatedWorkerServer} | {@link DedicatedWorkerServerBase} | {@link DedicatedWorkerClientDriver} + * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerServerBase} | {@link SharedWorkerClientDriver} * * After the hooking to aggregated {@link IServerBase} object, overrides {@link addClient addClient()} method who * accepts a newly connected client as an {@link IClientDriver} object. At last, call {@link open open()} method with @@ -5714,11 +5928,12 @@ declare namespace samchon.protocol { } declare namespace samchon.protocol { /** - * A substitute {@link SharedWorkerServer}. + * A substitute {@link DedicatedWorkerServer}. * - * The {@link SharedWorkerServerBase} is a substitute class who subrogates {@link SharedWorkerServer}'s + * The {@link DedicatedWorkerServerBase} is a substitute class who subrogates {@link DedicatedWorkerServer}'s * responsibility. * + * #### [Inherited] {@link IServerBase} * {@link IServerBase} is an interface for substitue server classes who subrogate server's role. * * The easiest way to defining a server class is to extending one of them below, who implemented the {@link IServer}. @@ -5726,11 +5941,86 @@ declare namespace samchon.protocol { * the {@link IServer} interface, create an {@link IServerBase} member, and write simple hooks to route calls into * the aggregated {@link IServerBase}. * - * Protocol | {@link IServer} | {@link IServerBase} | {@link IClientDriver} - * ---------|-----------------|---------------------|----------------------- - * Samchon Framework's own | {@link Server} | {@link ServerBase} | {@link ClientDriver} - * Web-socket protocol | {@link WebServer} | {@link WebServerBase} | {@link WebClientDriver} - * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerServerBase} | {@link SharedWorkerClientDriver} + * Protocol | {@link IServer} | {@link IServerBase} | {@link IClientDriver} + * ------------------------|-------------------------------|-----------------------------------|------------------------------------- + * Samchon Framework's own | {@link Server} | {@link ServerBase} | {@link ClientDriver} + * Web-socket protocol | {@link WebServer} | {@link WebServerBase} | {@link WebClientDriver} + * DedicatedWorker | {@link DedicatedWorkerServer} | {@link DedicatedWorkerServerBase} | {@link DedicatedWorkerClientDriver} + * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerServerBase} | {@link SharedWorkerClientDriver} + * + * After the hooking to aggregated {@link IServerBase} object, overrides {@link addClient addClient()} method who + * accepts a newly connected client as an {@link IClientDriver} object. At last, call {@link open open()} method with + * specified port number. + * + * ```typescript + * class MyServer extends Something implements IServer + * { + * private server_base_: IServerBase = new WebServerBase(this); + * + * public addClient(driver: IClientDriver): void + * { + * // WHAT TO DO WHEN A CLIENT HAS CONNECTED + * } + * + * public open(port: number): void + * { + * this.server_base_.open(); + * } + * public close(): void + * { + * this.server_base_.close(); + * } + * } + * ``` + * + * + * + * + * + * @see {@link DedicatedWorkerServer}, {@link DedicatedWorkerClientDriver} + * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iserverbase) + * @author Jeongho Nam + */ + class DedicatedWorkerServerBase extends DedicatedWorkerServer implements IServerBase { + /** + * @hidden + */ + private hooker_; + /** + * Construct from a *hooker*. + * + * @param hooker A hooker throwing responsibility of server's role. + */ + constructor(hooker: IServer); + /** + * @inheritdoc + */ + addClient(driver: IClientDriver): void; + } +} +declare namespace samchon.protocol { + /** + * A substitute {@link SharedWorkerServer}. + * + * The {@link SharedWorkerServerBase} is a substitute class who subrogates {@link SharedWorkerServer}'s + * responsibility. + * + * #### [Inherited] {@link IServerBase} + * {@link IServerBase} is an interface for substitue server classes who subrogate server's role. + * + * The easiest way to defining a server class is to extending one of them below, who implemented the {@link IServer}. + * However, it is impossible (that is, if the class is already extending another class), you can instead implement + * the {@link IServer} interface, create an {@link IServerBase} member, and write simple hooks to route calls into + * the aggregated {@link IServerBase}. + * + * Protocol | {@link IServer} | {@link IServerBase} | {@link IClientDriver} + * ------------------------|-------------------------------|-----------------------------------|------------------------------------- + * Samchon Framework's own | {@link Server} | {@link ServerBase} | {@link ClientDriver} + * Web-socket protocol | {@link WebServer} | {@link WebServerBase} | {@link WebClientDriver} + * DedicatedWorker | {@link DedicatedWorkerServer} | {@link DedicatedWorkerServerBase} | {@link DedicatedWorkerClientDriver} + * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerServerBase} | {@link SharedWorkerClientDriver} * * After the hooking to aggregated {@link IServerBase} object, overrides {@link addClient addClient()} method who * accepts a newly connected client as an {@link IClientDriver} object. At last, call {@link open open()} method with @@ -5803,11 +6093,12 @@ declare namespace samchon.protocol { * Note that, protocol of this client and remote server must be matched. Thus, before determining specific type of * this {@link IServerConnector}, you've to consider which protocol and type the remote server follows. * - * Protocol | Derived Type | Connect to - * ---------|--------------|--------------- - * Samchon Framework's own | {@link ServerConnector} | {@link Server} - * Web-socket protocol | {@link WebServerConnector} | {@link WebServer} - * SharedWorker | {@link SharedWorkerServerConnector} | {@link SharedWorkerServer} + * Protocol | Derived Type | Connect to + * ------------------------|----------------------------------------|------------------------------- + * Samchon Framework's own | {@link ServerConnector} | {@link Server} + * Web-socket protocol | {@link WebServerConnector} | {@link WebServer} + * DedicatedWorker | {@link DedicatedWorkerServerConnector} | {@link DedicatedWorkerServer} + * SharedWorker | {@link SharedWorkerServerConnector} | {@link SharedWorkerServer} * * ![Class Diagram](http://samchon.github.io/framework/images/design/ts_class_diagram/protocol_basic_components.png) * @@ -5867,11 +6158,12 @@ declare namespace samchon.protocol { * Note that, protocol of this client and remote server must be matched. Thus, before determining specific type of * this {@link IServerConnector}, you've to consider which protocol and type the remote server follows. * - * Protocol | Derived Type | Connect to - * ---------|--------------|--------------- - * Samchon Framework's own | {@link ServerConnector} | {@link Server} - * Web-socket protocol | {@link WebServerConnector} | {@link WebServer} - * SharedWorker | {@link SharedWorkerServerConnector} | {@link SharedWorkerServer} + * Protocol | Derived Type | Connect to + * ------------------------|----------------------------------------|------------------------------- + * Samchon Framework's own | {@link ServerConnector} | {@link Server} + * Web-socket protocol | {@link WebServerConnector} | {@link WebServer} + * DedicatedWorker | {@link DedicatedWorkerServerConnector} | {@link DedicatedWorkerServer} + * SharedWorker | {@link SharedWorkerServerConnector} | {@link SharedWorkerServer} * * ![Class Diagram](http://samchon.github.io/framework/images/design/ts_class_diagram/protocol_basic_components.png) * @@ -5922,11 +6214,12 @@ declare namespace samchon.protocol { * Note that, protocol of this client and remote server must be matched. Thus, before determining specific type of * this {@link IServerConnector}, you've to consider which protocol and type the remote server follows. * - * Protocol | Derived Type | Connect to - * ---------|--------------|--------------- - * Samchon Framework's own | {@link ServerConnector} | {@link Server} - * Web-socket protocol | {@link WebServerConnector} | {@link WebServer} - * SharedWorker | {@link SharedWorkerServerConnector} | {@link SharedWorkerServer} + * Protocol | Derived Type | Connect to + * ------------------------|----------------------------------------|------------------------------- + * Samchon Framework's own | {@link ServerConnector} | {@link Server} + * Web-socket protocol | {@link WebServerConnector} | {@link WebServer} + * DedicatedWorker | {@link DedicatedWorkerServerConnector} | {@link DedicatedWorkerServer} + * SharedWorker | {@link SharedWorkerServerConnector} | {@link SharedWorkerServer} * * ![Class Diagram](http://samchon.github.io/framework/images/design/ts_class_diagram/protocol_basic_components.png) * @@ -5997,6 +6290,81 @@ declare namespace samchon.protocol { private handle_node_connect(connection); } } +declare namespace samchon.protocol { + /** + * A server connector for DedicatedWorker. + * + * {@link DedicatedWorkerServerConnector} is a class connecting to SharedWorker and taking full charge of network + * communication with the SharedWorker. Create an {@link DedicatedWorkerServer} instance from the + * {@IProtocol listener} and call the {@link connect connect()} method. + * + * #### Why DedicatedWorker be a server? + * In JavaScript environment, there's no way to implement multi-threading function. Instead, JavaScript supports the + * **Worker**, creating a new process. However, the **Worker** does not shares memory addresses. To integrate the + * **Worker** with its master, only communication with string or binary data is allowed. Doesn't it seem like a network + * communication? Furthermore, there's not any difference between the worker communication and network communication. + * It's the reason why Samchon Framework considers the **Worker** as a network node. + * + * The class {@link DedicatedWorkerCommunicator} is designed make such relationship. From now on, DedicatedWorker is a + * {@link DedicatedWorkerServer server} and {@link DedicatedWorkerServerConnector browser} is a client. Integrate the + * server and clients with this {@link DedicatedWorkerCommunicator}. + * + * #### [Inherited] {@link IServerConnector} + * {@link IServerConnector} is a type of {@link ICommunicator}, specified for server connector classes who connect to + * the remote server as a client. {@link IServerConnector} provides {@link connect connection method} and takes full + * charge of network communication with the remote server. + * + * Declare specific type of {@link IServerConnector} from {@link IProtocol listener} and call the + * {@link connect connect()} method. Then whenever a replied message comes from the remote system, the message will + * be converted to an {@link Invoke} class and the {@link Invoke} object will be shifted to the + * {@link IProtocol listener}'s {@link IProtocol.replyData IProtocol.replyData()} method. + * + * Note that, protocol of this client and remote server must be matched. Thus, before determining specific type of + * this {@link IServerConnector}, you've to consider which protocol and type the remote server follows. + * + * Protocol | Derived Type | Connect to + * ------------------------|----------------------------------------|------------------------------- + * Samchon Framework's own | {@link ServerConnector} | {@link Server} + * Web-socket protocol | {@link WebServerConnector} | {@link WebServer} + * DedicatedWorker | {@link DedicatedWorkerServerConnector} | {@link DedicatedWorkerServer} + * SharedWorker | {@link SharedWorkerServerConnector} | {@link SharedWorkerServer} + * + * ![Class Diagram](http://samchon.github.io/framework/images/design/ts_class_diagram/protocol_basic_components.png) + * + * @see {@link DedicatedWorkerServer}, {@link IProtocol} + * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iserverconnector) + * @author Jeongho Nam + */ + class DedicatedWorkerServerConnector extends DedicatedWorkerCommunicator implements IServerConnector { + /** + * @hidden + */ + private worker; + /** + * @inheritdoc + */ + onConnect: Function; + /** + * Construct from *listener*. + * + * @param listener A listener object to listen replied message from newly connected client in + * {@link IProtocol.replyData replyData()} as an {@link Invoke} object. + */ + constructor(listener: IProtocol); + /** + * @inheritdoc + */ + connect(jsFile: string): void; + /** + * @inheritdoc + */ + close(): void; + /** + * @inheritdoc + */ + sendData(invoke: Invoke): void; + } +} declare namespace samchon.protocol { /** * A server connector for SharedWorker. @@ -6028,11 +6396,12 @@ declare namespace samchon.protocol { * Note that, protocol of this client and remote server must be matched. Thus, before determining specific type of * this {@link IServerConnector}, you've to consider which protocol and type the remote server follows. * - * Protocol | Derived Type | Connect to - * ---------|--------------|--------------- - * Samchon Framework's own | {@link ServerConnector} | {@link Server} - * Web-socket protocol | {@link WebServerConnector} | {@link WebServer} - * SharedWorker | {@link SharedWorkerServerConnector} | {@link SharedWorkerServer} + * Protocol | Derived Type | Connect to + * ------------------------|----------------------------------------|------------------------------- + * Samchon Framework's own | {@link ServerConnector} | {@link Server} + * Web-socket protocol | {@link WebServerConnector} | {@link WebServer} + * DedicatedWorker | {@link DedicatedWorkerServerConnector} | {@link DedicatedWorkerServer} + * SharedWorker | {@link SharedWorkerServerConnector} | {@link SharedWorkerServer} * * ![Class Diagram](http://samchon.github.io/framework/images/design/ts_class_diagram/protocol_basic_components.png) * @@ -6102,7 +6471,7 @@ declare namespace samchon.templates.distributed { * Extends this {@link DistributedClientArray}, overrides {@link createServerBase createServerBase()} to determine * which protocol to follow and {@link createExternalClient createExternalClient()} creating child * {@link DistributedSystem} object. After the extending and overridings, open this server using the - * {@liok open open()} method. + * {@link open open()} method. * * #### [Inherited] {@link DistributedSystemArray} * The {@link DistributedSystemArray} is an abstract class containing and managing remote distributed **slave** system @@ -6115,11 +6484,11 @@ declare namespace samchon.templates.distributed { * **distributed process** through the {@link DistributedProcess} object. You can access the * {@link DistributedProcess} object(s) with those methods: * - * - {@link hasRole} - * - {@link getRole} - * - {@link insertRole} - * - {@link eraseRole} - * - {@link getRoleMap} + * - {@link hasProcess} + * - {@link getProcess} + * - {@link insertProcess} + * - {@link eraseProcess} + * - {@link getProcessMap} * * When you need the **distributed process**, call the {@link DistributedProcess.sendData} method. Then the * {@link DistributedProcess} will find the most idle {@link DistributedSystem} object who represents a distributed @@ -6172,7 +6541,7 @@ declare namespace samchon.templates.distributed { * @handbook [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) * @author Jeongho Nam */ - abstract class DistributedClientArray extends DistributedSystemArray implements external.IExternalClientArray { + abstract class DistributedClientArray extends DistributedSystemArray implements external.IExternalClientArray { /** * @hidden */ @@ -6218,7 +6587,7 @@ declare namespace samchon.templates.distributed { * @param xml An {@link XML} object represents the child {@link ParallelSystem} object. * @return ```null``` */ - createChild(xml: library.XML): DistributedSystem; + createChild(xml: library.XML): System; /** * Factory method creating {@link DistributedSystem} object. * @@ -6234,7 +6603,7 @@ declare namespace samchon.templates.distributed { * @param driver A communicator with the parallel client. * @return A newly created {@link ParallelSystem} object. */ - protected abstract createExternalClient(driver: protocol.IClientDriver): DistributedSystem; + protected abstract createExternalClient(driver: protocol.IClientDriver): System; /** * @inheritdoc */ @@ -6262,7 +6631,7 @@ declare namespace samchon.templates.distributed { * system at the same time. This {@link DistributedSystemArrayMediator} be a master system, containing and managing * {@link DistributedSystem} objects, which represent distributed slave systems, by extending * {@link DistributedSystemArray} class. Also, be a slave system through {@link getMediator mediator} object, which is - * derived from the {@link SlavSystem} class. + * derived from the {@link SlaveSystem} class. * * As a slave, you can specify this {@link DistributedSystemArrayMediator} to be a client slave connecting to master * server or a server slave accepting master client by overriding the {@link createMediator} method. @@ -6275,6 +6644,7 @@ declare namespace samchon.templates.distributed { * - A server slave accepting master client: * - {@link MediatorServer} * - {@link MediatorWebServer} + * - {@link MediatorDedicatedWorkerServer} * - {@link MediatorSharedWorkerServer} * * #### [Inherited] {@link DistributedSystemArray} @@ -6288,11 +6658,11 @@ declare namespace samchon.templates.distributed { * **distributed process** through the {@link DistributedProcess} object. You can access the * {@link DistributedProcess} object(s) with those methods: * - * - {@link hasRole} - * - {@link getRole} - * - {@link insertRole} - * - {@link eraseRole} - * - {@link getRoleMap} + * - {@link hasProcess} + * - {@link getProcess} + * - {@link insertProcess} + * - {@link eraseProcess} + * - {@link getProcessMap} * * When you need the **distributed process**, call the {@link DistributedProcess.sendData} method. Then the * {@link DistributedProcess} will find the most idle {@link DistributedSystem} object who represents a distributed @@ -6345,7 +6715,7 @@ declare namespace samchon.templates.distributed { * @handbook [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) * @author Jeongho Nam */ - abstract class DistributedClientArrayMediator extends DistributedSystemArrayMediator implements external.IExternalClientArray { + abstract class DistributedClientArrayMediator extends DistributedSystemArrayMediator implements external.IExternalClientArray { /** * A subrogator of {@link IServer server}'s role instead of this {@link ExternalClientArray}. */ @@ -6393,7 +6763,7 @@ declare namespace samchon.templates.distributed { * @param xml An {@link XML} object represents the child {@link DistributedSystem} object. * @return null */ - createChild(xml: library.XML): DistributedSystem; + createChild(xml: library.XML): System; /** * Factory method creating {@link DistributedSystem} object. * @@ -6409,7 +6779,7 @@ declare namespace samchon.templates.distributed { * @param driver A communicator with the distributed client. * @return A newly created {@link DistributedSystem} object. */ - protected abstract createExternalClient(driver: protocol.IClientDriver): DistributedSystem; + protected abstract createExternalClient(driver: protocol.IClientDriver): System; /** * @inheritdoc */ @@ -6422,7 +6792,7 @@ declare namespace samchon.templates.distributed { } declare namespace samchon.templates.distributed { /** - * A role of Distributed Processing System. + * A process of Distributed Processing System. * * The {@link DistributedProcess} is an abstract class who represents a **process**, *SOMETHING TO DISTRIBUTE* in a Distributed * Processing System. Overrides the {@link DistributedProcess} and defines the *SOMETHING TO DISTRIBUTE*. @@ -6484,7 +6854,7 @@ declare namespace samchon.templates.distributed { * * @param systemArray The parent {@link DistributedSystemArray} object. */ - constructor(systemArray: DistributedSystemArray); + constructor(systemArray: DistributedSystemArray); /** * Identifier of {@link ParallelProcess} is its {@link name}. */ @@ -6494,7 +6864,13 @@ declare namespace samchon.templates.distributed { * * @return The parent {@link DistributedSystemArray} object. */ - getSystemArray(): DistributedSystemArray; + getSystemArray(): DistributedSystemArray; + /** + * Get parent {@link DistributedSystemArray} object. + * + * @return The parent {@link DistributedSystemArray} object. + */ + getSystemArray>(): SystemArray; /** * Get name, who represents and identifies this process. */ @@ -6502,14 +6878,14 @@ declare namespace samchon.templates.distributed { /** * Get resource index. * - * Get *resource index* that indicates how much this {@link DistributedProcess role} is heavy. + * Get *resource index* that indicates how much this {@link DistributedProcess process} is heavy. * - * If this {@link DistributedProcess role} does not have any {@link Invoke} message had handled, then the + * If this {@link DistributedProcess process} does not have any {@link Invoke} message had handled, then the * *resource index* will be ```1.0```, which means default and average value between all * {@link DistributedProcess} instances (that are belonged to a same {@link DistributedSystemArray} object). * * You can specify the *resource index* by yourself, but notice that, if the *resource index* is higher than - * other {@link DistributedProcess} objects, then this {@link DistributedProcess role} will be ordered to + * other {@link DistributedProcess} objects, then this {@link DistributedProcess process} will be ordered to * handle less processes than other {@link DistributedProcess} objects. Otherwise, the *resource index* is * lower than others, of course, much processes will be requested. * @@ -6525,7 +6901,7 @@ declare namespace samchon.templates.distributed { /** * Set resource index. * - * Set *resource index* that indicates how much this {@link DistributedProcess role} is heavy. This + * Set *resource index* that indicates how much this {@link DistributedProcess process} is heavy. This * *resource index* can be **revaulated**. * * Note that, initial and average *resource index* of {@link DistributedProcess} objects are ```1.0```. If the @@ -6535,10 +6911,10 @@ declare namespace samchon.templates.distributed { * * Unlike {@link enforceResource}, configuring *resource index* by this {@link setResource} allows the * **revaluation**. This **revaluation** prevents wrong valuation from user. For example, you *mis-valuated* the - * *resource index*. The {@link DistributedProcess role} is much heavier than any other, but you estimated it + * *resource index*. The {@link DistributedProcess process} is much heavier than any other, but you estimated it * to the lightest one. It looks like a terrible case that causes * {@link DistributedSystemArray entire distributed processing system} to be slower, however, don't mind. The - * {@link DistributedProcess role} will the direct to the *propriate resource index* eventually with the + * {@link DistributedProcess process} will the direct to the *propriate resource index* eventually with the * **revaluation**. * * - The **revaluation** is caused by the {@link sendData sendData()} method. @@ -6549,7 +6925,7 @@ declare namespace samchon.templates.distributed { /** * Enforce resource index. * - * Enforce *resource index* that indicates how much heavy the {@link DistributedProcess role is}. The + * Enforce *resource index* that indicates how much heavy the {@link DistributedProcess process is}. The * *resource index* will be fixed, never be **revaluated**. * * Note that, initial and average *resource index* of {@link DistributedProcess} objects are ```1.0```. If the @@ -6562,7 +6938,7 @@ declare namespace samchon.templates.distributed { * never be changed by the **revaluation**. But you've to keep in mind that, you can't avoid the **mis-valuation** * with this {@link enforceResource}. * - * For example, there's a {@link DistributedProcess role} much heavier than any other, but you + * For example, there's a {@link DistributedProcess process} much heavier than any other, but you * **mis-estimated** it to the lightest. In that case, there's no way. The * {@link DistributedSystemArray entire distributed processing system} will be slower by the **mis-valuation**. * By the reason, using {@link enforceResource}, it's recommended only when you can clearly certain the @@ -6595,6 +6971,23 @@ declare namespace samchon.templates.distributed { * @return The most idle {@link DistributedSystem} object who may send the {@link Invoke} message. */ sendData(invoke: protocol.Invoke): DistributedSystem; + /** + * Send an {@link Invoke} message. + * + * Sends an {@link Invoke} message requesting a **distributed process**. The {@link Invoke} message will be sent + * to the most idle {@link DistributedSystem} object, which represents a slave system, and the most idle + * {@link DistributedSystem} object will be returned. + * + * When the **distributed process** has completed, then the {@link DistributedSystemArray} object will revaluate + * {@link getResource resource index} and {@link DistributedSystem.getPerformance performance index} of this + * {@link DistributedSystem} and the most idle {@link DistributedSystem} objects basis on the execution time. + * + * @param invoke An {@link Invoke} message requesting distributed process. + * @param weight Weight of resource which indicates how heavy this {@link Invoke} message is. Default is 1. + * + * @return The most idle {@link DistributedSystem} object who may send the {@link Invoke} message. + */ + sendData(invoke: protocol.Invoke, weight: number): DistributedSystem; /** * @hidden */ @@ -6663,14 +7056,14 @@ declare namespace samchon.templates.external { * * @param systemArray The parent {@link ExternalSystemArray} object. */ - constructor(systemArray: ExternalSystemArray); + constructor(systemArray: ExternalSystemArray); /** * Constrct from parent {@link ExternalSystemArray} and communicator. * * @param systemArray The parent {@link ExternalSystemArray} object. * @param communicator Communicator with the remote, external system. */ - constructor(systemArray: ExternalSystemArray, communicator: protocol.IClientDriver); + constructor(systemArray: ExternalSystemArray, communicator: protocol.IClientDriver); /** * Default Destructor. * @@ -6706,7 +7099,11 @@ declare namespace samchon.templates.external { /** * Get parent {@link ExternalSystemArray} object. */ - getSystemArray(): ExternalSystemArray; + getSystemArray(): ExternalSystemArray; + /** + * Get parent {@link ExternalSystemArray} object. + */ + getSystemArray>(): SystemArray; /** * Identifier of {@link ExternalSystem} is its {@link name}. * @@ -6762,7 +7159,7 @@ declare namespace samchon.templates.parallel { * connected with this **master** system. This {@link ParallelSystem} takes full charge of network communication with * the remote, parallel **slave** system has connected. * - * When a *parallel process* is requested (by {@link ParallelSystemArray.sendSegementData} or + * When a *parallel process* is requested (by {@link ParallelSystemArray.sendSegmentData} or * {@link ParallelSystemArray.sendPieceData}), the number of pieces to be allocated to a {@link ParallelSystem} is * turn on its {@link getPerformance performance index}. Higher {@link getPerformance performance index}, then * more pieces are requested. The {@link getPerformance performance index} is revaluated whenever a *parallel process* @@ -6831,14 +7228,14 @@ declare namespace samchon.templates.parallel { * * @param systemArray The parent {@link ParallelSystemArray} object. */ - constructor(systemArray: ParallelSystemArray); + constructor(systemArray: ParallelSystemArray); /** * Construct from parent {@link ParallelSystemArray} and communicator. * * @param systemArray The parent {@link ParallelSystemArray} object. * @param communicator A communicator communicates with remote, the external system. */ - constructor(systemArray: ParallelSystemArray, communicator: protocol.IClientDriver); + constructor(systemArray: ParallelSystemArray, communicator: protocol.IClientDriver); /** * Default Destructor. * @@ -6877,7 +7274,13 @@ declare namespace samchon.templates.parallel { * * @return The parent {@link ParallelSystemArray} object. */ - getSystemArray(): ParallelSystemArray; + getSystemArray(): ParallelSystemArray; + /** + * Get manager of this object. + * + * @return The parent {@link ParallelSystemArray} object. + */ + getSystemArray>(): SystemArray; /** * Get performance index. * @@ -7019,14 +7422,14 @@ declare namespace samchon.templates.distributed { * * @param systemArray The parent {@link DistributedSystemArray} object. */ - constructor(systemArray: DistributedSystemArray); + constructor(systemArray: DistributedSystemArray); /** * Constrct from parent {@link DistributedSystemArray} and communicator. * * @param systemArray The parent {@link DistributedSystemArray} object. * @param communicator A communicator communicates with remote, the external system. */ - constructor(systemArray: DistributedSystemArray, communicator: protocol.IClientDriver); + constructor(systemArray: DistributedSystemArray, communicator: protocol.IClientDriver); /** * Factory method creating a {@link ExternalSystemRole child} object. * @@ -7046,11 +7449,17 @@ declare namespace samchon.templates.distributed { */ createChild(xml: library.XML): external.ExternalSystemRole; /** - * Get parent {@link DistributedSystemArray} object. + * Get manager of this object. * * @return The parent {@link DistributedSystemArray} object. */ - getSystemArray(): DistributedSystemArray; + getSystemArray(): DistributedSystemArray; + /** + * Get manager of this object. + * + * @return The parent {@link DistributedSystemArray} object. + */ + getSystemArray>(): SystemArray; /** * @hidden */ @@ -7161,7 +7570,7 @@ declare namespace samchon.templates.distributed { * * @param systemArray The parent {@link DistributedSystemArray} object. */ - constructor(systemArray: DistributedSystemArray); + constructor(systemArray: DistributedSystemArray); /** * Factory method creating {@link IServerConnector} object. * @@ -7171,6 +7580,7 @@ declare namespace samchon.templates.distributed { * * - {@link ServerConnector} * - {@link WebServerConnector} + * - {@link DedicatedWorkerServerConnector} * - {@link SharedWorkerServerConnector} * * @return A newly created {@link IServerConnector} object. @@ -7204,11 +7614,11 @@ declare namespace samchon.templates.distributed { * **distributed process** through the {@link DistributedProcess} object. You can access the * {@link DistributedProcess} object(s) with those methods: * - * - {@link hasRole} - * - {@link getRole} - * - {@link insertRole} - * - {@link eraseRole} - * - {@link getRoleMap} + * - {@link hasProcess} + * - {@link getProcess} + * - {@link insertProcess} + * - {@link eraseProcess} + * - {@link getProcessMap} * * When you need the **distributed process**, call the {@link DistributedProcess.sendData} method. Then the * {@link DistributedProcess} will find the most idle {@link DistributedSystem} object who represents a distributed @@ -7261,7 +7671,7 @@ declare namespace samchon.templates.distributed { * @handbook [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) * @author Jeongho Nam */ - abstract class DistributedServerArray extends DistributedSystemArray implements external.IExternalServerArray { + abstract class DistributedServerArray extends DistributedSystemArray implements external.IExternalServerArray { /** * Default Constructor. */ @@ -7288,7 +7698,7 @@ declare namespace samchon.templates.distributed { * system at the same time. This {@link DistributedSystemArrayMediator} be a master system, containing and managing * {@link DistributedSystem} objects, which represent distributed slave systems, by extending * {@link DistributedSystemArray} class. Also, be a slave system through {@link getMediator mediator} object, which is - * derived from the {@link SlavSystem} class. + * derived from the {@link SlaveSystem} class. * * As a slave, you can specify this {@link DistributedSystemArrayMediator} to be a client slave connecting to master * server or a server slave accepting master client by overriding the {@link createMediator} method. @@ -7301,6 +7711,7 @@ declare namespace samchon.templates.distributed { * - A server slave accepting master client: * - {@link MediatorServer} * - {@link MediatorWebServer} + * - {@link MediatorDedicatedWorkerServer} * - {@link MediatorSharedWorkerServer} * * #### [Inherited] {@link DistributedSystemArray} @@ -7314,11 +7725,11 @@ declare namespace samchon.templates.distributed { * **distributed process** through the {@link DistributedProcess} object. You can access the * {@link DistributedProcess} object(s) with those methods: * - * - {@link hasRole} - * - {@link getRole} - * - {@link insertRole} - * - {@link eraseRole} - * - {@link getRoleMap} + * - {@link hasProcess} + * - {@link getProcess} + * - {@link insertProcess} + * - {@link eraseProcess} + * - {@link getProcessMap} * * When you need the **distributed process**, call the {@link DistributedProcess.sendData} method. Then the * {@link DistributedProcess} will find the most idle {@link DistributedSystem} object who represents a distributed @@ -7371,7 +7782,7 @@ declare namespace samchon.templates.distributed { * @handbook [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) * @author Jeongho Nam */ - abstract class DistributedServerArrayMediator extends DistributedSystemArrayMediator implements external.IExternalServerArray { + abstract class DistributedServerArrayMediator extends DistributedSystemArrayMediator implements external.IExternalServerArray { /** * Default Constructor. */ @@ -7409,11 +7820,11 @@ declare namespace samchon.templates.distributed { * **distributed process** through the {@link DistributedProcess} object. You can access the * {@link DistributedProcess} object(s) with those methods: * - * - {@link hasRole} - * - {@link getRole} - * - {@link insertRole} - * - {@link eraseRole} - * - {@link getRoleMap} + * - {@link hasProcess} + * - {@link getProcess} + * - {@link insertProcess} + * - {@link eraseProcess} + * - {@link getProcessMap} * * When you need the **distributed process**, call the {@link DistributedProcess.sendData} method. Then the * {@link DistributedProcess} will find the most idle {@link DistributedSystem} object who represents a distributed @@ -7466,7 +7877,7 @@ declare namespace samchon.templates.distributed { * @handbook [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) * @author Jeongho Nam */ - abstract class DistributedServerClientArray extends DistributedClientArray implements external.IExternalServerClientArray { + abstract class DistributedServerClientArray extends DistributedClientArray implements external.IExternalServerClientArray { /** * Default Constructor. */ @@ -7479,14 +7890,14 @@ declare namespace samchon.templates.distributed { * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. * @return A new child Entity via {@link createExternalServer createExternalServer()}. */ - createChild(xml: library.XML): DistributedSystem; + createChild(xml: library.XML): System; /** * Factory method creating an {@link IDistributedServer} object. * * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. * @return A newly created {@link IDistributedServer} object. */ - protected abstract createExternalServer(xml: library.XML): IDistributedServer; + protected abstract createExternalServer(xml: library.XML): System; /** * @inheritdoc */ @@ -7514,7 +7925,7 @@ declare namespace samchon.templates.distributed { * system at the same time. This {@link DistributedSystemArrayMediator} be a master system, containing and managing * {@link DistributedSystem} objects, which represent distributed slave systems, by extending * {@link DistributedSystemArray} class. Also, be a slave system through {@link getMediator mediator} object, which is - * derived from the {@link SlavSystem} class. + * derived from the {@link SlaveSystem} class. * * As a slave, you can specify this {@link DistributedSystemArrayMediator} to be a client slave connecting to master * server or a server slave accepting master client by overriding the {@link createMediator} method. @@ -7527,6 +7938,7 @@ declare namespace samchon.templates.distributed { * - A server slave accepting master client: * - {@link MediatorServer} * - {@link MediatorWebServer} + * - {@link MediatorDedicatedWorkerServer} * - {@link MediatorSharedWorkerServer} * * #### [Inherited] {@link DistributedSystemArray} @@ -7540,11 +7952,11 @@ declare namespace samchon.templates.distributed { * **distributed process** through the {@link DistributedProcess} object. You can access the * {@link DistributedProcess} object(s) with those methods: * - * - {@link hasRole} - * - {@link getRole} - * - {@link insertRole} - * - {@link eraseRole} - * - {@link getRoleMap} + * - {@link hasProcess} + * - {@link getProcess} + * - {@link insertProcess} + * - {@link eraseProcess} + * - {@link getProcessMap} * * When you need the **distributed process**, call the {@link DistributedProcess.sendData} method. Then the * {@link DistributedProcess} will find the most idle {@link DistributedSystem} object who represents a distributed @@ -7597,7 +8009,7 @@ declare namespace samchon.templates.distributed { * @handbook [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) * @author Jeongho Nam */ - abstract class DistributedServerClientArrayMediator extends DistributedClientArrayMediator implements external.IExternalServerClientArray { + abstract class DistributedServerClientArrayMediator extends DistributedClientArrayMediator implements external.IExternalServerClientArray { /** * Default Constructor. */ @@ -7610,14 +8022,14 @@ declare namespace samchon.templates.distributed { * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. * @return A new child Entity via {@link createExternalServer createExternalServer()}. */ - createChild(xml: library.XML): DistributedSystem; + createChild(xml: library.XML): System; /** * Factory method creating an {@link IDistributedServer} object. * * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. * @return A newly created {@link IDistributedServer} object. */ - protected abstract createExternalServer(xml: library.XML): IDistributedServer; + protected abstract createExternalServer(xml: library.XML): System; /** * @inheritdoc */ @@ -7653,6 +8065,10 @@ declare namespace samchon.templates.distributed { * @hidden */ private process_; + /** + * @hidden + */ + private weight_; /** * Construct from a DistributedSystem. * @@ -7665,8 +8081,9 @@ declare namespace samchon.templates.distributed { * @param system The {@link DistributedSystem} object who sent the {@link Invoke} message. * @param process The {@link DistributedProcess} object who sent the {@link Invoke} message. * @param invoke An {@link Invoke} message requesting the *distributed process*. + * @param weight Weight of resource which indicates how heavy this {@link Invoke} message is. */ - constructor(system: DistributedSystem, process: DistributedProcess, invoke: protocol.Invoke); + constructor(system: DistributedSystem, process: DistributedProcess, invoke: protocol.Invoke, weight: number); /** * @inheritdoc */ @@ -7679,6 +8096,12 @@ declare namespace samchon.templates.distributed { * Get the related {@link DistributedProcess} object. */ getProcess(): DistributedProcess; + /** + * Get weight. + * + * Gets weight of resource which indicates how heavy this {@link Invoke} message is. Default is 1. + */ + getWeight(): number; /** * @inheritdoc */ @@ -7715,7 +8138,7 @@ declare namespace samchon.templates.external { * @handbook [Templates - External System](https://github.com/samchon/framework/wiki/TypeScript-Templates-External_System) * @author Jeongho Nam */ - interface IExternalClientArray extends ExternalSystemArray, protocol.IServer { + interface IExternalClientArray extends ExternalSystemArray, protocol.IServer { } /** * An array and manager of {@link ExternalSystem external clients} as a server. @@ -7764,7 +8187,7 @@ declare namespace samchon.templates.external { * @handbook [Templates - External System](https://github.com/samchon/framework/wiki/TypeScript-Templates-External_System) * @author Jeongho Nam */ - abstract class ExternalClientArray extends ExternalSystemArray implements IExternalClientArray { + abstract class ExternalClientArray extends ExternalSystemArray implements IExternalClientArray { /** * @hidden */ @@ -7781,11 +8204,10 @@ declare namespace samchon.templates.external { * may connect to {@link ExternalClientArray this server} must follow the specified templates. * * Creates and returns one of them: - *
    - *
  • {@link ServerBase}
  • - *
  • {@link WebServerBase}
  • - *
  • {@link SharedWorkerServerBase}
  • - *
+ * + * - {@link ServerBase} + * - {@link WebServerBase} + * - {@link SharedWorkerServerBase} * * @return A new {@link IServerBase} object. */ @@ -7811,14 +8233,14 @@ declare namespace samchon.templates.external { * @param xml An {@link XML} object represents the child {@link ExternalSystem} object. * @return null */ - createChild(xml: library.XML): ExternalSystem; + createChild(xml: library.XML): T; /** * Factory method creating a child {@link ExternalSystem} object. * * @param driver A communicator with connected client. * @return A newly created {@link ExternalSystem} object. */ - protected abstract createExternalClient(driver: protocol.IClientDriver): ExternalSystem; + protected abstract createExternalClient(driver: protocol.IClientDriver): T; /** * @inheritdoc */ @@ -7921,7 +8343,7 @@ declare namespace samchon.templates.external { * * @param systemArray The parent {@link ExternalSystemArray} object. */ - constructor(systemArray: ExternalSystemArray); + constructor(systemArray: ExternalSystemArray); /** * Factory method creating {@link IServerConnector} object. * @@ -7931,6 +8353,7 @@ declare namespace samchon.templates.external { * * - {@link ServerConnector} * - {@link WebServerConnector} + * - {@link DedicatedWorkerServerConnector} * - {@link SharedWorkerServerConnector} * * @return A newly created {@link IServerConnector} object. @@ -7972,7 +8395,7 @@ declare namespace samchon.templates.external { * @handbook [Templates - External System](https://github.com/samchon/framework/wiki/TypeScript-Templates-External_System) * @author Jeongho Nam */ - interface IExternalServerArray extends ExternalSystemArray { + interface IExternalServerArray extends ExternalSystemArray { /** * Connect to {@link IExternalServer external servers}. * @@ -8027,7 +8450,7 @@ declare namespace samchon.templates.external { * @handbook [Templates - External System](https://github.com/samchon/framework/wiki/TypeScript-Templates-External_System) * @author Jeongho Nam */ - abstract class ExternalServerArray extends ExternalSystemArray { + abstract class ExternalServerArray extends ExternalSystemArray implements IExternalServerArray { /** * Default Constructor. */ @@ -8069,7 +8492,13 @@ declare namespace samchon.templates.external { * @handbook [Templates - External System](https://github.com/samchon/framework/wiki/TypeScript-Templates-External_System) * @author Jeongho Nam */ - interface IExternalServerClientArray extends IExternalServerArray, IExternalClientArray { + interface IExternalServerClientArray extends IExternalClientArray { + /** + * Connect to {@link IExternalServer external servers}. + * + * This method calls children elements' method {@link IExternalServer.connect} gradually. + */ + connect(): void; } /** * An array and manager of {@link IExternalServer external servers} and {@link ExternalSystem external clients}. @@ -8123,7 +8552,7 @@ declare namespace samchon.templates.external { * @handbook [Templates - External System](https://github.com/samchon/framework/wiki/TypeScript-Templates-External_System) * @author Jeongho Nam */ - abstract class ExternalServerClientArray extends ExternalClientArray implements IExternalServerClientArray { + abstract class ExternalServerClientArray extends ExternalClientArray implements IExternalServerClientArray { /** * Default Constructor. */ @@ -8136,14 +8565,14 @@ declare namespace samchon.templates.external { * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. * @return A new child Entity via {@link createExternalServer createExternalServer()}. */ - createChild(xml: library.XML): ExternalSystem; + createChild(xml: library.XML): T; /** * Factory method creating an {@link IExternalServer} object. * * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. * @return A newly created {@link IExternalServer} object. */ - protected abstract createExternalServer(xml: library.XML): IExternalServer; + protected abstract createExternalServer(xml: library.XML): T; /** * @inheritdoc */ @@ -8220,7 +8649,7 @@ declare namespace samchon.templates.external { * * @return The grandparent {@link ExternalSystemArray} object. */ - getSystemArray(): ExternalSystemArray; + getSystemArray(): ExternalSystemArray; /** * Get parent {@link ExternalSystemRole} object. */ @@ -8291,6 +8720,7 @@ declare namespace samchon.templates.parallel { * - A server slave accepting master client: * - {@link MediatorServer} * - {@link MediatorWebServer} + * - {@link MediatorDedicatedWorkerServer} * - {@link MediatorSharedWorkerServer} * * When the **master** orders a *parallel process* to this **slave**, then the {@link MediatorSystem} delivers the @@ -8323,13 +8753,13 @@ declare namespace samchon.templates.parallel { * * @param systemArray The parent {@link ParallelSystemArrayMediator} object. */ - constructor(systemArray: ParallelSystemArrayMediator); + constructor(systemArray: ParallelSystemArrayMediator); /** * Construct from parent {@link DistributedSystemArrayMediator} object. * * @param systemArray The parent {@link DistributedSystemArrayMediator} object. */ - constructor(systemArray: distributed.DistributedSystemArrayMediator); + constructor(systemArray: distributed.DistributedSystemArrayMediator); /** * Start interaction. * @@ -8338,10 +8768,18 @@ declare namespace samchon.templates.parallel { * {@link MediatorSystem} object wil open a server accepting the **master**. */ abstract start(): void; + /** + * Get parent {@link ParallelSystemArrayMediator} or {@link DistributedSystemArrayMediator} object. + */ + getSystemArray(): ParallelSystemArrayMediator | distributed.DistributedSystemArrayMediator; /** * Get parent {@link ParallelSystemArrayMediator} object. */ - getSystemArray(): ParallelSystemArrayMediator | distributed.DistributedSystemArrayMediator; + getSystemArray>(): SystemArray; + /** + * Get parent {@link DistributedSystemArrayMediator} object. + */ + getSystemArray>(): SystemArray; /** * @hidden */ @@ -8378,6 +8816,7 @@ declare namespace samchon.templates.parallel { * - A server slave accepting master client: * - {@link MediatorServer} * - {@link MediatorWebServer} + * - {@link MediatorDedicatedWorkerServer} * - {@link MediatorSharedWorkerServer} * * When the **master** orders a *parallel process* to this **slave**, then the {@link MediatorSystem} delivers the @@ -8411,14 +8850,14 @@ declare namespace samchon.templates.parallel { * @param systemArray The parent {@link ParallelSystemArrayMediator} object. * @param port Port number of server to open. */ - constructor(systemArray: ParallelSystemArrayMediator, port: number); + constructor(systemArray: ParallelSystemArrayMediator, port: number); /** * Initializer Constructor. * * @param systemArray The parent {@link DistributedSystemArrayMediator} object. * @param port Port number of server to open. */ - constructor(systemArray: distributed.DistributedSystemArrayMediator, port: number); + constructor(systemArray: distributed.DistributedSystemArrayMediator, port: number); /** * Factory method creating {@link IServerBase} object. * @@ -8477,6 +8916,7 @@ declare namespace samchon.templates.parallel { * - A server slave accepting master client: * - {@link MediatorServer} * - {@link MediatorWebServer} + * - {@link MediatorDedicatedWorkerServer} * - {@link MediatorSharedWorkerServer} * * When the **master** orders a *parallel process* to this **slave**, then the {@link MediatorSystem} delivers the @@ -8501,6 +8941,52 @@ declare namespace samchon.templates.parallel { */ protected createServerBase(): protocol.IServerBase; } + /** + * A mediator server, driver for the master client. + * + * The {@link MediatorDedicatedWorkerServer} is a class opening a server accepting the **master** client, following + * the DedicatedWorker's protocol. + * + * #### [Inherited] {@link MediatorSystem} + * The {@link MediatorSystem} is an abstract class helping {@link ParallelSystemArrayMediator} can be a **slave** + * system. The {@link MediatorSystem} interacts and communicates with the **master** system as a role of **slave**. + * + * This {@link MediatorSystem} object is created in {@link ParallelSystemArrayMediator.createMediator}. Override the + * method and return one of them, which are derived from this {@link MediatorSystem} class, considering which + * type and protocol the **master** system follows: + * + * - A client slave connecting to master server: + * - {@link MediatorClient} + * - {@link MediatorWebClient} + * - {@link MediatorSharedWorkerClient} + * - A server slave accepting master client: + * - {@link MediatorServer} + * - {@link MediatorWebServer} + * - {@link MediatorDedicatedWorkerServer} + * - {@link MediatorSharedWorkerServer} + * + * When the **master** orders a *parallel process* to this **slave**, then the {@link MediatorSystem} delivers the + * *parallel process* to its parent {@link ParallelSystemArrayMediator} object. The + * {@link ParallelSystemArrayMediator} object distributes the *parallel process* to its slaves system, + * {@link ParallelSystem} objects. When the *parallel process* has completed, then {@link MediatorSystem} reports the + * result to its **master**. + * + * + * + * + * + * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System), + * [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) + * @author Jeongho Nam + */ + class MediatorDedicatedWorkerServer extends MediatorServer { + /** + * @inheritdoc + */ + protected createServerBase(): protocol.IServerBase; + } /** * A mediator server, driver for the master client. * @@ -8522,6 +9008,7 @@ declare namespace samchon.templates.parallel { * - A server slave accepting master client: * - {@link MediatorServer} * - {@link MediatorWebServer} + * - {@link MediatorDedicatedWorkerServer} * - {@link MediatorSharedWorkerServer} * * When the **master** orders a *parallel process* to this **slave**, then the {@link MediatorSystem} delivers the @@ -8569,6 +9056,7 @@ declare namespace samchon.templates.parallel { * - A server slave accepting master client: * - {@link MediatorServer} * - {@link MediatorWebServer} + * - {@link MediatorDedicatedWorkerServer} * - {@link MediatorSharedWorkerServer} * * When the **master** orders a *parallel process* to this **slave**, then the {@link MediatorSystem} delivers the @@ -8603,7 +9091,7 @@ declare namespace samchon.templates.parallel { * @param ip IP address to connect. * @param port Port number to connect. */ - constructor(systemArray: ParallelSystemArrayMediator, ip: string, port: number); + constructor(systemArray: ParallelSystemArrayMediator, ip: string, port: number); /** * Initializer Constructor. * @@ -8611,7 +9099,7 @@ declare namespace samchon.templates.parallel { * @param ip IP address to connect. * @param port Port number to connect. */ - constructor(systemArray: distributed.DistributedSystemArrayMediator, ip: string, port: number); + constructor(systemArray: distributed.DistributedSystemArrayMediator, ip: string, port: number); /** * Factory method creating {@link IServerConnector} object. * @@ -8656,6 +9144,7 @@ declare namespace samchon.templates.parallel { * - A server slave accepting master client: * - {@link MediatorServer} * - {@link MediatorWebServer} + * - {@link MediatorDedicatedWorkerServer} * - {@link MediatorSharedWorkerServer} * * When the **master** orders a *parallel process* to this **slave**, then the {@link MediatorSystem} delivers the @@ -8701,6 +9190,7 @@ declare namespace samchon.templates.parallel { * - A server slave accepting master client: * - {@link MediatorServer} * - {@link MediatorWebServer} + * - {@link MediatorDedicatedWorkerServer} * - {@link MediatorSharedWorkerServer} * * When the **master** orders a *parallel process* to this **slave**, then the {@link MediatorSystem} delivers the @@ -8785,7 +9275,7 @@ declare namespace samchon.templates.parallel { * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System) * @author Jeongho Nam */ - abstract class ParallelClientArray extends ParallelSystemArray implements external.IExternalClientArray { + abstract class ParallelClientArray extends ParallelSystemArray implements external.IExternalClientArray { /** * @hidden */ @@ -8831,7 +9321,7 @@ declare namespace samchon.templates.parallel { * @param xml An {@link XML} object represents the child {@link ParallelSystem} object. * @return ```null``` */ - createChild(xml: library.XML): ParallelSystem; + createChild(xml: library.XML): System; /** * Factory method creating {@link ParallelSystem} object. * @@ -8847,7 +9337,7 @@ declare namespace samchon.templates.parallel { * @param driver A communicator with the parallel client. * @return A newly created {@link ParallelSystem} object. */ - protected abstract createExternalClient(driver: protocol.IClientDriver): ParallelSystem; + protected abstract createExternalClient(driver: protocol.IClientDriver): System; /** * @inheritdoc */ @@ -8866,7 +9356,7 @@ declare namespace samchon.templates.parallel { * master system at the same time. This {@link ParallelSystemArrayMediator} be a **master **system, containing and * managing {@link ParallelSystem} objects, which represent parallel slave systems, by extending * {@link ParallelSystemArray} class. Also, be a **slave** system through {@link getMediator mediator} object, which is - * derived from the {@link SlavSystem} class. + * derived from the {@link SlaveSystem} class. * * As a **master**, you can specify this {@link ParallelSystemArrayMediator} class to be a master server accepting * slave clients or a master client to connecting slave servers. Even both of them is possible. Extends one @@ -8888,6 +9378,7 @@ declare namespace samchon.templates.parallel { * - A server slave accepting master client: * - {@link MediatorServer} * - {@link MediatorWebServer} + * - {@link MediatorDedicatedWorkerServer} * - {@link MediatorSharedWorkerServer} * * #### [Inherited] {@link ParallelSystemArray} @@ -8938,7 +9429,7 @@ declare namespace samchon.templates.parallel { * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System) * @author Jeongho Nam */ - abstract class ParallelSystemArrayMediator extends ParallelSystemArray { + abstract class ParallelSystemArrayMediator extends ParallelSystemArray { /** * @hidden */ @@ -8966,6 +9457,7 @@ declare namespace samchon.templates.parallel { * - A server slave accepting master client: * - {@link MediatorServer} * - {@link MediatorWebServer} + * - {@link MediatorDedicatedWorkerServer} * - {@link MediatorSharedWorkerServer} * * @return A newly created {@link MediatorSystem} object. @@ -9014,7 +9506,7 @@ declare namespace samchon.templates.parallel { * master system at the same time. This {@link ParallelSystemArrayMediator} be a **master **system, containing and * managing {@link ParallelSystem} objects, which represent parallel slave systems, by extending * {@link ParallelSystemArray} class. Also, be a **slave** system through {@link getMediator mediator} object, which is - * derived from the {@link SlavSystem} class. + * derived from the {@link SlaveSystem} class. * * As a **slave**, you can specify this {@link ParallelSystemArrayMediator} to be a client slave connecting to * master server or a server slave accepting master client by overriding the {@link createMediator} method. @@ -9027,6 +9519,7 @@ declare namespace samchon.templates.parallel { * - A server slave accepting master client: * - {@link MediatorServer} * - {@link MediatorWebServer} + * - {@link MediatorDedicatedWorkerServer} * - {@link MediatorSharedWorkerServer} * * #### [Inherited] {@link ParallelSystemArray} @@ -9077,7 +9570,7 @@ declare namespace samchon.templates.parallel { * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System) * @author Jeongho Nam */ - abstract class ParallelClientArrayMediator extends ParallelSystemArrayMediator implements external.IExternalClientArray { + abstract class ParallelClientArrayMediator extends ParallelSystemArrayMediator implements external.IExternalClientArray { /** * @hidden */ @@ -9125,7 +9618,7 @@ declare namespace samchon.templates.parallel { * @param xml An {@link XML} object represents the child {@link ParallelSystem} object. * @return null */ - createChild(xml: library.XML): ParallelSystem; + createChild(xml: library.XML): System; /** * Factory method creating {@link ParallelSystem} object. * @@ -9141,7 +9634,7 @@ declare namespace samchon.templates.parallel { * @param driver A communicator with the parallel client. * @return A newly created {@link ParallelSystem} object. */ - protected abstract createExternalClient(driver: protocol.IClientDriver): ParallelSystem; + protected abstract createExternalClient(driver: protocol.IClientDriver): System; /** * @inheritdoc */ @@ -9198,7 +9691,7 @@ declare namespace samchon.templates.parallel { * connected with this **master** system. This {@link ParallelSystem} takes full charge of network communication with * the remote, parallel **slave** system has connected. * - * When a *parallel process* is requested (by {@link ParallelSystemArray.sendSegementData} or + * When a *parallel process* is requested (by {@link ParallelSystemArray.sendSegmentData} or * {@link ParallelSystemArray.sendPieceData}), the number of pieces to be allocated to a {@link ParallelSystem} is * turn on its {@link getPerformance performance index}. Higher {@link getPerformance performance index}, then * more pieces are requested. The {@link getPerformance performance index} is revaluated whenever a *parallel process* @@ -9255,7 +9748,7 @@ declare namespace samchon.templates.parallel { * * @param systemArray The parent {@link ParallelSystemArray} object. */ - constructor(systemArray: ParallelSystemArray); + constructor(systemArray: ParallelSystemArray); /** * Factory method creating {@link IServerConnector} object. * @@ -9265,6 +9758,7 @@ declare namespace samchon.templates.parallel { * * - {@link ServerConnector} * - {@link WebServerConnector} + * - {@link DedicatedWorkerServerConnector} * - {@link SharedWorkerServerConnector} * * @return A newly created {@link IServerConnector} object. @@ -9335,7 +9829,7 @@ declare namespace samchon.templates.parallel { * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System) * @author Jeongho Nam */ - abstract class ParallelServerArray extends ParallelSystemArray implements external.IExternalServerArray { + abstract class ParallelServerArray extends ParallelSystemArray implements external.IExternalServerArray { /** * Default Constructor. */ @@ -9362,7 +9856,7 @@ declare namespace samchon.templates.parallel { * master system at the same time. This {@link ParallelSystemArrayMediator} be a **master **system, containing and * managing {@link ParallelSystem} objects, which represent parallel slave systems, by extending * {@link ParallelSystemArray} class. Also, be a **slave** system through {@link getMediator mediator} object, which is - * derived from the {@link SlavSystem} class. + * derived from the {@link SlaveSystem} class. * * As a **master**, you can specify this {@link ParallelSystemArrayMediator} class to be a master server accepting * slave clients or a master client to connecting slave servers. Even both of them is possible. Extends one @@ -9384,6 +9878,7 @@ declare namespace samchon.templates.parallel { * - A server slave accepting master client: * - {@link MediatorServer} * - {@link MediatorWebServer} + * - {@link MediatorDedicatedWorkerServer} * - {@link MediatorSharedWorkerServer} * * #### [Inherited] {@link ParallelSystemArray} @@ -9434,7 +9929,7 @@ declare namespace samchon.templates.parallel { * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System) * @author Jeongho Nam */ - abstract class ParallelServerArrayMediator extends ParallelSystemArrayMediator implements external.IExternalServerArray { + abstract class ParallelServerArrayMediator extends ParallelSystemArrayMediator implements external.IExternalServerArray { /** * Default Constructor. */ @@ -9509,7 +10004,7 @@ declare namespace samchon.templates.parallel { * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System) * @author Jeongho Nam */ - abstract class ParallelServerClientArray extends ParallelClientArray implements external.IExternalServerClientArray { + abstract class ParallelServerClientArray extends ParallelClientArray implements external.IExternalServerClientArray { /** * Default Constructor. */ @@ -9522,14 +10017,14 @@ declare namespace samchon.templates.parallel { * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. * @return A new child Entity via {@link createExternalServer createExternalServer()}. */ - createChild(xml: library.XML): IParallelServer; + createChild(xml: library.XML): System; /** * Factory method creating an {@link IParallelServer} object. * * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. * @return A newly created {@link IParallelServer} object. */ - protected abstract createExternalServer(xml: library.XML): IParallelServer; + protected abstract createExternalServer(xml: library.XML): System; /** * @inheritdoc */ @@ -9557,7 +10052,7 @@ declare namespace samchon.templates.parallel { * master system at the same time. This {@link ParallelSystemArrayMediator} be a **master **system, containing and * managing {@link ParallelSystem} objects, which represent parallel slave systems, by extending * {@link ParallelSystemArray} class. Also, be a **slave** system through {@link getMediator mediator} object, which is - * derived from the {@link SlavSystem} class. + * derived from the {@link SlaveSystem} class. * * As a **master**, you can specify this {@link ParallelSystemArrayMediator} class to be a master server accepting * slave clients or a master client to connecting slave servers. Even both of them is possible. Extends one @@ -9579,6 +10074,7 @@ declare namespace samchon.templates.parallel { * - A server slave accepting master client: * - {@link MediatorServer} * - {@link MediatorWebServer} + * - {@link MediatorDedicatedWorkerServer} * - {@link MediatorSharedWorkerServer} * * #### [Inherited] {@link ParallelSystemArray} @@ -9629,7 +10125,7 @@ declare namespace samchon.templates.parallel { * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System) * @author Jeongho Nam */ - abstract class ParallelServerClientArrayMediator extends ParallelClientArrayMediator implements external.IExternalServerClientArray { + abstract class ParallelServerClientArrayMediator extends ParallelClientArrayMediator implements external.IExternalServerClientArray { /** * Default Constructor. */ @@ -9642,14 +10138,14 @@ declare namespace samchon.templates.parallel { * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. * @return A new child Entity via {@link createExternalServer createExternalServer()}. */ - createChild(xml: library.XML): ParallelSystem; + createChild(xml: library.XML): System; /** * Factory method creating an {@link IParallelServer} object. * * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. * @return A newly created {@link IParallelServer} object. */ - protected abstract createExternalServer(xml: library.XML): IParallelServer; + protected abstract createExternalServer(xml: library.XML): System; /** * @inheritdoc */ @@ -9907,7 +10403,7 @@ declare namespace samchon.templates.service { * - Objects in composite relationship and their factory methods * - {@link User}: {@link Server.createUser Server.createUser()} * - {@link Client}: {@link User.createClient User.createClient()} - * - {@link Service}: {@liok Client.createService Client.createService()} + * - {@link Service}: {@link Client.createService Client.createService()} * - {@link Invoke} message chains; {@link IProtocol.replyData replyData} * - {@link Server.replyData} * - {@link User.replyData} @@ -10089,7 +10585,7 @@ declare namespace samchon.templates.service { * An user. * * The {@link User} is an abstract class groupping {@link Client} objects, who communicates with remote client, with - * same *session id*. This {link User} represents a *remote user* literally. Within framework of remote system, + * same *session id*. This {@link User} represents a *remote user* literally. Within framework of remote system, * an {@link User} corresponds to a web-browser and a {@link Client} represents a window in the web-browser. * * Extends this {@link User} class and override the {@link createClient} method, a factory method creating a child diff --git a/typescript-stl/index.d.ts b/typescript-stl/index.d.ts index e0a5a49700..0182a888c3 100644 --- a/typescript-stl/index.d.ts +++ b/typescript-stl/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for TypeScript-STL v1.1.3 +// Type definitions for TypeScript-STL v1.2.0 // Project: https://github.com/samchon/typescript-stl // Definitions by: Jeongho Nam // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -2730,38 +2730,9 @@ declare namespace std.base { */ abstract class Container implements IContainer { /** - *

Default Constructor.

- * - *

Constructs an empty container, with no elements.

+ * Default Constructor. */ - constructor(); - /** - *

Initializer list Constructor.

- * - *

Constructs a container with a copy of each of the elements in array, in the same order.

- * - * @param array An array containing elements to be copied and contained. - */ - constructor(array: Array); - /** - *

Copy Constructor.

- * - *

Constructs a container with a copy of each of the elements in container, in the same order.

- * - * @param container Another container object of the same type (with the same class template - * arguments T), whose contents are either copied or acquired. - */ - constructor(container: IContainer); - /** - *

Range Constructor.

- * - *

Constructs a container with as many elements as the range (begin, end), with each - * element emplace-constructed from its corresponding element in that range, in the same order.

- * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - */ - constructor(begin: Iterator, end: Iterator); + protected constructor(); /** * @inheritdoc */ @@ -2941,7 +2912,7 @@ declare namespace std.base { * * @author Jeongho Nam */ - class HashBuckets { + abstract class HashBuckets { /** * @hidden */ @@ -2953,7 +2924,7 @@ declare namespace std.base { /** * Default Constructor. */ - constructor(); + protected constructor(); /** *

Reconstruction of hash table.

* @@ -4115,9 +4086,9 @@ declare namespace std { /** * Construct from the source {@link IContainer container}. * - * @param source The source + * @param source The source container. */ - constructor(source: base.IContainer); + protected constructor(source: base.IContainer); /** *

Get iterator to previous element.

*

If current iterator is the first item(equal with {@link IContainer.begin IContainer.begin()}), @@ -4165,7 +4136,7 @@ declare namespace std { * * @return A value of the iterator. */ - readonly value: T; + readonly abstract value: T; abstract swap(obj: Iterator): void; } } @@ -4203,7 +4174,7 @@ declare namespace std { * * @param base A reference of the base iterator, which iterates in the opposite direction. */ - constructor(base: Base); + protected constructor(base: Base); /** *

Return base iterator.

* @@ -4219,7 +4190,7 @@ declare namespace std { /** * @hidden */ - protected abstract create_neighbor(base: Base): This; + protected abstract _Create_neighbor(base: Base): This; /** *

Get value of the iterator is pointing.

* @@ -4415,6 +4386,298 @@ declare namespace std { */ function end(container: base.MapContainer): MapIterator; } +declare namespace std.base { + /** + * An abstract list. + * + *

{@link ListContainer}s are sequence containers that allow constant time insert and erase operations anywhere + * within the sequence, and iteration in both directions.

+ * + *

List containers are implemented as doubly-linked lists; Doubly linked lists can store each of the elements they + * contain in different and unrelated storage locations. The ordering is kept internally by the association to each + * element of a link to the element preceding it and a link to the element following it.

+ * + *

Compared to other base standard sequence containers (array, vector and deque), lists perform generally better + * in inserting, extracting and moving elements in any position within the container for which an iterator has already + * been obtained, and therefore also in algorithms that make intensive use of these, like sorting algorithms.

+ * + *

The main drawback of lists and forward_lists compared to these other sequence containers is that they lack + * direct access to the elements by their position; For example, to access the sixth element in a list, one has to + * iterate from a known position (like the beginning or the end) to that position, which takes linear time in the + * distance between these. They also consume some extra memory to keep the linking information associated to each + * element (which may be an important factor for large lists of small-sized elements).

+ * + *

Container properties

+ *
+ *
Sequence
+ *
Elements in sequence containers are ordered in a strict linear sequence. Individual elements are accessed by + * their position in this sequence.
+ * + *
Doubly-linked list
+ *
Each element keeps information on how to locate the next and the previous elements, allowing constant time + * insert and erase operations before or after a specific element (even of entire ranges), but no direct random + * access.
+ *
+ * + * @param Type of the elements. + * + * @reference http://www.cplusplus.com/reference/list/list/ + * + * @author Jeongho Nam + */ + abstract class ListContainer> extends Container implements IDequeContainer { + /** + * @hidden + */ + private begin_; + /** + * @hidden + */ + private end_; + /** + * @hidden + */ + private size_; + /** + * Default Constructor. + */ + protected constructor(); + protected abstract _Create_iterator(prev: BidrectionalIterator, next: BidrectionalIterator, val: T): BidrectionalIterator; + /** + * @inheritdoc + */ + assign>(first: InputIterator, last: InputIterator): void; + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + begin(): BidrectionalIterator; + /** + * @inheritdoc + */ + end(): BidrectionalIterator; + /** + * @inheritdoc + */ + size(): number; + /** + * @inheritdoc + */ + front(): T; + /** + * @inheritdoc + */ + back(): T; + /** + * @inheritdoc + */ + push_front(val: T): void; + /** + * @inheritdoc + */ + push_back(val: T): void; + /** + * @inheritdoc + */ + pop_front(): void; + /** + * @inheritdoc + */ + pop_back(): void; + /** + * @inheritdoc + */ + push(...items: T[]): number; + /** + *

Insert an element.

+ * + *

The container is extended by inserting a new element before the element at the specified + * position. This effectively increases the {@link List.size List size} by the amount of elements + * inserted.

+ * + *

Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence.

+ * + * @param position Position in the container where the new element is inserted. + * {@link iterator}> is a member type, defined as a + * {@link ListIterator bidirectional iterator} type that points to elements. + * @param val Value to be inserted as an element. + * + * @return An iterator that points to the newly inserted element; val. + */ + insert(position: BidrectionalIterator, val: T): BidrectionalIterator; + /** + *

Insert elements by repeated filling.

+ * + *

The container is extended by inserting a new element before the element at the specified + * position. This effectively increases the {@link List.size List size} by the amount of elements + * inserted.

+ * + *

Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence.

+ * + * @param position Position in the container where the new elements are inserted. The {@link iterator} is a + * member type, defined as a {@link ListIterator bidirectional iterator} type that points to + * elements. + * @param size Number of elements to insert. + * @param val Value to be inserted as an element. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert(position: BidrectionalIterator, size: number, val: T): BidrectionalIterator; + /** + *

Insert elements by range iterators.

+ * + *

The container is extended by inserting a new element before the element at the specified + * position. This effectively increases the {@link List.size List size} by the amount of elements + * inserted.

+ * + *

Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence.

+ * + * @param position Position in the container where the new elements are inserted. The {@link iterator} is a + * member type, defined as a {@link ListIterator bidirectional iterator} type that points to + * elements. + * @param begin An iterator specifying range of the begining element. + * @param end An iterator specifying range of the ending element. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert>(position: BidrectionalIterator, begin: InputIterator, end: InputIterator): BidrectionalIterator; + /** + * @hidden + */ + private insert_by_val(position, val); + /** + * @hidden + */ + protected _Insert_by_repeating_val(position: BidrectionalIterator, size: number, val: T): BidrectionalIterator; + /** + * @hidden + */ + protected _Insert_by_range>(position: BidrectionalIterator, begin: InputIterator, end: InputIterator): BidrectionalIterator; + /** + *

Erase an element.

+ * + *

Removes from the {@link List} either a single element; position.

+ * + *

This effectively reduces the container size by the number of element removed.

+ * + *

Unlike other standard sequence containers, {@link List} objects are specifically designed to be + * efficient inserting and removing elements in any position, even in the middle of the sequence.

+ * + * @param position Iterator pointing to a single element to be removed from the {@link List}. + * + * @return An iterator pointing to the element that followed the last element erased by the function call. + * This is the {@link end end()} if the operation erased the last element in the sequence. + */ + erase(position: BidrectionalIterator): BidrectionalIterator; + /** + *

Erase elements.

+ * + *

Removes from the {@link List} container a range of elements.

+ * + *

This effectively reduces the container {@link size} by the number of elements removed.

+ * + *

Unlike other standard sequence containers, {@link List} objects are specifically designed to be + * efficient inserting and removing elements in any position, even in the middle of the sequence.

+ * + * @param begin An iterator specifying a range of beginning to erase. + * @param end An iterator specifying a range of end to erase. + * + * @return An iterator pointing to the element that followed the last element erased by the function call. + * This is the {@link end end()} if the operation erased the last element in the sequence. + */ + erase(begin: BidrectionalIterator, end: BidrectionalIterator): BidrectionalIterator; + /** + * @hidden + */ + protected _Erase_by_range(first: BidrectionalIterator, last: BidrectionalIterator): BidrectionalIterator; + /** + *

Swap content.

+ * + *

Exchanges the content of the container by the content of obj, which is another + * {@link List container} object with same type of elements. Sizes and container type may differ.

+ * + *

After the call to this member function, the elements in this container are those which were in obj + * before the call, and the elements of obj are those which were in this. All iterators, references and + * pointers remain valid for the swapped objects.

+ * + *

Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

+ * + * @param obj Another {@link List container} of the same type of elements (i.e., instantiated + * with the same template parameter, T) whose content is swapped with that of this + * {@link container List}. + */ + swap(obj: ListContainer): void; + /** + * @inheritdoc + */ + swap(obj: base.IContainer): void; + } +} +declare namespace std.base { + /** + * An iterator, node of a List-based container. + * + * + * + * + * + * @author Jeongho Nam + */ + abstract class ListIteratorBase extends Iterator { + /** + * @hidden + */ + private prev_; + /** + * @hidden + */ + private next_; + /** + * @hidden + */ + protected value_: T; + /** + * Initializer Constructor. + * + * @param source The source {@link Container} to reference. + * @param prev A refenrece of previous node ({@link ListIterator iterator}). + * @param next A refenrece of next node ({@link ListIterator iterator}). + * @param value Value to be stored in the node (iterator). + */ + protected constructor(source: Container, prev: ListIteratorBase, next: ListIteratorBase, value: T); + /** + * @inheritdoc + */ + prev(): ListIteratorBase; + /** + * @inheritdoc + */ + next(): ListIteratorBase; + /** + * @inheritdoc + */ + advance(step: number): ListIteratorBase; + /** + * @inheritdoc + */ + readonly value: T; + /** + * @inheritdoc + */ + equal_to(obj: ListIteratorBase): boolean; + /** + * @inheritdoc + */ + swap(obj: ListIteratorBase): void; + } +} declare namespace std.base { /** *

An abstract map.

@@ -4470,7 +4733,7 @@ declare namespace std.base { /** * Default Constructor. */ - constructor(); + protected constructor(); /** * @inheritdoc */ @@ -4537,7 +4800,7 @@ declare namespace std.base { * beginning of the container.

* *

{@link rbegin} points to the element preceding the one that would be pointed to by member {@link end}. - *

+ *

7 * * @return A {@link MapReverseIterator reverse iterator} to the reverse beginning of the sequence * @@ -4830,7 +5093,7 @@ declare namespace std.base { /** * @hidden */ - private erase_by_range(begin, end); + private erase_by_range(first, last); /** * @hidden */ @@ -4887,6 +5150,17 @@ declare namespace std.base { */ protected abstract _Handle_erase(first: MapIterator, last: MapIterator): void; } + /** + * @hidden + */ + class MapElementList extends ListContainer, MapIterator> { + private associative_; + constructor(associative: MapContainer); + protected _Create_iterator(prev: MapIterator, next: MapIterator, val: Pair): MapIterator; + get_associative(): MapContainer; + rbegin(): MapReverseIterator; + rend(): MapReverseIterator; + } } declare namespace std { /** @@ -4897,18 +5171,14 @@ declare namespace std { * * @author Jeongho Nam */ - class MapIterator extends Iterator> implements IComparable> { - /** - * A {@link ListIterator} pointing {@link Pair} of key and value. - */ - private list_iterator_; + class MapIterator extends base.ListIteratorBase> implements IComparable> { /** * Construct from the {@link MapContainer source map} and {@link ListIterator list iterator}. * * @param source The source {@link MapContainer}. * @param list_iterator A {@link ListIterator} pointing {@link Pair} of key and value. */ - constructor(source: base.MapContainer, list_iterator: ListIterator>); + constructor(source: base.MapElementList, prev: MapIterator, next: MapIterator, val: Pair); /** * Get iterator to previous element. */ @@ -4927,15 +5197,7 @@ declare namespace std { /** * @hidden */ - private readonly map; - /** - * Get ListIterator. - */ - get_list_iterator(): ListIterator>; - /** - * @inheritdoc - */ - readonly value: Pair; + get_source(): base.MapContainer; /** * Get first, key element. */ @@ -4978,7 +5240,7 @@ declare namespace std { /** * @hidden */ - protected create_neighbor(base: MapIterator): MapReverseIterator; + protected _Create_neighbor(base: MapIterator): MapReverseIterator; /** * Get first, key element. */ @@ -5170,7 +5432,7 @@ declare namespace std.base { /** * Default Constructor. */ - constructor(); + protected constructor(); /** * @inheritdoc */ @@ -5336,7 +5598,7 @@ declare namespace std.base { /** * @hidden */ - private erase_by_range(begin, end); + private erase_by_range(first, last); /** * @hidden */ @@ -5393,6 +5655,17 @@ declare namespace std.base { */ protected abstract _Handle_erase(first: SetIterator, last: SetIterator): void; } + /** + * @hidden + */ + class SetElementList extends ListContainer> { + private associative_; + constructor(associative: SetContainer); + protected _Create_iterator(prev: SetIterator, next: SetIterator, val: T): SetIterator; + get_associative(): SetContainer; + rbegin(): SetReverseIterator; + rend(): SetReverseIterator; + } } declare namespace std { /** @@ -5403,8 +5676,7 @@ declare namespace std { * * @author Jeongho Nam */ - class SetIterator extends Iterator implements IComparable> { - private list_iterator_; + class SetIterator extends base.ListIteratorBase implements IComparable> { /** *

Construct from source and index number.

* @@ -5415,7 +5687,11 @@ declare namespace std { * @param map The source Set to reference. * @param index Sequence number of the element in the source Set. */ - constructor(source: base.SetContainer, it: ListIterator); + constructor(source: base.SetElementList, prev: SetIterator, next: SetIterator, val: T); + /** + * @inheritdoc + */ + get_source(): base.SetContainer; /** * @inheritdoc */ @@ -5428,15 +5704,6 @@ declare namespace std { * @inheritdoc */ advance(size: number): SetIterator; - /** - * @hidden - */ - private readonly set; - get_list_iterator(): ListIterator; - /** - * @inheritdoc - */ - readonly value: T; /** * @inheritdoc */ @@ -5474,7 +5741,7 @@ declare namespace std { /** * @hidden */ - protected create_neighbor(base: SetIterator): SetReverseIterator; + protected _Create_neighbor(base: SetIterator): SetReverseIterator; } } declare namespace std.base { @@ -5634,7 +5901,10 @@ declare namespace std.base { /** * Default Constructor. */ - constructor(); + protected constructor(); + /** + * Clear, removes all tree nodes. + */ clear(): void; /** * Find a node from its contained value. @@ -7659,7 +7929,7 @@ declare namespace std { /** * @hidden */ - protected create_neighbor(base: DequeIterator): DequeReverseIterator; + protected _Create_neighbor(base: DequeIterator): DequeReverseIterator; /** * @inheritdoc */ @@ -9275,9 +9545,6 @@ declare namespace std { * contain in different and unrelated storage locations. The ordering is kept internally by the association to each * element of a link to the element preceding it and a link to the element following it.

* - *

They are very similar to forward_list: The main difference being that forward_list objects are single-linked - * lists, and thus they can only be iterated forwards, in exchange for being somewhat smaller and more efficient.

- * *

Compared to other base standard sequence containers (array, vector and deque), lists perform generally better * in inserting, extracting and moving elements in any position within the container for which an iterator has already * been obtained, and therefore also in algorithms that make intensive use of these, like sorting algorithms.

@@ -9309,19 +9576,7 @@ declare namespace std { * @reference http://www.cplusplus.com/reference/list/list/ * @author Jeongho Nam */ - class List extends base.Container implements base.IDequeContainer { - /** - * @hidden - */ - private begin_; - /** - * @hidden - */ - private end_; - /** - * @hidden - */ - private size_; + class List extends base.ListContainer> { /** *

Default Constructor.

* @@ -9365,6 +9620,7 @@ declare namespace std { * @param end Input interator of the final position in a sequence. */ constructor(begin: Iterator, end: Iterator); + protected _Create_iterator(prev: ListIterator, next: ListIterator, val: T): ListIterator; /** * @inheritdoc */ @@ -9373,18 +9629,6 @@ declare namespace std { * @inheritdoc */ assign>(begin: InputIterator, end: InputIterator): void; - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - begin(): ListIterator; - /** - * @inheritdoc - */ - end(): ListIterator; /** * @inheritdoc */ @@ -9393,10 +9637,6 @@ declare namespace std { * @inheritdoc */ rend(): ListReverseIterator; - /** - * @inheritdoc - */ - size(): number; /** * @inheritdoc */ @@ -9405,26 +9645,6 @@ declare namespace std { * @inheritdoc */ back(): T; - /** - * @inheritdoc - */ - push(...items: T[]): number; - /** - * @inheritdoc - */ - push_front(val: T): void; - /** - * @inheritdoc - */ - push_back(val: T): void; - /** - * @inheritdoc - */ - pop_front(): void; - /** - * @inheritdoc - */ - pop_back(): void; /** *

Insert an element.

* @@ -9537,18 +9757,6 @@ declare namespace std { * @return An iterator that points to the first of the newly inserted elements. */ insert>(position: ListReverseIterator, begin: InputIterator, end: InputIterator): ListReverseIterator; - /** - * @hidden - */ - private insert_by_val(position, val); - /** - * @hidden - */ - protected _Insert_by_repeating_val(position: ListIterator, size: number, val: T): ListIterator; - /** - * @hidden - */ - protected _Insert_by_range>(position: ListIterator, begin: InputIterator, end: InputIterator): ListIterator; /** *

Erase an element.

* @@ -9615,10 +9823,6 @@ declare namespace std { * This is the {@link rend rend()} if the operation erased the last element in the sequence. */ erase(begin: ListReverseIterator, end: ListReverseIterator): ListReverseIterator; - /** - * @hidden - */ - protected _Erase_by_range(first: ListIterator, last: ListIterator): ListIterator; /** *

Remove duplicate values.

* @@ -9889,25 +10093,14 @@ declare namespace std { * * @author Jeongho Nam */ - class ListIterator extends Iterator { + class ListIterator extends base.ListIteratorBase { /** - * @hidden - */ - private prev_; - /** - * @hidden - */ - private next_; - /** - * @hidden - */ - private value_; - /** - *

Construct from the source {@link List container}.

+ * Initializer Constructor. * - *

Note

- *

Do not create the iterator directly, by yourself.

- *

Use {@link List.begin begin()}, {@link List.end end()} in {@link List container} instead.

+ * #### Note + * Do not create the iterator directly, by yourself. + * + * Use {@link List.begin begin()}, {@link List.end end()} in {@link List container} instead. * * @param source The source {@link List container} to reference. * @param prev A refenrece of previous node ({@link ListIterator iterator}). @@ -9915,7 +10108,6 @@ declare namespace std { * @param value Value to be stored in the node (iterator). */ constructor(source: List, prev: ListIterator, next: ListIterator, value: T); - private list(); /** * @inheritdoc */ @@ -9969,7 +10161,7 @@ declare namespace std { /** * @hidden */ - protected create_neighbor(base: ListIterator): ListReverseIterator; + protected _Create_neighbor(base: ListIterator): ListReverseIterator; /** * @inheritdoc */ @@ -10490,6 +10682,7 @@ declare namespace std { * @inheritdoc */ swap(obj: VectorIterator): void; + toString(): number; } } declare namespace std { @@ -10514,7 +10707,7 @@ declare namespace std { /** * @hidden */ - protected create_neighbor(base: VectorIterator): VectorReverseIterator; + protected _Create_neighbor(base: VectorIterator): VectorReverseIterator; /** * @inheritdoc */