(.js)
laraImport("antarex.margot.codegen.MargotCodeGen");
(.lara)
import antarex.margot.codegen.MargotCodeGen;
Classes:
new MargotCodeGen(block, [vars])
This class contains the methods to generate and insert the code of the mARGOt interface in a target application.
Every method provided here will include the mARGOt header in the correct place if needed.
Every method provided here, except {@link MargotCodeGen.init}, will also insert a default initialization to the mARGOt framework at the start of the main function.
fromConfig(config, blockName)
Generates and returns the code generation instance needed for block with provided name.
init($joinpoint)
Inserts the code for the mARGOt initialization call. This function will find the parent scope of the provided join point and will insert the 'init' call at the start of that scope.
This function will throw an exception if it is not possible to find a scope from the provided join point.
This function will issue a warning and perform nothing if the initialization was already performed. Two possible causes:
1) This function is called following any other function that inserts code. By default, if any of those functions is called and 'init' was not called beforehand, the initialization code will be inserted at the start of the main function.
2) This function is called multiple times.
log($joinpoint)
Inserts code to log the collected data after the provided join point.
monitor($joinpoint, [startArgs], [stopArgs])
Inserts code to start and stop all monitors specified in the configuration around the provided join point.
This is equivalent to calling {@link MargotCodeGen.startMonitors} and then {@link MargotCodeGen.stopMonitors} with the same join point.
monitorLog($joinpoint, [startArgs], [stopArgs])
Inserts code to start and stop all monitors specified in the configuration around the provided join point, and also inserts the code to log after the join point.
This is equivalent to calling {@link MargotCodeGen.monitor} and then {@link MargotCodeGen.log} with the same join point.
setFeatures(features)
Sets the names of the variables that hold the values of the data features.
setGoal($joinpoint, goalName, goalValue)
Inserts code to set the value of a goal.
setKnobs(knobs)
Sets the names of the variables that hold the values of the knobs.
startMonitor($joinpoint, monitorName, [args])
Inserts code to start a single monitor specified in the configuration before the provided join point.
startMonitors($joinpoint, [startArgs])
Inserts code to start all monitors specified in the configuration before the provided join point.
stopMonitor($joinpoint, monitorName, [args])
Inserts code to stop a single monitor specified in the configuration after the provided join point.
stopMonitors($joinpoint, [stopArgs])
Inserts code to stop all monitors specified in the configuration after the provided join point.
update($joinpoint)
Inserts the update code before the provided join point.