HiveMind
|
Namespace to regroup the user functions, ie: custom functions that will be available in the buzz script. The functions needs to be registered using bbzvm_function_register. More...
Functions | |
void | log () |
Logs to the default output Signature log(args...) More... | |
void | registerClosure () |
register a new function, exposing it to the remote composant of the swarm Signature register_closure(fname, closure, args_desc) More... | |
void | callHostFunction () |
calls a function to a host Signature call_host_function(agent_id, fname, params) More... | |
void | callBuzzFunction () |
calls a function to a buzz Signature call_buzz_function(agent_id, fname, params) More... | |
void | isNil () |
Checks if a variable is nil Signature isnil(arg1) More... | |
void | isInt () |
Checks if a variable is an int Signature isint(arg1) More... | |
void | isFloat () |
Checks if a variable is a float. More... | |
void | isString () |
Checks if a variable is a float Signature istable(arg1) More... | |
void | isTable () |
Checks if a variable is a table Signature istable(arg1) More... | |
void | isClosure () |
Checks if a variable is a function closure Signature isclosure(arg1) More... | |
void | isLambdaClosure () |
Checks if a variable is a lambda, unamed closure Signature islambda_closure(arg1) More... | |
void | toInt () |
Casts a type to int Signature int(arg1) More... | |
void | toFloat () |
Casts a type to float Signature float(arg1) More... | |
void | delay () |
wait for a certain delay Signature delay(arg1) Warning this function make the whole VM sleep which can prevents the VM to processes messages from it's host or the swarm. Eventually the queue can overflow, you should use the executor to execute something every X steps. It is not recommended to use. More... | |
Variables | |
int16_t | g_vmStepDelayMs = 0 |
The delay between each call of the step function in buzz. More... | |
Namespace to regroup the user functions, ie: custom functions that will be available in the buzz script. The functions needs to be registered using bbzvm_function_register.
void BittyBuzzUserFunctions::callBuzzFunction | ( | ) |
calls a function to a buzz Signature call_buzz_function(agent_id, fname, params)
This closure expects three parameters.
The table argument's must be by index from 0 to N-1 args.
void BittyBuzzUserFunctions::callHostFunction | ( | ) |
calls a function to a host Signature call_host_function(agent_id, fname, params)
This closure expects three parameters.
The table argument's must be by index from 0 to N-1 args.
void BittyBuzzUserFunctions::delay | ( | ) |
wait for a certain delay Signature delay(arg1) Warning this function make the whole VM sleep which can prevents the VM to processes messages from it's host or the swarm. Eventually the queue can overflow, you should use the executor to execute something every X steps. It is not recommended to use.
This closure expects one positive int
void BittyBuzzUserFunctions::isClosure | ( | ) |
Checks if a variable is a function closure Signature isclosure(arg1)
This closure expects one parameter
void BittyBuzzUserFunctions::isFloat | ( | ) |
Checks if a variable is a float.
This closure expects one parameter
void BittyBuzzUserFunctions::isInt | ( | ) |
Checks if a variable is an int Signature isint(arg1)
This closure expects one parameter
void BittyBuzzUserFunctions::isLambdaClosure | ( | ) |
Checks if a variable is a lambda, unamed closure Signature islambda_closure(arg1)
This closure expects one parameter
void BittyBuzzUserFunctions::isNil | ( | ) |
Checks if a variable is nil Signature isnil(arg1)
This closure expects one parameter
void BittyBuzzUserFunctions::isString | ( | ) |
Checks if a variable is a float Signature istable(arg1)
This closure expects one parameter
void BittyBuzzUserFunctions::isTable | ( | ) |
Checks if a variable is a table Signature istable(arg1)
This closure expects one parameter
void BittyBuzzUserFunctions::log | ( | ) |
void BittyBuzzUserFunctions::registerClosure | ( | ) |
register a new function, exposing it to the remote composant of the swarm Signature register_closure(fname, closure, args_desc)
This closure expects four parameters, the closure can be a lambda.
The table description of the arguments is an array of tuples, which hold the arg name as key and a value (float or int), only the type is check, so the value is not considered.You could define a variable as int=0 float=0.0 and use those variables for types description
void BittyBuzzUserFunctions::toFloat | ( | ) |
Casts a type to float Signature float(arg1)
This closure expects one parameter
void BittyBuzzUserFunctions::toInt | ( | ) |
Casts a type to int Signature int(arg1)
This closure expects one parameter
int16_t BittyBuzzUserFunctions::g_vmStepDelayMs = 0 |
The delay between each call of the step function in buzz.