File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -59,14 +59,12 @@ int main()
59
59
60
60
// Registering a SimpleActionNode using a function pointer.
61
61
// you may also use C++11 lambdas instead of std::bind
62
- factory.registerSimpleCondition (" CheckBattery" , std::bind ( CheckBattery) );
62
+ factory.registerSimpleCondition (" CheckBattery" , [&](TreeNode&) { return CheckBattery (); } );
63
63
64
64
// You can also create SimpleActionNodes using methods of a class
65
65
GripperInterface gripper;
66
- factory.registerSimpleAction (" OpenGripper" ,
67
- std::bind (&GripperInterface::open, &gripper));
68
- factory.registerSimpleAction (" CloseGripper" ,
69
- std::bind (&GripperInterface::close, &gripper));
66
+ factory.registerSimpleAction (" OpenGripper" , [&](TreeNode&){ return gripper.open (); } );
67
+ factory.registerSimpleAction (" CloseGripper" , [&](TreeNode&){ return gripper.close (); } );
70
68
71
69
#else
72
70
// Load dynamically a plugin and register the TreeNodes it contains
You can’t perform that action at this time.
0 commit comments