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 modeler function from the modeler API and call them in the modeler. See
HexalyModeler.create_function()
for more information on how to create external functions.- Since:
10.0
Summary¶
Returns the name of the function. |
Returns the name of the function. |
|
Calls the function with the provided arguments and returns the result. |
|
Calls the function with the provided arguments on the given object and returns the result. |
Calls the function with the provided arguments and returns the result. |
Instance methods¶
- HxmFunction.get_name()¶
Returns 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:
The name of the function.
- Return type:
str
- HxmFunction.call(*args)¶
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 funciton. The arguments must be of the following types:NoneType
(nil in Hexaly Modeler)bool
int
float
str
- Parameters:
args – List of arguments passed to the function.
- Returns:
Return value of the call.
- Return type:
one of the supported type among
NoneType
(nil in Hexaly Modeler),int
,float
,bool
,str
,HxExpression
,HxmFunction
,HxmModule
,HxmMap
,HxmClass
,HxmValue
- HxmFunction.call_this(this, *args)¶
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. The arguments must be of the following types:NoneType
(nil in Hexaly Modeler)bool
int
float
str
- Parameters:
this – The value to be used as the
this
variable.args – List of arguments passed to the function.
- Returns:
Return value of the call.
- Return type:
one of the supported type among
NoneType
(nil in Hexaly Modeler),int
,float
,bool
,str
,HxExpression
,HxmFunction
,HxmModule
,HxmMap
,HxmClass
,HxmValue
Instance attributes¶
- HxmFunction.name¶
Returns the name of the function. This is a shortcut for
HxmFunction.get_name()
.
Special operators and methods¶
- HxmFunction.__call__(*args)¶
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 funciton. The arguments must be of the following types:NoneType
(nil in Hexaly Modeler)bool
int
float
str
- Parameters:
args – List of arguments passed to the function.
- Returns:
Return value of the call.
- Return type:
one of the supported type among
NoneType
(nil in Hexaly Modeler),int
,float
,bool
,str
,HxExpression
,HxmFunction
,HxmModule
,HxmMap
,HxmClass
,HxmValue