HxmFunction Class

class Hexaly.Modeler.HxmFunction

A function can be either a user-defined function or a built-in function. It is possible to create external functions from the modeler API and call them in the modeler. See HxmFunctor for more information on how to create external functions.

See:

HxmFunctor

Since:

10.0

Summary

Methods

GetDeclaredName

Gets the name of the function.

Call

Calls the function with no argument and returns the result.

CallThis

Calls the function with no argument on the given object and returns the result.

AsValue

Gets the function as an HxmValue.

Dispose

Releases the reference.

Instance methods

string GetDeclaredName()

Gets the name of the function. The name of the function does not necessarily reflect the name of the variable(s) to which the function is associated. The name is mainly used to identify the function in stack traces when exceptions occur.

Returns:

Name of the function.

Return type:

string

HxmValue Call()

Calls the function with no argument and returns the result. The call is not bound to an object. Consequently, the this variable will be nil within the function.

Returns:

Return value of the call.

Return type:

HxmValue

HxmValue Call(params HxmValue[] arguments)
HxmValue Call(List<HxmValue> arguments)

Calls the function with the provided arguments and returns the result. The call is not bound to an object. Consequently, the this variable will be nil within the function.

Arguments:

arguments – List of arguments.

Returns:

Return value of the call.

Return type:

HxmValue

HxmValue CallThis(HxmValue self)

Calls the function with no argument on the given object and returns the result. Within the function, the this variable will be initialized to the supplied object.

Since:

13.0

Arguments:

self (HxmValue) – The value to be used as the this variable.

Returns:

Return value of the call.

Return type:

HxmValue

HxmValue CallThis(HxmValue self, params HxmValue[] arguments)
HxmValue CallThis(HxmValue self, List<HxmValue> arguments)

Calls the function with the provided arguments on the given object and returns the result. Within the function, the this variable will be initialized to the supplied object.

Since:

13.0

Arguments:
  • self (HxmValue) – The value to be used as the this variable.

  • arguments – List of arguments.

Returns:

Return value of the call.

Return type:

HxmValue

HxmValue AsValue()

Gets the function as an HxmValue.

Return type:

HxmValue

void Dispose()

Releases the reference. If this function was already released, returns immediately and does nothing. Invoking any method on this object after this operation will throw an exception.

Note: Releasing a reference does not necessarily imply that the underlying function object is destroyed. It is only destroyed if no more references point to it.

Since:

11.5