Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
srcnativelibs.Include.Tesseract.tesseract.tesscallback.h Maven / Gradle / Ivy
///////////////////////////////////////////////////////////////////////
// File: tesscallback.h
// Description: classes and functions to replace pointer-to-functions
// Author: Samuel Charron
//
// (C) Copyright 2006, Google Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
///////////////////////////////////////////////////////////////////////
#ifndef _TESS_CALLBACK_SPECIALIZATIONS_H
#define _TESS_CALLBACK_SPECIALIZATIONS_H
#include "host.h" // For NULL.
struct TessCallbackUtils_ {
static void FailIsRepeatable(const char* name);
};
class TessClosure {
public:
virtual ~TessClosure() { }
virtual void Run() = 0;
};
template
class TessResultCallback {
public:
virtual ~TessResultCallback() { }
virtual R Run() = 0;
};
template
class _ConstTessMemberResultCallback_0_0 : public TessResultCallback {
public:
typedef TessResultCallback base;
typedef R (T::*MemberSignature)() const;
private:
const T* object_;
MemberSignature member_;
public:
inline _ConstTessMemberResultCallback_0_0(
const T* object, MemberSignature member)
: object_(object),
member_(member) {
}
virtual R Run() {
if (!del) {
R result = (object_->*member_)();
return result;
} else {
R result = (object_->*member_)();
// zero out the pointer to ensure segfault if used again
member_ = NULL;
delete this;
return result;
}
}
};
template
class _ConstTessMemberResultCallback_0_0
: public TessClosure {
public:
typedef TessClosure base;
typedef void (T::*MemberSignature)() const;
private:
const T* object_;
MemberSignature member_;
public:
inline _ConstTessMemberResultCallback_0_0(
const T* object, MemberSignature member)
: object_(object),
member_(member) {
}
virtual void Run() {
if (!del) {
(object_->*member_)();
} else {
(object_->*member_)();
// zero out the pointer to ensure segfault if used again
member_ = NULL;
delete this;
}
}
};
#ifndef SWIG
template
inline typename _ConstTessMemberResultCallback_0_0::base*
NewTessCallback(
const T1* obj, R (T2::*member)() const) {
return new _ConstTessMemberResultCallback_0_0(
obj, member);
}
#endif
#ifndef SWIG
template
inline typename _ConstTessMemberResultCallback_0_0::base*
NewPermanentTessCallback(
const T1* obj, R (T2::*member)() const) {
return new _ConstTessMemberResultCallback_0_0(
obj, member);
}
#endif
template
class _TessMemberResultCallback_0_0 : public TessResultCallback {
public:
typedef TessResultCallback base;
typedef R (T::*MemberSignature)() ;
private:
T* object_;
MemberSignature member_;
public:
inline _TessMemberResultCallback_0_0(
T* object, MemberSignature member)
: object_(object),
member_(member) {
}
virtual R Run() {
if (!del) {
R result = (object_->*member_)();
return result;
} else {
R result = (object_->*member_)();
// zero out the pointer to ensure segfault if used again
member_ = NULL;
delete this;
return result;
}
}
};
template
class _TessMemberResultCallback_0_0
: public TessClosure {
public:
typedef TessClosure base;
typedef void (T::*MemberSignature)() ;
private:
T* object_;
MemberSignature member_;
public:
inline _TessMemberResultCallback_0_0(
T* object, MemberSignature member)
: object_(object),
member_(member) {
}
virtual void Run() {
if (!del) {
(object_->*member_)();
} else {
(object_->*member_)();
// zero out the pointer to ensure segfault if used again
member_ = NULL;
delete this;
}
}
};
#ifndef SWIG
template
inline typename _TessMemberResultCallback_0_0::base*
NewTessCallback(
T1* obj, R (T2::*member)() ) {
return new _TessMemberResultCallback_0_0(
obj, member);
}
#endif
#ifndef SWIG
template
inline typename _TessMemberResultCallback_0_0::base*
NewPermanentTessCallback(
T1* obj, R (T2::*member)() ) {
return new _TessMemberResultCallback_0_0(
obj, member);
}
#endif
template
class _TessFunctionResultCallback_0_0 : public TessResultCallback {
public:
typedef TessResultCallback base;
typedef R (*FunctionSignature)();
private:
FunctionSignature function_;
public:
inline _TessFunctionResultCallback_0_0(
FunctionSignature function)
: function_(function) {
}
virtual R Run() {
if (!del) {
R result = (*function_)();
return result;
} else {
R result = (*function_)();
// zero out the pointer to ensure segfault if used again
function_ = NULL;
delete this;
return result;
}
}
};
template
class _TessFunctionResultCallback_0_0
: public TessClosure {
public:
typedef TessClosure base;
typedef void (*FunctionSignature)();
private:
FunctionSignature function_;
public:
inline _TessFunctionResultCallback_0_0(
FunctionSignature function)
: function_(function) {
}
virtual void Run() {
if (!del) {
(*function_)();
} else {
(*function_)();
// zero out the pointer to ensure segfault if used again
function_ = NULL;
delete this;
}
}
};
template
inline typename _TessFunctionResultCallback_0_0::base*
NewTessCallback(R (*function)()) {
return new _TessFunctionResultCallback_0_0(function);
}
template
inline typename _TessFunctionResultCallback_0_0::base*
NewPermanentTessCallback(R (*function)()) {
return new _TessFunctionResultCallback_0_0(function);
}
// Specified by TR1 [4.7.2] Reference modifications.
template struct remove_reference;
template struct remove_reference { typedef T type; };
template struct remove_reference { typedef T type; };
// Identity::type is a typedef of T. Useful for preventing the
// compiler from inferring the type of an argument in templates.
template
struct Identity {
typedef T type;
};
template
class _ConstTessMemberResultCallback_1_0 : public TessResultCallback {
public:
typedef TessResultCallback base;
typedef R (T::*MemberSignature)(P1) const;
private:
const T* object_;
MemberSignature member_;
typename remove_reference::type p1_;
public:
inline _ConstTessMemberResultCallback_1_0(const T* object, MemberSignature member, P1 p1)
: object_(object),
member_(member), p1_(p1) { }
virtual R Run() {
if (!del) {
R result = (object_->*member_)(p1_);
return result;
} else {
R result = (object_->*member_)(p1_);
// zero out the pointer to ensure segfault if used again
member_ = NULL;
delete this;
return result;
}
}
};
template
class _ConstTessMemberResultCallback_1_0 : public TessClosure {
public:
typedef TessClosure base;
typedef void (T::*MemberSignature)(P1) const;
private:
const T* object_;
MemberSignature member_;
typename remove_reference::type p1_;
public:
inline _ConstTessMemberResultCallback_1_0(const T* object, MemberSignature member, P1 p1)
: object_(object),
member_(member), p1_(p1) { }
virtual void Run() {
if (!del) {
(object_->*member_)(p1_);
} else {
(object_->*member_)(p1_);
// zero out the pointer to ensure segfault if used again
member_ = NULL;
delete this;
}
}
};
#ifndef SWIG
template
inline typename _ConstTessMemberResultCallback_1_0::base*
NewTessCallback(const T1* obj, R (T2::*member)(P1) const, typename Identity::type p1) {
return new _ConstTessMemberResultCallback_1_0(obj, member, p1);
}
#endif
#ifndef SWIG
template
inline typename _ConstTessMemberResultCallback_1_0::base*
NewPermanentTessCallback(const T1* obj, R (T2::*member)(P1) const, typename Identity::type p1) {
return new _ConstTessMemberResultCallback_1_0(obj, member, p1);
}
#endif
template
class _TessMemberResultCallback_1_0 : public TessResultCallback {
public:
typedef TessResultCallback base;
typedef R (T::*MemberSignature)(P1) ;
private:
T* object_;
MemberSignature member_;
typename remove_reference::type p1_;
public:
inline _TessMemberResultCallback_1_0( T* object, MemberSignature member, P1 p1)
: object_(object),
member_(member), p1_(p1) { }
virtual R Run() {
if (!del) {
R result = (object_->*member_)(p1_);
return result;
} else {
R result = (object_->*member_)(p1_);
// zero out the pointer to ensure segfault if used again
member_ = NULL;
delete this;
return result;
}
}
};
template
class _TessMemberResultCallback_1_0 : public TessClosure {
public:
typedef TessClosure base;
typedef void (T::*MemberSignature)(P1) ;
private:
T* object_;
MemberSignature member_;
typename remove_reference::type p1_;
public:
inline _TessMemberResultCallback_1_0( T* object, MemberSignature member, P1 p1)
: object_(object),
member_(member), p1_(p1) { }
virtual void Run() {
if (!del) {
(object_->*member_)(p1_);
} else {
(object_->*member_)(p1_);
// zero out the pointer to ensure segfault if used again
member_ = NULL;
delete this;
}
}
};
#ifndef SWIG
template
inline typename _TessMemberResultCallback_1_0::base*
NewTessCallback( T1* obj, R (T2::*member)(P1) , typename Identity::type p1) {
return new _TessMemberResultCallback_1_0(obj, member, p1);
}
#endif
#ifndef SWIG
template
inline typename _TessMemberResultCallback_1_0::base*
NewPermanentTessCallback( T1* obj, R (T2::*member)(P1) , typename Identity::type p1) {
return new _TessMemberResultCallback_1_0(obj, member, p1);
}
#endif
template
class _TessFunctionResultCallback_1_0 : public TessResultCallback {
public:
typedef TessResultCallback base;
typedef R (*FunctionSignature)(P1);
private:
FunctionSignature function_;
typename remove_reference::type p1_;
public:
inline _TessFunctionResultCallback_1_0(FunctionSignature function, P1 p1)
: function_(function), p1_(p1) { }
virtual R Run() {
if (!del) {
R result = (*function_)(p1_);
return result;
} else {
R result = (*function_)(p1_);
// zero out the pointer to ensure segfault if used again
function_ = NULL;
delete this;
return result;
}
}
};
template
class _TessFunctionResultCallback_1_0 : public TessClosure {
public:
typedef TessClosure base;
typedef void (*FunctionSignature)(P1);
private:
FunctionSignature function_;
typename remove_reference::type p1_;
public:
inline _TessFunctionResultCallback_1_0(FunctionSignature function, P1 p1)
: function_(function), p1_(p1) { }
virtual void Run() {
if (!del) {
(*function_)(p1_);
} else {
(*function_)(p1_);
// zero out the pointer to ensure segfault if used again
function_ = NULL;
delete this;
}
}
};
template
inline typename _TessFunctionResultCallback_1_0::base*
NewTessCallback(R (*function)(P1), typename Identity::type p1) {
return new _TessFunctionResultCallback_1_0(function, p1);
}
template
inline typename _TessFunctionResultCallback_1_0::base*
NewPermanentTessCallback(R (*function)(P1), typename Identity::type p1) {
return new _TessFunctionResultCallback_1_0(function, p1);
}
template
class _ConstTessMemberResultCallback_2_0 : public TessResultCallback {
public:
typedef TessResultCallback base;
typedef R (T::*MemberSignature)(P1,P2) const;
private:
const T* object_;
MemberSignature member_;
typename remove_reference::type p1_;
typename remove_reference::type p2_;
public:
inline _ConstTessMemberResultCallback_2_0(const T* object, MemberSignature member, P1 p1, P2 p2)
: object_(object),
member_(member), p1_(p1), p2_(p2) { }
virtual R Run() {
if (!del) {
R result = (object_->*member_)(p1_,p2_);
return result;
} else {
R result = (object_->*member_)(p1_,p2_);
// zero out the pointer to ensure segfault if used again
member_ = NULL;
delete this;
return result;
}
}
};
template
class _ConstTessMemberResultCallback_2_0 : public TessClosure {
public:
typedef TessClosure base;
typedef void (T::*MemberSignature)(P1,P2) const;
private:
const T* object_;
MemberSignature member_;
typename remove_reference::type p1_;
typename remove_reference::type p2_;
public:
inline _ConstTessMemberResultCallback_2_0(const T* object, MemberSignature member, P1 p1, P2 p2)
:
object_(object),
member_(member), p1_(p1), p2_(p2) { }
virtual void Run() {
if (!del) {
(object_->*member_)(p1_,p2_);
} else {
(object_->*member_)(p1_,p2_);
// zero out the pointer to ensure segfault if used again
member_ = NULL;
delete this;
}
}
};
#ifndef SWIG
template
inline typename _ConstTessMemberResultCallback_2_0::base*
NewTessCallback(const T1* obj, R (T2::*member)(P1,P2) const, typename Identity::type p1, typename Identity::type p2) {
return new _ConstTessMemberResultCallback_2_0(obj, member, p1, p2);
}
#endif
#ifndef SWIG
template
inline typename _ConstTessMemberResultCallback_2_0::base*
NewPermanentTessCallback(const T1* obj, R (T2::*member)(P1,P2) const, typename Identity::type p1, typename Identity::type p2) {
return new _ConstTessMemberResultCallback_2_0(obj, member, p1, p2);
}
#endif
template
class _TessMemberResultCallback_2_0 : public TessResultCallback {
public:
typedef TessResultCallback base;
typedef R (T::*MemberSignature)(P1,P2) ;
private:
T* object_;
MemberSignature member_;
typename remove_reference::type p1_;
typename remove_reference::type p2_;
public:
inline _TessMemberResultCallback_2_0( T* object, MemberSignature member, P1 p1, P2 p2)
: object_(object),
member_(member), p1_(p1), p2_(p2) { }
virtual R Run() {
if (!del) {
R result = (object_->*member_)(p1_,p2_);
return result;
} else {
R result = (object_->*member_)(p1_,p2_);
// zero out the pointer to ensure segfault if used again
member_ = NULL;
delete this;
return result;
}
}
};
template
class _TessMemberResultCallback_2_0 : public TessClosure {
public:
typedef TessClosure base;
typedef void (T::*MemberSignature)(P1,P2) ;
private:
T* object_;
MemberSignature member_;
typename remove_reference::type p1_;
typename remove_reference::type p2_;
public:
inline _TessMemberResultCallback_2_0( T* object, MemberSignature member, P1 p1, P2 p2)
:
object_(object),
member_(member), p1_(p1), p2_(p2) { }
virtual void Run() {
if (!del) {
(object_->*member_)(p1_,p2_);
} else {
(object_->*member_)(p1_,p2_);
// zero out the pointer to ensure segfault if used again
member_ = NULL;
delete this;
}
}
};
#ifndef SWIG
template
inline typename _TessMemberResultCallback_2_0::base*
NewTessCallback( T1* obj, R (T2::*member)(P1,P2) , typename Identity::type p1, typename Identity::type p2) {
return new _TessMemberResultCallback_2_0(obj, member, p1, p2);
}
#endif
#ifndef SWIG
template
inline typename _TessMemberResultCallback_2_0::base*
NewPermanentTessCallback( T1* obj, R (T2::*member)(P1,P2) , typename Identity::type p1, typename Identity::type p2) {
return new _TessMemberResultCallback_2_0(obj, member, p1, p2);
}
#endif
template
class _TessFunctionResultCallback_2_0 : public TessResultCallback {
public:
typedef TessResultCallback base;
typedef R (*FunctionSignature)(P1,P2);
private:
FunctionSignature function_;
typename remove_reference::type p1_;
typename remove_reference::type p2_;
public:
inline _TessFunctionResultCallback_2_0(FunctionSignature function, P1 p1, P2 p2)
: function_(function), p1_(p1), p2_(p2) { }
virtual R Run() {
if (!del) {
R result = (*function_)(p1_,p2_);
return result;
} else {
R result = (*function_)(p1_,p2_);
// zero out the pointer to ensure segfault if used again
function_ = NULL;
delete this;
return result;
}
}
};
template
class _TessFunctionResultCallback_2_0 : public TessClosure {
public:
typedef TessClosure base;
typedef void (*FunctionSignature)(P1,P2);
private:
FunctionSignature function_;
typename remove_reference::type p1_;
typename remove_reference::type p2_;
public:
inline _TessFunctionResultCallback_2_0(FunctionSignature function, P1 p1, P2 p2)
:
function_(function), p1_(p1), p2_(p2) { }
virtual void Run() {
if (!del) {
(*function_)(p1_,p2_);
} else {
(*function_)(p1_,p2_);
// zero out the pointer to ensure segfault if used again
function_ = NULL;
delete this;
}
}
};
template
inline typename _TessFunctionResultCallback_2_0::base*
NewTessCallback(R (*function)(P1,P2), typename Identity::type p1, typename Identity::type p2) {
return new _TessFunctionResultCallback_2_0(function, p1, p2);
}
template
inline typename _TessFunctionResultCallback_2_0::base*
NewPermanentTessCallback(R (*function)(P1,P2), typename Identity::type p1, typename Identity::type p2) {
return new _TessFunctionResultCallback_2_0(function, p1, p2);
}
template
class _ConstTessMemberResultCallback_3_0 : public TessResultCallback {
public:
typedef TessResultCallback base;
typedef R (T::*MemberSignature)(P1,P2,P3) const;
private:
const T* object_;
MemberSignature member_;
typename remove_reference::type p1_;
typename remove_reference::type p2_;
typename remove_reference::type p3_;
public:
inline _ConstTessMemberResultCallback_3_0(const T* object, MemberSignature member, P1 p1, P2 p2, P3 p3)
:
object_(object),
member_(member), p1_(p1), p2_(p2), p3_(p3) { }
virtual R Run() {
if (!del) {
R result = (object_->*member_)(p1_,p2_,p3_);
return result;
} else {
R result = (object_->*member_)(p1_,p2_,p3_);
// zero out the pointer to ensure segfault if used again
member_ = NULL;
delete this;
return result;
}
}
};
template
class _ConstTessMemberResultCallback_3_0 : public TessClosure {
public:
typedef TessClosure base;
typedef void (T::*MemberSignature)(P1,P2,P3) const;
private:
const T* object_;
MemberSignature member_;
typename remove_reference::type p1_;
typename remove_reference::type p2_;
typename remove_reference::type p3_;
public:
inline _ConstTessMemberResultCallback_3_0(const T* object, MemberSignature member, P1 p1, P2 p2, P3 p3)
: object_(object),
member_(member), p1_(p1), p2_(p2), p3_(p3) { }
virtual void Run() {
if (!del) {
(object_->*member_)(p1_,p2_,p3_);
} else {
(object_->*member_)(p1_,p2_,p3_);
// zero out the pointer to ensure segfault if used again
member_ = NULL;
delete this;
}
}
};
#ifndef SWIG
template
inline typename _ConstTessMemberResultCallback_3_0::base*
NewTessCallback(const T1* obj, R (T2::*member)(P1,P2,P3) const, typename Identity::type p1, typename Identity::type p2, typename Identity::type p3) {
return new _ConstTessMemberResultCallback_3_0(obj, member, p1, p2, p3);
}
#endif
#ifndef SWIG
template
inline typename _ConstTessMemberResultCallback_3_0::base*
NewPermanentTessCallback(const T1* obj, R (T2::*member)(P1,P2,P3) const, typename Identity::type p1, typename Identity::type p2, typename Identity::type p3) {
return new _ConstTessMemberResultCallback_3_0(obj, member, p1, p2, p3);
}
#endif
template
class _TessMemberResultCallback_3_0 : public TessResultCallback {
public:
typedef TessResultCallback base;
typedef R (T::*MemberSignature)(P1,P2,P3) ;
private:
T* object_;
MemberSignature member_;
typename remove_reference::type p1_;
typename remove_reference::type p2_;
typename remove_reference::type p3_;
public:
inline _TessMemberResultCallback_3_0( T* object, MemberSignature member, P1 p1, P2 p2, P3 p3)
: object_(object),
member_(member), p1_(p1), p2_(p2), p3_(p3) { }
virtual R Run() {
if (!del) {
R result = (object_->*member_)(p1_,p2_,p3_);
return result;
} else {
R result = (object_->*member_)(p1_,p2_,p3_);
// zero out the pointer to ensure segfault if used again
member_ = NULL;
delete this;
return result;
}
}
};
template
class _TessMemberResultCallback_3_0 : public TessClosure {
public:
typedef TessClosure base;
typedef void (T::*MemberSignature)(P1,P2,P3) ;
private:
T* object_;
MemberSignature member_;
typename remove_reference::type p1_;
typename remove_reference::type p2_;
typename remove_reference::type p3_;
public:
inline _TessMemberResultCallback_3_0( T* object, MemberSignature member, P1 p1, P2 p2, P3 p3)
: object_(object),
member_(member), p1_(p1), p2_(p2), p3_(p3) { }
virtual void Run() {
if (!del) {
(object_->*member_)(p1_,p2_,p3_);
} else {
(object_->*member_)(p1_,p2_,p3_);
// zero out the pointer to ensure segfault if used again
member_ = NULL;
delete this;
}
}
};
#ifndef SWIG
template
inline typename _TessMemberResultCallback_3_0::base*
NewTessCallback( T1* obj, R (T2::*member)(P1,P2,P3) , typename Identity::type p1, typename Identity::type p2, typename Identity::type p3) {
return new _TessMemberResultCallback_3_0(obj, member, p1, p2, p3);
}
#endif
#ifndef SWIG
template
inline typename _TessMemberResultCallback_3_0::base*
NewPermanentTessCallback( T1* obj, R (T2::*member)(P1,P2,P3) , typename Identity::type p1, typename Identity::type p2, typename Identity::type p3) {
return new _TessMemberResultCallback_3_0(obj, member, p1, p2, p3);
}
#endif
template
class _TessFunctionResultCallback_3_0 : public TessResultCallback {
public:
typedef TessResultCallback base;
typedef R (*FunctionSignature)(P1,P2,P3);
private:
FunctionSignature function_;
typename remove_reference::type p1_;
typename remove_reference::type p2_;
typename remove_reference::type p3_;
public:
inline _TessFunctionResultCallback_3_0(FunctionSignature function, P1 p1, P2 p2, P3 p3)
: function_(function), p1_(p1), p2_(p2), p3_(p3) { }
virtual R Run() {
if (!del) {
R result = (*function_)(p1_,p2_,p3_);
return result;
} else {
R result = (*function_)(p1_,p2_,p3_);
// zero out the pointer to ensure segfault if used again
function_ = NULL;
delete this;
return result;
}
}
};
template
class _TessFunctionResultCallback_3_0 : public TessClosure {
public:
typedef TessClosure base;
typedef void (*FunctionSignature)(P1,P2,P3);
private:
FunctionSignature function_;
typename remove_reference::type p1_;
typename remove_reference::type p2_;
typename remove_reference::type p3_;
public:
inline _TessFunctionResultCallback_3_0(FunctionSignature function, P1 p1, P2 p2, P3 p3)
: function_(function), p1_(p1), p2_(p2), p3_(p3) { }
virtual void Run() {
if (!del) {
(*function_)(p1_,p2_,p3_);
} else {
(*function_)(p1_,p2_,p3_);
// zero out the pointer to ensure segfault if used again
function_ = NULL;
delete this;
}
}
};
template
inline typename _TessFunctionResultCallback_3_0::base*
NewTessCallback(R (*function)(P1,P2,P3), typename Identity::type p1, typename Identity::type p2, typename Identity::type p3) {
return new _TessFunctionResultCallback_3_0(function, p1, p2, p3);
}
template
inline typename _TessFunctionResultCallback_3_0::base*
NewPermanentTessCallback(R (*function)(P1,P2,P3), typename Identity::type p1, typename Identity::type p2, typename Identity::type p3) {
return new _TessFunctionResultCallback_3_0(function, p1, p2, p3);
}
template
class _ConstTessMemberResultCallback_4_0 : public TessResultCallback {
public:
typedef TessResultCallback base;
typedef R (T::*MemberSignature)(P1,P2,P3,P4) const;
private:
const T* object_;
MemberSignature member_;
typename remove_reference::type p1_;
typename remove_reference::type p2_;
typename remove_reference::type p3_;
typename remove_reference::type p4_;
public:
inline _ConstTessMemberResultCallback_4_0(const T* object, MemberSignature member, P1 p1, P2 p2, P3 p3, P4 p4)
: object_(object),
member_(member), p1_(p1), p2_(p2), p3_(p3), p4_(p4) { }
virtual R Run() {
if (!del) {
R result = (object_->*member_)(p1_,p2_,p3_,p4_);
return result;
} else {
R result = (object_->*member_)(p1_,p2_,p3_,p4_);
// zero out the pointer to ensure segfault if used again
member_ = NULL;
delete this;
return result;
}
}
};
template
class _ConstTessMemberResultCallback_4_0 : public TessClosure {
public:
typedef TessClosure base;
typedef void (T::*MemberSignature)(P1,P2,P3,P4) const;
private:
const T* object_;
MemberSignature member_;
typename remove_reference::type p1_;
typename remove_reference::type p2_;
typename remove_reference::type p3_;
typename remove_reference::type p4_;
public:
inline _ConstTessMemberResultCallback_4_0(const T* object, MemberSignature member, P1 p1, P2 p2, P3 p3, P4 p4)
: object_(object),
member_(member), p1_(p1), p2_(p2), p3_(p3), p4_(p4) { }
virtual void Run() {
if (!del) {
(object_->*member_)(p1_,p2_,p3_,p4_);
} else {
(object_->*member_)(p1_,p2_,p3_,p4_);
// zero out the pointer to ensure segfault if used again
member_ = NULL;
delete this;
}
}
};
#ifndef SWIG
template
inline typename _ConstTessMemberResultCallback_4_0::base*
NewTessCallback(const T1* obj, R (T2::*member)(P1,P2,P3,P4) const, typename Identity::type p1, typename Identity::type p2, typename Identity::type p3, typename Identity::type p4) {
return new _ConstTessMemberResultCallback_4_0(obj, member, p1, p2, p3, p4);
}
#endif
#ifndef SWIG
template
inline typename _ConstTessMemberResultCallback_4_0::base*
NewPermanentTessCallback(const T1* obj, R (T2::*member)(P1,P2,P3,P4) const, typename Identity::type p1, typename Identity::type p2, typename Identity::type p3, typename Identity::type p4) {
return new _ConstTessMemberResultCallback_4_0(obj, member, p1, p2, p3, p4);
}
#endif
template
class _TessMemberResultCallback_4_0 : public TessResultCallback {
public:
typedef TessResultCallback base;
typedef R (T::*MemberSignature)(P1,P2,P3,P4) ;
private:
T* object_;
MemberSignature member_;
typename remove_reference::type p1_;
typename remove_reference::type p2_;
typename remove_reference::type p3_;
typename remove_reference::type p4_;
public:
inline _TessMemberResultCallback_4_0( T* object, MemberSignature member, P1 p1, P2 p2, P3 p3, P4 p4)
: object_(object),
member_(member), p1_(p1), p2_(p2), p3_(p3), p4_(p4) { }
virtual R Run() {
if (!del) {
R result = (object_->*member_)(p1_,p2_,p3_,p4_);
return result;
} else {
R result = (object_->*member_)(p1_,p2_,p3_,p4_);
// zero out the pointer to ensure segfault if used again
member_ = NULL;
delete this;
return result;
}
}
};
template
class _TessMemberResultCallback_4_0 : public TessClosure {
public:
typedef TessClosure base;
typedef void (T::*MemberSignature)(P1,P2,P3,P4) ;
private:
T* object_;
MemberSignature member_;
typename remove_reference::type p1_;
typename remove_reference::type p2_;
typename remove_reference::type p3_;
typename remove_reference