This page has been translated automatically.
UnigineScript
The Language
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Content Creation
Materials
Unigine Material Library
Tutorials
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Async Class

Async Class

Members


Async ()

Default constructor. An empty instance with default parameters is created.

void clear ()

Clears all the functions results.

variable getResult (int id)

Returns the function result.

Return value

The function result.

int isRunning ()

Indicates if any thread is active.

Return value

1 if there is an active thread, otherwise - 0.

int isRunning (int id)

Indicates if the required thread is active.

Arguments

  • int id - Thread ID.

Return value

1 if the required thread is active; otherwise - 0.

void lock ()

Locks the resource. The resource can be locked by the other thread only after the first thread have unlocked this resource.

int run (variable name)

Runs the given function in asynchronous way.

Arguments

  • variable name - Function to be run: string - function name, int - function ID.

Return value

-1 if the function is not found; otherwise - function ID in the queue.

int run (variable name, variable v0)

Runs the given function with one argument or a member of a class in asynchronous way.

Arguments

  • variable name - Function to be run: string - function name, int - function ID, object - class name.
  • variable v0 - If name is an object: class member name or ID; otherwise - function argument.

Return value

-1 if the function is not found; otherwise - function ID in the queue.

int run (variable name, variable v0, variable v1)

Runs the given function with two arguments or a member of a class with one argument in asynchronous way.

Arguments

  • variable name - Function to be run: string - function name, int - function ID, object - class name.
  • variable v0 - If name is an object: class member name or ID; otherwise - function argument.
  • variable v1 - An argument of a function/class member.

Return value

-1 if the function is not found; otherwise - function ID in the queue.

int run (variable name, variable v0, variable v1, variable v2)

Runs the given function with three arguments or a member of a class with two arguments in asynchronous way.

Arguments

  • variable name - Function to be run: string - function name, int - function ID, object - class name.
  • variable v0 - If name is an object: class member name or ID; otherwise - function argument.
  • variable v1 - An argument of a function/class member.
  • variable v2 - An argument of a function/class member.

Return value

-1 if the function is not found; otherwise - function ID in the queue.

int run (variable name, variable v0, variable v1, variable v2, variable v3)

Runs the given function with four arguments or a member of a class with three arguments in asynchronous way.

Arguments

  • variable name - Function to be run: string - function name, int - function ID, object - class name.
  • variable v0 - If name is an object: class member name or ID; otherwise - function argument.
  • variable v1 - An argument of a function/class member.
  • variable v2 - An argument of a function/class member.
  • variable v3 - An argument of a function/class member.

Return value

-1 if the function is not found; otherwise - function ID in the queue.

int run (variable name, variable v0, variable v1, variable v2, variable v3, variable v4)

Runs the given function with four arguments or a member of a class with three arguments in asynchronous way.

Arguments

  • variable name - Function to be run: string - function name, int - function ID, object - class name.
  • variable v0 - If name is an object: class member name or ID; otherwise - function argument.
  • variable v1 - An argument of a function/class member.
  • variable v2 - An argument of a function/class member.
  • variable v3 - An argument of a function/class member.
  • variable v4 - An argument of a function/class member.

Return value

-1 if the function is not found; otherwise - function ID in the queue.

int run (variable name, variable v0, variable v1, variable v2, variable v3, variable v4, variable v5)

Runs the given function with five arguments or a member of a class with four arguments in asynchronous way.

Arguments

  • variable name - Function to be run: string - function name, int - function ID, object - class name.
  • variable v0 - If name is an object: class member name or ID; otherwise - function argument.
  • variable v1 - An argument of a function/class member.
  • variable v2 - An argument of a function/class member.
  • variable v3 - An argument of a function/class member.
  • variable v4 - An argument of a function/class member.
  • variable v5 - An argument of a function/class member.

Return value

-1 if the function is not found; otherwise - function ID in the queue.

int run (variable name, variable v0, variable v1, variable v2, variable v3, variable v4, variable v5, variable v6)

Runs the given function with six arguments or a member of a class with five arguments in asynchronous way.

Arguments

  • variable name - Function to be run: string - function name, int - function ID, object - class name.
  • variable v0 - If name is an object: class member name or ID; otherwise - function argument.
  • variable v1 - An argument of a function/class member.
  • variable v2 - An argument of a function/class member.
  • variable v3 - An argument of a function/class member.
  • variable v4 - An argument of a function/class member.
  • variable v5 - An argument of a function/class member.
  • variable v6 - An argument of a function/class member.

Return value

-1 if the function is not found; otherwise - function ID in the queue.

int runv (variable name, int id)

Runs the given function and a vector in asynchronous way.

Arguments

  • variable name - The argument.
  • int id - Vector ID.

Return value

-1 if the function is not found; otherwise - function ID in the queue.

void unlock ()

Unlocks the previously locked resource.

void wait (int id)

Waits until the isRunning() function returns 0 (i.e. a thread with a specified ID is not active).

Arguments

  • int id - Thread ID.

void wait ()

Waits until the isRunning() function returns 0 (i.e. any thread is not active).
Last update: 2017-07-03
Build: ()