<source><name>Hemi.wires.primitive</name><project><name>Hemi JavaScript Framework</name><url-title>Hemi JavaScript Framework</url-title><url>/Hemi/</url></project><package><path>Hemi.wires</path><library>Hemi</library><description>The primitive wire service is used to connect two disparate functions together.</description><static-class><name>service</name><version>3.1.9</version><description>Static instance of PrimitiveWireImpl</description></static-class><class><name>serviceImpl</name><version>3.1.9</version><description>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.</description><example><description>Demonstrate how to wire two functions together with a primitive wire.</description><name>Wire two functions together</name><code><![CDATA[<script type = "text/javascript">]]></code><code><![CDATA[ ]]></code><code><![CDATA[function Init(){]]></code><code><![CDATA[var _p = Hemi.wires.primitive.PrimitiveWire,w,w2,co;]]></code><code><![CDATA[	/// Create a new custom object.]]></code><code><![CDATA[	///]]></code><code><![CDATA[	co = new CObj();]]></code><code><![CDATA[	/// Wire custom object to function test]]></code><code><![CDATA[	///]]></code><code><![CDATA[	w = _p.wire(co,"testC",0,"test1");]]></code><code><![CDATA[	]]></code><code><![CDATA[	/// Invoke wire #1 connecting custom object to function test2]]></code><code><![CDATA[	/// Sending "test data" as a parameter]]></code><code><![CDATA[	///]]></code><code><![CDATA[	_p.invoke(w,["test data"]);]]></code><code><![CDATA[}]]></code><code><![CDATA[function test(){]]></code><code><![CDATA[   alert('test: ' + arguments[0]);]]></code><code><![CDATA[}]]></code><code><![CDATA[function CObj(){]]></code><code><![CDATA[	this.id = "XX";]]></code><code><![CDATA[	this.testC = function(){]]></code><code><![CDATA[		alert("TestC = " + this.id + "\n" + arguments[0]);]]></code><code><![CDATA[		return 1;]]></code><code><![CDATA[	}]]></code><code><![CDATA[}]]></code><code><![CDATA[</script>]]></code></example><property type="String" get="1" internal="1"><name>object_id</name><description>Unique instance identifier.</description></property><property type="String" get="1" internal="1"><name>object_version</name><description>Version of the object class.</description></property><property type="String" get="1" internal="1"><name>object_type</name><description>The type of this object.</description></property><property type="int" get="1" internal="1"><name>ready_state</name><description>Object load and execution state.  Follows: 0 unitialized, 1 through 3 variant, 4 ready, 5 destroyed.</description></property><property type="object" get="1" internal="1"><name>object_config</name><description>Object API structure for storing sub structures: objects and properties.</description></property><method><name>getObjectId</name><return-value name="i" type="String">The unique object instance id.</return-value><description>Returns the unique id of the object.</description></method><method><name>getObjectType</name><return-value name="t" type="String">The type of the object instance.</return-value><description>Returns the type of the object.</description></method><method><name>getObjectVersion</name><return-value name="v" type="String">The version of the object instance.</return-value><description>Returns the version of the object.</description></method><method><name>getReadyState</name><return-value name="s" type="int">The object ready state.</return-value><description>Returns the state of the object.</description></method><method><name>getStatus</name><return-value name="o" type="object">The properties substructure.</return-value><description>Returns the properties sub structure.</description></method><method><name>getPointers</name><return-value name="o" type="object">The objects substructure.</return-value><description>Returns the objects sub structure.</description></method><method><name>getPrimitiveWires</name><return-value name="w" type="Array">Array of primitive wire objects.</return-value><description>Returns an array of primitive wires.</description></method><method><name>sigterm</name><description>Sends termination signal to destroy object.</description></method><method><name>invoke</name><param name="i" type="String">Identifier of the primitive wire to invoke.</param><param name="a" type="array" optional="1">Arguments to pass to the wired functions.</param><param name="b" type="boolean" optional="1" default="false">Bit indicating the handler should be force-fired even if the action did not evaluate to true.</param><param name="z" type="boolean" optional="1" default="false">Bit indicating the handler should be skipped.</param><param name="p" type="boolean" optional="1" default="false">Bit indicating the wire should be preserved.</param><param name="m" type="boolean" optional="1" default="false">Bit indicating the wire may be used more than once.</param><return-value name="r" type="boolean">Returns true if the chain completed successfully, false if otherwise.</return-value><description>Invokes a wire, causing the action-handler chain to be processed.</description></method><method internal="1"><name>getWire</name><param name="i" type="String">Identifier of the primitive wire.</param><return-value name="r" type="object">Returns a wire object.</return-value><description>Returns the wire object based on the specified Identifier.</description></method><method><name>fireWire</name><param name="i" type="String">Identifier of the primitive wire.</param><description>Causes the specified wire to be invoked.</description></method><method><name>wire</name><param name="xp" type="variant">Object, or string evaluation, to which the action function is defined.</param><param name="x" type="function">The action function.</param><param name="yp" type="variant">Object, or string evaluation, to which the handler function is defined.</param><param name="y" type="function">The hander function.</param><param name="ep" type="variant">Object, or string evaluation, to which the error function is defined.</param><param name="e" type="function">The error function.</param><param name="tl" type="String" optional="1">The label prefix of the wire.</param><return-value name="i" type="String">Returns the identifier of the primitive wire object.</return-value><description>Creates and returns a primitive wire based on the specified parameters.</description></method></class></package><index><description>The primitive wire service is used to connect two disparate functions together.</description><url>Hemi_api.html</url><url-title>API Index</url-title></index></source>
