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.
Dependents: app_emwin1 app_emwin2_pos lpc4088_ebb_gui_emwin
EwFunctionPointer.cpp@0:316c181e9b65, 2013-12-16 (annotated)
- Committer:
 - embeddedartists
 - Date:
 - Mon Dec 16 07:03:22 2013 +0000
 - Revision:
 - 0:316c181e9b65
 
First commit
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| embeddedartists | 0:316c181e9b65 | 1 | /* mbed Microcontroller Library | 
| embeddedartists | 0:316c181e9b65 | 2 | * Copyright (c) 2006-2013 ARM Limited | 
| embeddedartists | 0:316c181e9b65 | 3 | * | 
| embeddedartists | 0:316c181e9b65 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | 
| embeddedartists | 0:316c181e9b65 | 5 | * you may not use this file except in compliance with the License. | 
| embeddedartists | 0:316c181e9b65 | 6 | * You may obtain a copy of the License at | 
| embeddedartists | 0:316c181e9b65 | 7 | * | 
| embeddedartists | 0:316c181e9b65 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 | 
| embeddedartists | 0:316c181e9b65 | 9 | * | 
| embeddedartists | 0:316c181e9b65 | 10 | * Unless required by applicable law or agreed to in writing, software | 
| embeddedartists | 0:316c181e9b65 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, | 
| embeddedartists | 0:316c181e9b65 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
| embeddedartists | 0:316c181e9b65 | 13 | * See the License for the specific language governing permissions and | 
| embeddedartists | 0:316c181e9b65 | 14 | * limitations under the License. | 
| embeddedartists | 0:316c181e9b65 | 15 | */ | 
| embeddedartists | 0:316c181e9b65 | 16 | #include "EwFunctionPointer.h" | 
| embeddedartists | 0:316c181e9b65 | 17 | |
| embeddedartists | 0:316c181e9b65 | 18 | |
| embeddedartists | 0:316c181e9b65 | 19 | |
| embeddedartists | 0:316c181e9b65 | 20 | EwFunctionPointer::EwFunctionPointer(void (*function)(EwWindow* w)) { | 
| embeddedartists | 0:316c181e9b65 | 21 | attach(function); | 
| embeddedartists | 0:316c181e9b65 | 22 | } | 
| embeddedartists | 0:316c181e9b65 | 23 | |
| embeddedartists | 0:316c181e9b65 | 24 | void EwFunctionPointer::attach(void (*function)(EwWindow* w)) { | 
| embeddedartists | 0:316c181e9b65 | 25 | _function = function; | 
| embeddedartists | 0:316c181e9b65 | 26 | _object = 0; | 
| embeddedartists | 0:316c181e9b65 | 27 | } | 
| embeddedartists | 0:316c181e9b65 | 28 | |
| embeddedartists | 0:316c181e9b65 | 29 | void EwFunctionPointer::call(EwWindow* w) { | 
| embeddedartists | 0:316c181e9b65 | 30 | if (_function) { | 
| embeddedartists | 0:316c181e9b65 | 31 | _function(w); | 
| embeddedartists | 0:316c181e9b65 | 32 | } else if (_object) { | 
| embeddedartists | 0:316c181e9b65 | 33 | _membercaller(_object, _member, w); | 
| embeddedartists | 0:316c181e9b65 | 34 | } | 
| embeddedartists | 0:316c181e9b65 | 35 | } | 
| embeddedartists | 0:316c181e9b65 | 36 | |
| embeddedartists | 0:316c181e9b65 | 37 | |
| embeddedartists | 0:316c181e9b65 | 38 |