Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
BlockExecuter.h
00001 #ifndef BLOCK_EXEC_H 00002 #define BLOCK_EXEC_H 00003 00004 #include "mbed.h" 00005 00006 /* Helper class to execute something whenever entering/leaving a basic block */ 00007 class BlockExecuter { 00008 public: 00009 BlockExecuter(Callback<void()> exit_cb, Callback<void()> enter_cb = Callback<void()>()) : 00010 _exit_cb(exit_cb) { 00011 if((bool)enter_cb) enter_cb(); 00012 } 00013 00014 ~BlockExecuter(void) { 00015 _exit_cb(); 00016 } 00017 00018 private: 00019 Callback<void()> _exit_cb; 00020 }; 00021 00022 #endif //BLOCK_EXEC_H
Generated on Tue Jul 12 2022 16:59:38 by
1.7.2