OptimizedFunctions.h
Go to the documentation of this file.
00001 // ****************************************************************************
00002 // This file is part of the Integrating Vision Toolkit (IVT).
00003 //
00004 // The IVT is maintained by the Karlsruhe Institute of Technology (KIT)
00005 // (www.kit.edu) in cooperation with the company Keyetech (www.keyetech.de).
00006 //
00007 // Copyright (C) 2014 Karlsruhe Institute of Technology (KIT).
00008 // All rights reserved.
00009 //
00010 // Redistribution and use in source and binary forms, with or without
00011 // modification, are permitted provided that the following conditions are met:
00012 //
00013 // 1. Redistributions of source code must retain the above copyright
00014 //    notice, this list of conditions and the following disclaimer.
00015 //
00016 // 2. Redistributions in binary form must reproduce the above copyright
00017 //    notice, this list of conditions and the following disclaimer in the
00018 //    documentation and/or other materials provided with the distribution.
00019 //
00020 // 3. Neither the name of the KIT nor the names of its contributors may be
00021 //    used to endorse or promote products derived from this software
00022 //    without specific prior written permission.
00023 //
00024 // THIS SOFTWARE IS PROVIDED BY THE KIT AND CONTRIBUTORS “AS IS” AND ANY
00025 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00026 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00027 // DISCLAIMED. IN NO EVENT SHALL THE KIT OR CONTRIBUTORS BE LIABLE FOR ANY
00028 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00029 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00030 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00031 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00032 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
00033 // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00034 // ****************************************************************************
00035 // ****************************************************************************
00036 // Filename:  OptimizedFunctions.h
00037 // Author:    Florian Hecht
00038 // Date:      2008
00039 // ****************************************************************************
00040 
00041 #ifndef _OPTIMIZED_FUNCTIONS_H_
00042 #define _OPTIMIZED_FUNCTIONS_H_
00043 
00044 
00045 
00046 #ifdef OPT_DEFINE
00047 #define OPTIMIZED_FUNCTION
00048 #define OPTIMIZED_FUNCTION_END = 0
00049 #else
00050 #define OPTIMIZED_FUNCTION extern
00051 #define OPTIMIZED_FUNCTION_END
00052 #endif
00053 
00054 // the header and footer have to be placed in each function that has an optimized version
00055 // different macros for different number of parameters
00056 #define OPTIMIZED_FUNCTION_HEADER_0(name) if (Optimized##name == NULL || Optimized##name() == 0) {
00057 #define OPTIMIZED_FUNCTION_HEADER_1(name, p1) if (Optimized##name == NULL || Optimized##name(p1) == 0) {
00058 #define OPTIMIZED_FUNCTION_HEADER_2(name, p1, p2) if (Optimized##name == NULL || Optimized##name(p1, p2) == 0) {
00059 #define OPTIMIZED_FUNCTION_HEADER_2_ROI(name, p1, p2, p3) if (Optimized##name == NULL || p3 != 0 || Optimized##name(p1, p2) == 0) {
00060 #define OPTIMIZED_FUNCTION_HEADER_3(name, p1, p2, p3) if (Optimized##name == NULL || Optimized##name(p1, p2, p3) == 0) {
00061 #define OPTIMIZED_FUNCTION_HEADER_3_ROI(name, p1, p2, p3, p4) if (Optimized##name == NULL || p4 != 0 || Optimized##name(p1, p2, p3) == 0) {
00062 #define OPTIMIZED_FUNCTION_HEADER_4(name, p1, p2, p3, p4) if (Optimized##name == NULL || Optimized##name(p1, p2, p3, p4) == 0) {
00063 #define OPTIMIZED_FUNCTION_HEADER_5(name, p1, p2, p3, p4, p5) if (Optimized##name == NULL || Optimized##name(p1, p2, p3, p4, p5) == 0) {
00064 #define OPTIMIZED_FUNCTION_HEADER_5_RET(name, p1, p2, p3, p4, p5) int nRet; if (Optimized##name != NULL && Optimized##name(p1, p2, p3, p4, p5, nRet) != 0) return nRet;
00065 #define OPTIMIZED_FUNCTION_HEADER_8(name, p1, p2, p3, p4, p5, p6, p7, p8) if (Optimized##name == NULL || Optimized##name(p1, p2, p3, p4, p5, p6, p7, p8) == 0) {
00066 #define OPTIMIZED_FUNCTION_HEADER_8_ROI(name, p1, p2, p3, p4, p5, p6, p7, p8, p9) if (Optimized##name == NULL || p9 != 0 || Optimized##name(p1, p2, p3, p4, p5, p6, p7, p8) == 0) {
00067 #define OPTIMIZED_FUNCTION_HEADER_9(name, p1, p2, p3, p4, p5, p6, p7, p8, p9) if (Optimized##name == NULL || Optimized##name(p1, p2, p3, p4, p5, p6, p7, p8, p9) == 0) {
00068 
00069 #define OPTIMIZED_FUNCTION_FOOTER }
00070 
00071 // these macros create a type definition of function and declare a function pointer to that function
00072 // different macros for different number of parameters
00073 #define DECLARE_OPTIMIZED_FUNCTION_0(name) typedef int (*DefOptimized##name)(); OPTIMIZED_FUNCTION DefOptimized##name Optimized##name OPTIMIZED_FUNCTION_END;
00074 #define DECLARE_OPTIMIZED_FUNCTION_1(name, p1) typedef int (*DefOptimized##name)(p1); OPTIMIZED_FUNCTION DefOptimized##name Optimized##name OPTIMIZED_FUNCTION_END;
00075 #define DECLARE_OPTIMIZED_FUNCTION_2(name, p1, p2) typedef int (*DefOptimized##name)(p1, p2); OPTIMIZED_FUNCTION DefOptimized##name Optimized##name OPTIMIZED_FUNCTION_END;
00076 #define DECLARE_OPTIMIZED_FUNCTION_3(name, p1, p2, p3) typedef int (*DefOptimized##name)(p1, p2, p3); OPTIMIZED_FUNCTION DefOptimized##name Optimized##name OPTIMIZED_FUNCTION_END;
00077 #define DECLARE_OPTIMIZED_FUNCTION_4(name, p1, p2, p3, p4) typedef int (*DefOptimized##name)(p1, p2, p3, p4); OPTIMIZED_FUNCTION DefOptimized##name Optimized##name OPTIMIZED_FUNCTION_END;
00078 #define DECLARE_OPTIMIZED_FUNCTION_5(name, p1, p2, p3, p4, p5) typedef int (*DefOptimized##name)(p1, p2, p3, p4, p5); OPTIMIZED_FUNCTION DefOptimized##name Optimized##name OPTIMIZED_FUNCTION_END;
00079 #define DECLARE_OPTIMIZED_FUNCTION_5_RET(name, p1, p2, p3, p4, p5) typedef int (*DefOptimized##name)(p1, p2, p3, p4, p5, int &nRet); OPTIMIZED_FUNCTION DefOptimized##name Optimized##name OPTIMIZED_FUNCTION_END;
00080 #define DECLARE_OPTIMIZED_FUNCTION_8(name, p1, p2, p3, p4, p5, p6, p7, p8) typedef int (*DefOptimized##name)(p1, p2, p3, p4, p5, p6, p7, p8); OPTIMIZED_FUNCTION DefOptimized##name Optimized##name OPTIMIZED_FUNCTION_END;
00081 #define DECLARE_OPTIMIZED_FUNCTION_9(name, p1, p2, p3, p4, p5, p6, p7, p8, p9) typedef int (*DefOptimized##name)(p1, p2, p3, p4, p5, p6, p7, p8, p9); OPTIMIZED_FUNCTION DefOptimized##name Optimized##name OPTIMIZED_FUNCTION_END;
00082 
00083 // this include will generate the necessary declaration
00084 // due to the DECLARE_OPTIMIZED_FUNCTION_x macros
00085 #include "OptimizedFunctionsList.h"
00086 
00087 
00088 
00089 #endif /* _OPTIMIZED_FUNCTIONS_H_ */


asr_ivt
Author(s): Allgeyer Tobias, Hutmacher Robin, Kleinert Daniel, Meißner Pascal, Scholz Jonas, Stöckle Patrick
autogenerated on Thu Jun 6 2019 21:46:57