Static instance of PrimitiveWireImpl
This class participates in the engine library.
A primitive wire connects two functions, where the first function acts as the instigator of an action, and the second function acts as the handler for the action.
This class participates in the engine library.
Demonstrate how to wire two functions together with a primitive wire.
<script type = "text/javascript">
function Init(){
var _p = org.cote.js.wires.primitive.PrimitiveWire,w,w2,co;
/// Create a new custom object.
///
co = new CObj();
/// Wire custom object to function test
///
w = _p.wire(co,"testC",0,"test1");
/// Invoke wire #1 connecting custom object to function test2
/// Sending "test data" as a parameter
///
_p.invoke(w,["test data"]);
}
function test(){
alert('test: ' + arguments[0]);
}
function CObj(){
this.id = "XX";
this.testC = function(){
alert("TestC = " + this.id + "\n" + arguments[0]);
return 1;
}
}
</script>Object API structure for storing sub structures: object_config.pointers and object_config.status.
object = object.object_config
Unique instance identifier.
String = object.object_id
The type of this object.
String = object.object_type
Version of the object class.
String = object.object_version
Object load and execution state. Follows: 0 unitialized, 1 through 3 variant, 4 ready, 5 destroyed.
int = object.ready_state
Causes the specified wire to be invoked.
void fireWire( i )
Returns the unique id of the object.
i = getObjectId( )
i as String: The unique object instance id.
Returns the type of the object.
t = getObjectType( )
t as String: The type of the object instance.
Returns the version of the object.
v = getObjectVersion( )
v as String: The version of the object instance.
Returns the object_config.pointers sub structure.
o = getPointers( )
o as object: The object_config.pointers substructure.
Returns an array of primitive wires.
w = getPrimitiveWires( )
w as Array: Array of primitive wire objects.
Returns the state of the object.
s = getReadyState( )
s as int: The object ready state.
Returns the object_config.status sub structure.
o = getStatus( )
o as object: The object_config.status substructure.
Returns the wire object based on the specified Identifier.
r = getWire( i )
r as object: Returns a wire object.
Invokes a wire, causing the action-handler chain to be processed.
r = invoke( i, a, b, z, p, m )
r as boolean: Returns true if the chain completed successfully, false if otherwise.
Sends termination signal to destroy object.
void sigterm( )
Creates and returns a primitive wire based on the specified parameters.
i = wire( xp, x, yp, y, ep, e, tl )
i as String: Returns the identifier of the primitive wire object.