new Proxy(classToBeProxied, replacementFunction)
Creates a Proxy for the specified class. This should not be used directly in most cases.
olympe.df.createProxy is the preferred way to create a proxy.
Parameters:
| Name | Type | Description |
|---|---|---|
classToBeProxied |
function | Class this proxy will wrap. |
replacementFunction |
function | The interception function to use. |
Extends
- T
Methods
-
<static> createNew(classToBeProxied, funcToBeCalled)
-
Creates a fake instance of the proxy class.
Parameters:
Name Type Description classToBeProxiedfunction funcToBeCalledfunction Returns:
the created proxy.
- Type
- olympe.df.Proxy.<T>
-
<static> isProxy(object)
-
Checks if the specified object is a proxy.
Parameters:
Name Type Description object* - Deprecated:
-
- Use
olympe.df.isProxyinstead.
- Use
Returns:
true if the object is a Proxy
- Type
- boolean
-
__assign(data)
-
This method is a shortcut for assigning values to a data flow, it is useful when switching from dataflow to classic and vice-versa
Parameters:
Name Type Description dataolympe.df.Proxy.<T> | olympe.df.Node.<T> | T Returns:
This instance
- Type
- olympe.df.Proxy.<T>
-
__cast(newType)
-
removes all the methods of the old proxied object class and add all the methods of the new proxied object
Parameters:
Name Type Description newTypefunction Returns:
This instance
- Type
- olympe.df.Proxy
-
__clearNodeValue()
-
Clears the node value
Returns:
- Type
- olympe.df.Proxy.<T>
-
__dispose()
-
Destroys the proxy and the node.
-
__freeze()
-
If this Proxy/Node is a repeater, disconnect it from its provider, in essence freezing its value to the current one.
-
__getCurrentValue()
-
Nota: use this function with caution, shortcuts all dataflows...
Returns:
- Type
- T
-
__getNativeId()
-
Gets the native ID of this Proxy.
Returns:
- Type
- number
-
__getNode()
-
Returns:
- Type
- olympe.df.Node.<T>
-
__getProxyObjectStringRepresentation()
-
Returns:
- Type
- string
-
__getType()
-
Returns the type of the proxied object.
Returns:
the type of the proxied object
- Type
- function
-
__onResolved(onResolvedFunction [, scope] [, returnedType] [, args] [, debugName])
-
Execute the specified callback every time the value of the associated node changes.
Parameters:
Name Type Argument Description onResolvedFunctionfunction function to be called when the node behind this proxy is resolved
scopeObject <optional>
scope of the onResolvedFunction when called
returnedTypefunction <optional>
the type that will be returned by the function
argsArray <optional>
<nullable>
Arguments to pass to the callback
debugNamestring <optional>
- Deprecated:
-
- Use
olympe.df.transformFlowsinstead.
- Use
Returns:
- Type
- olympe.df.Proxy.<T2>
-
__repeat(nodeOrProxy)
-
Changes this Proxy/Node into a repeater (or pass-through). Such a node forwards the value changes without additional processing.
Parameters:
Name Type Description nodeOrProxyolympe.df.Node.<T> | olympe.df.Proxy.<T> The node or proxy to repeat
Returns:
This instance
- Type
- olympe.df.Proxy.<T>
-
__setDefaultValue(value)
-
Sets the default value of this proxy node
Parameters:
Name Type Description valueT | olympe.df.Proxy.<T> Returns:
This proxy
- Type
- olympe.df.Proxy.<T>
-
__setNativeId(uiId)
-
Sets the native ID of this Proxy.
Parameters:
Name Type Description uiIdnumber the new unique ID
-
__setNode(node)
-
Parameters:
Name Type Description nodeolympe.df.Node.<T> -
__setNodeValue(value)
-
Sets the node value
Parameters:
Name Type Description valueT Returns:
- Type
- olympe.df.Proxy.<T>
-
__setValue(value)
-
Parameters:
Name Type Description valueT -
__toCurrentString()
-
Gets a string representation of the proxy.
Returns:
- Type
- string
-
__withDefaultValue(value)
-
Creates a new proxy repeating this one with a default value
This function differs from __setDefaultValue in the sense that the initial proxy is left untouched (since this function creates a new proxy), and thus will not carry an initial value (only the repeating proxy will have the initial value). This allows to use the initial proxy (without initial value) somewhere where no default value is required, and the repeating proxy (with default value) somewhere else.
Parameters:
Name Type Description valueT | olympe.df.Proxy.<T> Returns:
- Type
- olympe.df.Proxy.<T>
-
equals(obj)
-
Creates a node that checks whether this Proxy is equal to the object passed in argument.
Parameters:
Name Type Description obj* the object to compare with
Returns:
true if both objects are the same
- Type
- olympe.df.Proxy.<Boolean>
-
oEquals(obj)
-
Creates a node that checks whether the values of the arguments are equal.
Parameters:
Name Type Description obj* Returns:
- Type
- olympe.df.POBoolean
Olympe SDK