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.
handler.hpp@2:2a826741387f, 2010-12-01 (annotated)
- Committer:
- etherealflaim
- Date:
- Wed Dec 01 21:41:52 2010 +0000
- Revision:
- 2:2a826741387f
- Parent:
- 0:86ff0a55c978
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| etherealflaim | 0:86ff0a55c978 | 1 | template <class Result> |
| etherealflaim | 0:86ff0a55c978 | 2 | class handler |
| etherealflaim | 0:86ff0a55c978 | 3 | { |
| etherealflaim | 0:86ff0a55c978 | 4 | public: |
| etherealflaim | 0:86ff0a55c978 | 5 | virtual inline Result operator() () const {}; |
| etherealflaim | 0:86ff0a55c978 | 6 | }; |
| etherealflaim | 0:86ff0a55c978 | 7 | |
| etherealflaim | 0:86ff0a55c978 | 8 | template <class Result> |
| etherealflaim | 0:86ff0a55c978 | 9 | class function_handler |
| etherealflaim | 0:86ff0a55c978 | 10 | : public handler <Result> |
| etherealflaim | 0:86ff0a55c978 | 11 | { |
| etherealflaim | 0:86ff0a55c978 | 12 | protected: |
| etherealflaim | 0:86ff0a55c978 | 13 | Result (*pfunc)(); |
| etherealflaim | 0:86ff0a55c978 | 14 | public: |
| etherealflaim | 0:86ff0a55c978 | 15 | explicit inline function_handler ( Result (*f)() ) : pfunc (f) {} |
| etherealflaim | 0:86ff0a55c978 | 16 | virtual inline Result operator() () const { return pfunc(); } |
| etherealflaim | 0:86ff0a55c978 | 17 | }; |
| etherealflaim | 0:86ff0a55c978 | 18 | |
| etherealflaim | 0:86ff0a55c978 | 19 | template <class Type, class Result> |
| etherealflaim | 0:86ff0a55c978 | 20 | class member_handler |
| etherealflaim | 0:86ff0a55c978 | 21 | : public handler <Result> |
| etherealflaim | 0:86ff0a55c978 | 22 | { |
| etherealflaim | 0:86ff0a55c978 | 23 | protected: |
| etherealflaim | 0:86ff0a55c978 | 24 | Type *inst; |
| etherealflaim | 0:86ff0a55c978 | 25 | Result (Type::*pfunc)(); |
| etherealflaim | 0:86ff0a55c978 | 26 | public: |
| etherealflaim | 0:86ff0a55c978 | 27 | explicit inline member_handler ( Type *i, Result (Type::*f)() ) : inst(i), pfunc (f) {} |
| etherealflaim | 0:86ff0a55c978 | 28 | virtual inline Result operator() () const { return (inst->*pfunc)(); } |
| etherealflaim | 0:86ff0a55c978 | 29 | }; |