Opencv 3.1 project on GR-PEACH board

Fork of gr-peach-opencv-project by the do

Committer:
thedo
Date:
Tue Jul 04 06:23:13 2017 +0000
Revision:
170:54ff26da7eb6
Parent:
167:1657b442184c
project opencv 3.1 on GR PEACH board, no use SD card.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
thedo 167:1657b442184c 1 /* mbed Microcontroller Library
thedo 167:1657b442184c 2 * Copyright (c) 2006-2015 ARM Limited
thedo 167:1657b442184c 3 *
thedo 167:1657b442184c 4 * Licensed under the Apache License, Version 2.0 (the "License");
thedo 167:1657b442184c 5 * you may not use this file except in compliance with the License.
thedo 167:1657b442184c 6 * You may obtain a copy of the License at
thedo 167:1657b442184c 7 *
thedo 167:1657b442184c 8 * http://www.apache.org/licenses/LICENSE-2.0
thedo 167:1657b442184c 9 *
thedo 167:1657b442184c 10 * Unless required by applicable law or agreed to in writing, software
thedo 167:1657b442184c 11 * distributed under the License is distributed on an "AS IS" BASIS,
thedo 167:1657b442184c 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
thedo 167:1657b442184c 13 * See the License for the specific language governing permissions and
thedo 167:1657b442184c 14 * limitations under the License.
thedo 167:1657b442184c 15 */
thedo 167:1657b442184c 16 #ifndef MBED_FUNCTIONPOINTER_H
thedo 167:1657b442184c 17 #define MBED_FUNCTIONPOINTER_H
thedo 167:1657b442184c 18
thedo 167:1657b442184c 19 #include "platform/Callback.h"
thedo 167:1657b442184c 20 #include "platform/mbed_toolchain.h"
thedo 167:1657b442184c 21 #include <string.h>
thedo 167:1657b442184c 22 #include <stdint.h>
thedo 167:1657b442184c 23
thedo 167:1657b442184c 24 namespace mbed {
thedo 167:1657b442184c 25 /** \addtogroup platform */
thedo 167:1657b442184c 26
thedo 167:1657b442184c 27
thedo 167:1657b442184c 28 // Declarations for backwards compatibility
thedo 167:1657b442184c 29 // To be foward compatible, code should adopt the Callback class
thedo 167:1657b442184c 30 /**
thedo 167:1657b442184c 31 * @ingroup platform
thedo 167:1657b442184c 32 */
thedo 167:1657b442184c 33 template <typename R, typename A1>
thedo 167:1657b442184c 34 class FunctionPointerArg1 : public Callback<R(A1)> {
thedo 167:1657b442184c 35 public:
thedo 167:1657b442184c 36 MBED_DEPRECATED_SINCE("mbed-os-5.1",
thedo 167:1657b442184c 37 "FunctionPointerArg1<R, A> has been replaced by Callback<R(A)>")
thedo 167:1657b442184c 38 FunctionPointerArg1(R (*function)(A1) = 0)
thedo 167:1657b442184c 39 : Callback<R(A1)>(function) {}
thedo 167:1657b442184c 40
thedo 167:1657b442184c 41 template<typename T>
thedo 167:1657b442184c 42 MBED_DEPRECATED_SINCE("mbed-os-5.1",
thedo 167:1657b442184c 43 "FunctionPointerArg1<R, A> has been replaced by Callback<R(A)>")
thedo 167:1657b442184c 44 FunctionPointerArg1(T *object, R (T::*member)(A1))
thedo 167:1657b442184c 45 : Callback<R(A1)>(object, member) {}
thedo 167:1657b442184c 46
thedo 167:1657b442184c 47 R (*get_function())(A1) {
thedo 167:1657b442184c 48 return *reinterpret_cast<R (**)(A1)>(this);
thedo 167:1657b442184c 49 }
thedo 167:1657b442184c 50
thedo 167:1657b442184c 51 R call(A1 a1) const {
thedo 167:1657b442184c 52 if (!Callback<R(A1)>::operator bool()) {
thedo 167:1657b442184c 53 return (R)0;
thedo 167:1657b442184c 54 }
thedo 167:1657b442184c 55
thedo 167:1657b442184c 56 return Callback<R(A1)>::call(a1);
thedo 167:1657b442184c 57 }
thedo 167:1657b442184c 58
thedo 167:1657b442184c 59 R operator()(A1 a1) const {
thedo 167:1657b442184c 60 return Callback<R(A1)>::call(a1);
thedo 167:1657b442184c 61 }
thedo 167:1657b442184c 62 };
thedo 167:1657b442184c 63
thedo 167:1657b442184c 64 /**
thedo 167:1657b442184c 65 * @ingroup platform
thedo 167:1657b442184c 66 */
thedo 167:1657b442184c 67 template <typename R>
thedo 167:1657b442184c 68 class FunctionPointerArg1<R, void> : public Callback<R()> {
thedo 167:1657b442184c 69 public:
thedo 167:1657b442184c 70 MBED_DEPRECATED_SINCE("mbed-os-5.1",
thedo 167:1657b442184c 71 "FunctionPointer has been replaced by Callback<void()>")
thedo 167:1657b442184c 72 FunctionPointerArg1(R (*function)() = 0)
thedo 167:1657b442184c 73 : Callback<R()>(function) {}
thedo 167:1657b442184c 74
thedo 167:1657b442184c 75 template<typename T>
thedo 167:1657b442184c 76 MBED_DEPRECATED_SINCE("mbed-os-5.1",
thedo 167:1657b442184c 77 "FunctionPointer has been replaced by Callback<void()>")
thedo 167:1657b442184c 78 FunctionPointerArg1(T *object, R (T::*member)())
thedo 167:1657b442184c 79 : Callback<R()>(object, member) {}
thedo 167:1657b442184c 80
thedo 167:1657b442184c 81 R (*get_function())() {
thedo 167:1657b442184c 82 return *reinterpret_cast<R (**)()>(this);
thedo 167:1657b442184c 83 }
thedo 167:1657b442184c 84
thedo 167:1657b442184c 85 R call() const {
thedo 167:1657b442184c 86 if (!Callback<R()>::operator bool()) {
thedo 167:1657b442184c 87 return (R)0;
thedo 167:1657b442184c 88 }
thedo 167:1657b442184c 89
thedo 167:1657b442184c 90 return Callback<R()>::call();
thedo 167:1657b442184c 91 }
thedo 167:1657b442184c 92
thedo 167:1657b442184c 93 R operator()() const {
thedo 167:1657b442184c 94 return Callback<R()>::call();
thedo 167:1657b442184c 95 }
thedo 167:1657b442184c 96 };
thedo 167:1657b442184c 97
thedo 167:1657b442184c 98 typedef FunctionPointerArg1<void, void> FunctionPointer;
thedo 167:1657b442184c 99
thedo 167:1657b442184c 100
thedo 167:1657b442184c 101 } // namespace mbed
thedo 167:1657b442184c 102
thedo 167:1657b442184c 103 #endif
thedo 167:1657b442184c 104