Class Index
static org.cote.js.wires.wire
version 1.9.18
Static initializer for new Wire instances.
This class participates in the engine library.
Index
Method Index
- public newInstance: Creates and returns a new Wire instance.
Methods
newInstance
Creates and returns a new Wire instance.
Syntax
w = newInstance(
)
Returns
w as Wire: Returns a new Wire instance.
org.cote.js.wires.Wire
version 1.9.18
Service for extending PrimitiveWire utility, auto-linking PrimitiveWires together, and reusing PrimitiveWires.
This class participates in the engine library.
Index
Property Index
- public object_config (internal): Object API structure for storing sub structures: object_config.pointers and object_config.status.
- public object_id (internal): Unique instance identifier.
- public object_type (internal): The type of this object.
- public object_version (internal): Version of the object class.
- public ready_state (internal): Object load and execution state. Follows: 0 unitialized, 1 through 3 variant, 4 ready, 5 destroyed.
Method Index
- public getCanSignal: Returns whether the underlying PrimitiveWire objects signal to each other based on commonality between actions and handlers.
- public getObjectId: Returns the unique id of the object.
- public getObjectType: Returns the type of the object.
- public getObjectVersion: Returns the version of the object.
- public getPointers: Returns the object_config.pointers sub structure.
- public getReadyState: Returns the state of the object.
- public getStatus: Returns the object_config.status sub structure.
- public hardWire: Invokes the action of a hardened wire.
- public invoke: Invokes a specified function that exists on the wire.
- public invokeHardWireAction: Invokes the action of a hardened wire.
- public invokeHardWireHandler: Invokes the handler of a hardened wire.
- public invokePrimitive: Invokes a wire, causing the action-handler chain to be processed.
- public primitiveWire: Creates and returns a PrimiteWire based on the specified parameters.
- public setCanSignal: Specifies whether the underlying PrimitiveWire objects signal to each other based on commonality between actions and handlers.
- public sigterm: Sends termination signal to destroy object.
- public wire: Creates and returns a wire based on the specified parameters. This function creates an underlying PrimitiveWire as well as creating linkage to be connected with other wires.
Properties
object_config
Object API structure for storing sub structures: object_config.pointers and object_config.status.
Syntax
object = object.object_config
object_id
Unique instance identifier.
Syntax
String = object.object_id
object_type
The type of this object.
Syntax
String = object.object_type
object_version
Version of the object class.
Syntax
String = object.object_version
ready_state
Object load and execution state. Follows: 0 unitialized, 1 through 3 variant, 4 ready, 5 destroyed.
Syntax
int = object.ready_state
Methods
getCanSignal
Returns whether the underlying PrimitiveWire objects signal to each other based on commonality between actions and handlers.
Syntax
b = getCanSignal(
)
Returns
b as boolean: Bit indicating whether PrimitiveWires signal to each other.
getObjectId
Returns the unique id of the object.
Syntax
i = getObjectId(
)
Returns
i as String: The unique object instance id.
getObjectType
Returns the type of the object.
Syntax
t = getObjectType(
)
Returns
t as String: The type of the object instance.
getObjectVersion
Returns the version of the object.
Syntax
v = getObjectVersion(
)
Returns
v as String: The version of the object instance.
getPointers
Returns the object_config.pointers sub structure.
Syntax
o = getPointers(
)
Returns
o as object: The object_config.pointers substructure.
getReadyState
Returns the state of the object.
Syntax
s = getReadyState(
)
Returns
s as int: The object ready state.
getStatus
Returns the object_config.status sub structure.
Syntax
o = getStatus(
)
Returns
o as object: The object_config.status substructure.
hardWire
Invokes the action of a hardened wire.
Syntax
i = hardWire(
o, i, aa, ha, xp, x, yp, y, ep, e, ea
)
Parameters
- o as PrimitiveWire : A PrimitiveWire object.
- i as String : Identifier of a primitive wire.
- aa as array (optional): Arguments to pass to the action function.
- ha as array (optional): Arguments to pass to the handler function.
- xp as variant : Object, or string evaluation, to which the action function is defined.
- x as function : The action function.
- yp as variant : Object, or string evaluation, to which the handler function is defined.
- y as function : The hander function.
- ep as variant : Object, or string evaluation, to which the error function is defined.
- e as function : The error function.
- ea as array (optional): Arguments to pass to the error function.
Returns
i as String: Returns the identifier of the newly created hardened wire.
invoke
Invokes a specified function that exists on the wire.
Syntax
v = invoke(
a, x, f, b, o
)
Parameters
- a as array : Arguments to pass to the wired functions.
- x as variant : String evaluation or object on which the specified wire function exists.
- f as String : Name of function to invoke.
- b as boolean : Force the wire handler to execute.
- o as boolean : Bit specifying only the handler should fire.
Returns
v as variant: Returns false if unsuccessful, true otherwise.
invokeHardWireAction
Invokes the action of a hardened wire.
Syntax
r = invokeHardWireAction(
o, i, a
)
Parameters
- o as PrimitiveWire : A PrimitiveWire object.
- i as String : Identifier of a wire.
- a as array (optional): Arguments to pass to the wired functions.
Returns
r as boolean: Returns true if the chain completed successfully, false if otherwise.
invokeHardWireHandler
Invokes the handler of a hardened wire.
Syntax
r = invokeHardWireHandler(
o, i, a
)
Parameters
- o as PrimitiveWire : A PrimitiveWire object.
- i as String : Identifier of a wire.
- a as array (optional): Arguments to pass to the wired functions.
Returns
r as boolean: Returns true if the chain completed successfully, false if otherwise.
invokePrimitive
Invokes a wire, causing the action-handler chain to be processed.
Syntax
r = invokePrimitive(
a, i, b, z
)
Parameters
- a as array (optional): Arguments to pass to the wired functions.
- i as String : Identifier of the primitive wire to invoke.
- b as boolean (optional): Bit indicating only the handler should be fired.
- z as boolean (optional): Bit indicating the handler should be skipped.
Returns
r as boolean: Returns true if the chain completed successfully, false if otherwise.
primitiveWire
Creates and returns a PrimiteWire based on the specified parameters.
Syntax
i = primitiveWire(
xp, x, yp, y, ep, e
)
Parameters
- xp as variant : Object, or string evaluation, to which the action function is defined.
- x as function : The action function.
- yp as variant : Object, or string evaluation, to which the handler function is defined.
- y as function : The hander function.
- ep as variant : Object, or string evaluation, to which the error function is defined.
- e as function : The error function.
Returns
i as String: Returns the identifier of the PrimitiveWire object.
setCanSignal
Specifies whether the underlying PrimitiveWire objects signal to each other based on commonality between actions and handlers.
Syntax
void setCanSignal(
b
)
Parameters
- b as boolean : Bit indicating similar PrimitiveWires signal to each other.
sigterm
Sends termination signal to destroy object.
Syntax
void sigterm(
)
wire
Creates and returns a wire based on the specified parameters. This function creates an underlying PrimitiveWire as well as creating linkage to be connected with other wires.
Syntax
i = wire(
xp, x, yp, y, ep, e
)
Parameters
- xp as variant : Object, or string evaluation, to which the action function is defined.
- x as function : The action function.
- yp as variant : Object, or string evaluation, to which the handler function is defined.
- y as function : The hander function.
- ep as variant : Object, or string evaluation, to which the error function is defined.
- e as function : The error function.
Returns
i as String: Returns the identifier of the wire object.