User Tools

Site Tools


tools:cplusplus

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tools:cplusplus [2021/05/19 15:14] – [Templates] ursgraftools:cplusplus [2021/07/08 19:31] (current) – [Lambda Functions] ursgraf
Line 52: Line 52:
 ===== Lambda Functions ===== ===== Lambda Functions =====
 A lambda is an anonymous function which can be passed as a parameter. While using EEROS lambda functions are useful for several cases.  A lambda is an anonymous function which can be passed as a parameter. While using EEROS lambda functions are useful for several cases. 
-  * Safety system: +  * Safety system: see [[eeros_architecture:safety_system:properties#level_actions|Level Actions]]. 
-  * Function used by periodic: +  * Function used by periodic: see [[tools:logger_cs:start|]] 
-  * Generic block:+  * Generic block: see [[eeros_architecture:control_system:available_blocks:generic|]] 
 + 
 +A lambda function must be defined as follows 
 +<code cpp> 
 +[captures] (params) {body} 
 +</code> 
 +Captures are variables which are defined in the scope where the lambda function is defined and which can be made available to the lambda function either by value or by reference. Params are parameters which can be passed into the function like regular parameters. The body contains the code which is executed by the function.    
 + 
  
tools/cplusplus.1621430096.txt.gz · Last modified: 2021/05/19 15:14 by ursgraf