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.
wifi-x-nucleo-idw01m1/BlockExecuter.h
- Committer:
- mayur098
- Date:
- 2018-06-21
- Revision:
- 0:8f8e8f3cbd1c
File content as of revision 0:8f8e8f3cbd1c:
#ifndef BLOCK_EXEC_H #define BLOCK_EXEC_H #include "mbed.h" /* Helper class to execute something whenever entering/leaving a basic block */ class BlockExecuter { public: BlockExecuter(Callback<void()> exit_cb, Callback<void()> enter_cb = Callback<void()>()) : _exit_cb(exit_cb) { if((bool)enter_cb) enter_cb(); } ~BlockExecuter(void) { _exit_cb(); } private: Callback<void()> _exit_cb; }; #endif //BLOCK_EXEC_H