HxmFunction Class

class 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

Functions

getDeclaredName

Gets the name of the function.

call

Calls the function with no argument and returns the result.

call

Calls the function with the provided arguments and returns the result.

call

Calls the function with the provided arguments and returns the result.

call

Calls the function with the provided arguments.

asValue

Returns the function as an HxmValue.

Overloaded operators

HxmValue

Returns the function as an HxmValue.

Functions

std::string HxmFunction::getDeclaredName() const

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.

HxmValue HxmFunction::call()

Calls the function with no argument and returns the result.

Returns:

Return value of the call.

HxmValue HxmFunction::call(const std::vector<HxmValue> &arguments)

Calls the function with the provided arguments and returns the result.

Parameters:

arguments – List of arguments.

Returns:

Return value of the call.

HxmValue HxmFunction::call(const HxmValue *arguments, int nbArguments)

Calls the function with the provided arguments and returns the result.

Parameters:
  • arguments – Pointer to the first argument.

  • nbArguments – Number of arguments.

Returns:

Return value of the call.

template<typename T>
HxmValue HxmFunction::call(T begin, T end)

Calls the function with the provided arguments. The arguments must be iterators referencing HxmValues.

Parameters:
  • T – Type of an iterator referencing HxmValues.

  • begin – Iterator to the beginning of the arguments.

  • end – Iterator to the end of the arguments.

Returns:

Return value of the call.

HxmValue HxmFunction::asValue() const

Returns the function as an HxmValue.

See:

HxmValue

Overloaded operators

explicit operator HxmFunction::HxmValue() const

Returns the function as an HxmValue.

See:

HxmValue