2009-07-11 10:50:24 +08:00
|
|
|
///////////////////////////////////////////////////////////////////////
|
2010-11-24 02:34:14 +08:00
|
|
|
// File: tesscallback.h
|
2009-07-11 10:50:24 +08:00
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
///////////////////////////////////////////////////////////////////////
|
|
|
|
|
2016-12-04 21:45:26 +08:00
|
|
|
#ifndef TESS_CALLBACK_SPECIALIZATIONS_H_
|
|
|
|
#define TESS_CALLBACK_SPECIALIZATIONS_H_
|
2009-07-11 10:50:24 +08:00
|
|
|
|
2010-11-24 02:34:14 +08:00
|
|
|
struct TessCallbackUtils_ {
|
2009-07-11 10:50:24 +08:00
|
|
|
static void FailIsRepeatable(const char* name);
|
|
|
|
};
|
|
|
|
|
2010-11-24 02:34:14 +08:00
|
|
|
class TessClosure {
|
2009-07-11 10:50:24 +08:00
|
|
|
public:
|
2018-10-23 22:52:56 +08:00
|
|
|
virtual ~TessClosure();
|
2009-07-11 10:50:24 +08:00
|
|
|
virtual void Run() = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class R>
|
2010-11-24 02:34:14 +08:00
|
|
|
class TessResultCallback {
|
2009-07-11 10:50:24 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual ~TessResultCallback() = default;
|
2009-07-11 10:50:24 +08:00
|
|
|
virtual R Run() = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class R, class T>
|
2010-11-24 02:34:14 +08:00
|
|
|
class _ConstTessMemberResultCallback_0_0 : public TessResultCallback<R> {
|
2009-07-11 10:50:24 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessResultCallback<R>;
|
|
|
|
using MemberSignature = R (T::*)() const;
|
2009-07-11 10:50:24 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_0_0(const T* object,
|
|
|
|
MemberSignature member)
|
|
|
|
: object_(object), member_(member) {}
|
2009-07-11 10:50:24 +08:00
|
|
|
|
|
|
|
virtual R Run() {
|
|
|
|
if (!del) {
|
|
|
|
R result = (object_->*member_)();
|
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)();
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2009-07-11 10:50:24 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _ConstTessMemberResultCallback_0_0<del, void, T> : public TessClosure {
|
2009-07-11 10:50:24 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessClosure;
|
|
|
|
using MemberSignature = void (T::*)() const;
|
2009-07-11 10:50:24 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_0_0(const T* object,
|
|
|
|
MemberSignature member)
|
|
|
|
: object_(object), member_(member) {}
|
2009-07-11 10:50:24 +08:00
|
|
|
|
2019-03-26 14:37:52 +08:00
|
|
|
void Run() override {
|
2009-07-11 10:50:24 +08:00
|
|
|
if (!del) {
|
|
|
|
(object_->*member_)();
|
|
|
|
} else {
|
|
|
|
(object_->*member_)();
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2009-07-11 10:50:24 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _ConstTessMemberResultCallback_0_0<true, R, T1>::base*
|
|
|
|
NewTessCallback(const T1* obj, R (T2::*member)() const) {
|
|
|
|
return new _ConstTessMemberResultCallback_0_0<true, R, T1>(obj, member);
|
2009-07-11 10:50:24 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _ConstTessMemberResultCallback_0_0<false, R, T1>::base*
|
|
|
|
NewPermanentTessCallback(const T1* obj, R (T2::*member)() const) {
|
|
|
|
return new _ConstTessMemberResultCallback_0_0<false, R, T1>(obj, member);
|
2009-07-11 10:50:24 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class T>
|
2010-11-24 02:34:14 +08:00
|
|
|
class _TessMemberResultCallback_0_0 : public TessResultCallback<R> {
|
2009-07-11 10:50:24 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessResultCallback<R>;
|
|
|
|
using MemberSignature = R (T::*)();
|
2009-07-11 10:50:24 +08:00
|
|
|
|
|
|
|
private:
|
2010-11-24 02:34:14 +08:00
|
|
|
T* object_;
|
2009-07-11 10:50:24 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_0_0(T* object, MemberSignature member)
|
|
|
|
: object_(object), member_(member) {}
|
2009-07-11 10:50:24 +08:00
|
|
|
|
2019-03-26 14:37:52 +08:00
|
|
|
R Run() override {
|
2009-07-11 10:50:24 +08:00
|
|
|
if (!del) {
|
|
|
|
R result = (object_->*member_)();
|
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)();
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2009-07-11 10:50:24 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessMemberResultCallback_0_0<del, void, T> : public TessClosure {
|
2009-07-11 10:50:24 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessClosure;
|
|
|
|
using MemberSignature = void (T::*)();
|
2009-07-11 10:50:24 +08:00
|
|
|
|
|
|
|
private:
|
2010-11-24 02:34:14 +08:00
|
|
|
T* object_;
|
2009-07-11 10:50:24 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_0_0(T* object, MemberSignature member)
|
|
|
|
: object_(object), member_(member) {}
|
2009-07-11 10:50:24 +08:00
|
|
|
|
2019-03-26 14:37:52 +08:00
|
|
|
void Run() override {
|
2009-07-11 10:50:24 +08:00
|
|
|
if (!del) {
|
|
|
|
(object_->*member_)();
|
|
|
|
} else {
|
|
|
|
(object_->*member_)();
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2009-07-11 10:50:24 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessMemberResultCallback_0_0<true, R, T1>::base*
|
|
|
|
NewTessCallback(T1* obj, R (T2::*member)()) {
|
|
|
|
return new _TessMemberResultCallback_0_0<true, R, T1>(obj, member);
|
2009-07-11 10:50:24 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessMemberResultCallback_0_0<false, R, T1>::base*
|
|
|
|
NewPermanentTessCallback(T1* obj, R (T2::*member)()) {
|
|
|
|
return new _TessMemberResultCallback_0_0<false, R, T1>(obj, member);
|
2009-07-11 10:50:24 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R>
|
2010-11-24 02:34:14 +08:00
|
|
|
class _TessFunctionResultCallback_0_0 : public TessResultCallback<R> {
|
2009-07-11 10:50:24 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessResultCallback<R>;
|
|
|
|
using FunctionSignature = R (*)();
|
2009-07-11 10:50:24 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline explicit _TessFunctionResultCallback_0_0(FunctionSignature function)
|
|
|
|
: function_(function) {}
|
2009-07-11 10:50:24 +08:00
|
|
|
|
|
|
|
virtual R Run() {
|
|
|
|
if (!del) {
|
|
|
|
R result = (*function_)();
|
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)();
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
function_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2009-07-11 10:50:24 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessFunctionResultCallback_0_0<del, void> : public TessClosure {
|
2009-07-11 10:50:24 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessClosure;
|
|
|
|
using FunctionSignature = void (*)();
|
2009-07-11 10:50:24 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline explicit _TessFunctionResultCallback_0_0(FunctionSignature function)
|
|
|
|
: function_(function) {}
|
2009-07-11 10:50:24 +08:00
|
|
|
|
2019-03-26 14:37:52 +08:00
|
|
|
void Run() override {
|
2009-07-11 10:50:24 +08:00
|
|
|
if (!del) {
|
|
|
|
(*function_)();
|
|
|
|
} else {
|
|
|
|
(*function_)();
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
function_ = nullptr;
|
2009-07-11 10:50:24 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class R>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_0_0<true, R>::base* NewTessCallback(
|
|
|
|
R (*function)()) {
|
|
|
|
return new _TessFunctionResultCallback_0_0<true, R>(function);
|
2009-07-11 10:50:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class R>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_0_0<false, R>::base*
|
2010-11-24 02:34:14 +08:00
|
|
|
NewPermanentTessCallback(R (*function)()) {
|
2019-03-31 16:24:28 +08:00
|
|
|
return new _TessFunctionResultCallback_0_0<false, R>(function);
|
2009-07-11 10:50:24 +08:00
|
|
|
}
|
|
|
|
|
2013-09-23 23:26:50 +08:00
|
|
|
// Specified by TR1 [4.7.2] Reference modifications.
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T>
|
|
|
|
struct remove_reference;
|
|
|
|
template <typename T>
|
|
|
|
struct remove_reference {
|
|
|
|
using type = T;
|
|
|
|
};
|
|
|
|
template <typename T>
|
|
|
|
struct remove_reference<T&> {
|
|
|
|
using type = T;
|
|
|
|
};
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
// Identity<T>::type is a typedef of T. Useful for preventing the
|
|
|
|
// compiler from inferring the type of an argument in templates.
|
|
|
|
template <typename T>
|
|
|
|
struct Identity {
|
2019-03-31 16:24:28 +08:00
|
|
|
using type = T;
|
2013-09-23 23:26:50 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class P1>
|
|
|
|
class _ConstTessMemberResultCallback_1_0 : public TessResultCallback<R> {
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessResultCallback<R>;
|
|
|
|
using MemberSignature = R (T::*)(P1) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_1_0(const T* object,
|
|
|
|
MemberSignature member, P1 p1)
|
|
|
|
: object_(object), member_(member), p1_(p1) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run() {
|
|
|
|
if (!del) {
|
|
|
|
R result = (object_->*member_)(p1_);
|
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class P1>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _ConstTessMemberResultCallback_1_0<del, void, T, P1>
|
|
|
|
: public TessClosure {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessClosure;
|
|
|
|
using MemberSignature = void (T::*)(P1) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_1_0(const T* object,
|
|
|
|
MemberSignature member, P1 p1)
|
|
|
|
: object_(object), member_(member), p1_(p1) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-26 14:37:52 +08:00
|
|
|
void Run() override {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
|
|
|
(object_->*member_)(p1_);
|
|
|
|
} else {
|
|
|
|
(object_->*member_)(p1_);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _ConstTessMemberResultCallback_1_0<true, R, T1, P1>::base*
|
|
|
|
NewTessCallback(const T1* obj, R (T2::*member)(P1) const,
|
|
|
|
typename Identity<P1>::type p1) {
|
|
|
|
return new _ConstTessMemberResultCallback_1_0<true, R, T1, P1>(obj, member,
|
|
|
|
p1);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _ConstTessMemberResultCallback_1_0<false, R, T1, P1>::base*
|
|
|
|
NewPermanentTessCallback(const T1* obj, R (T2::*member)(P1) const,
|
|
|
|
typename Identity<P1>::type p1) {
|
|
|
|
return new _ConstTessMemberResultCallback_1_0<false, R, T1, P1>(obj, member,
|
|
|
|
p1);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class P1>
|
|
|
|
class _TessMemberResultCallback_1_0 : public TessResultCallback<R> {
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessResultCallback<R>;
|
|
|
|
using MemberSignature = R (T::*)(P1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
|
|
|
|
public:
|
2018-09-29 14:12:33 +08:00
|
|
|
inline _TessMemberResultCallback_1_0(T* object, MemberSignature member, P1 p1)
|
2019-03-31 16:24:28 +08:00
|
|
|
: object_(object), member_(member), p1_(p1) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run() {
|
|
|
|
if (!del) {
|
|
|
|
R result = (object_->*member_)(p1_);
|
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class P1>
|
|
|
|
class _TessMemberResultCallback_1_0<del, void, T, P1> : public TessClosure {
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessClosure;
|
|
|
|
using MemberSignature = void (T::*)(P1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
|
|
|
|
public:
|
2018-09-29 14:12:33 +08:00
|
|
|
inline _TessMemberResultCallback_1_0(T* object, MemberSignature member, P1 p1)
|
2019-03-31 16:24:28 +08:00
|
|
|
: object_(object), member_(member), p1_(p1) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-26 14:37:52 +08:00
|
|
|
void Run() override {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
|
|
|
(object_->*member_)(p1_);
|
|
|
|
} else {
|
|
|
|
(object_->*member_)(p1_);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessMemberResultCallback_1_0<true, R, T1, P1>::base*
|
|
|
|
NewTessCallback(T1* obj, R (T2::*member)(P1), typename Identity<P1>::type p1) {
|
|
|
|
return new _TessMemberResultCallback_1_0<true, R, T1, P1>(obj, member, p1);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessMemberResultCallback_1_0<false, R, T1, P1>::base*
|
|
|
|
NewPermanentTessCallback(T1* obj, R (T2::*member)(P1),
|
|
|
|
typename Identity<P1>::type p1) {
|
|
|
|
return new _TessMemberResultCallback_1_0<false, R, T1, P1>(obj, member, p1);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class P1>
|
|
|
|
class _TessFunctionResultCallback_1_0 : public TessResultCallback<R> {
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessResultCallback<R>;
|
|
|
|
using FunctionSignature = R (*)(P1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
|
|
|
|
public:
|
|
|
|
inline _TessFunctionResultCallback_1_0(FunctionSignature function, P1 p1)
|
2019-03-31 16:24:28 +08:00
|
|
|
: function_(function), p1_(p1) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run() {
|
|
|
|
if (!del) {
|
|
|
|
R result = (*function_)(p1_);
|
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
function_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class P1>
|
|
|
|
class _TessFunctionResultCallback_1_0<del, void, P1> : public TessClosure {
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessClosure;
|
|
|
|
using FunctionSignature = void (*)(P1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
|
|
|
|
public:
|
|
|
|
inline _TessFunctionResultCallback_1_0(FunctionSignature function, P1 p1)
|
2019-03-31 16:24:28 +08:00
|
|
|
: function_(function), p1_(p1) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-26 14:37:52 +08:00
|
|
|
void Run() override {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
|
|
|
(*function_)(p1_);
|
|
|
|
} else {
|
|
|
|
(*function_)(p1_);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
function_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class R, class P1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_1_0<true, R, P1>::base*
|
2013-09-23 23:26:50 +08:00
|
|
|
NewTessCallback(R (*function)(P1), typename Identity<P1>::type p1) {
|
2019-03-31 16:24:28 +08:00
|
|
|
return new _TessFunctionResultCallback_1_0<true, R, P1>(function, p1);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class R, class P1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_1_0<false, R, P1>::base*
|
2013-09-23 23:26:50 +08:00
|
|
|
NewPermanentTessCallback(R (*function)(P1), typename Identity<P1>::type p1) {
|
2019-03-31 16:24:28 +08:00
|
|
|
return new _TessFunctionResultCallback_1_0<false, R, P1>(function, p1);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class P1, class P2>
|
|
|
|
class _ConstTessMemberResultCallback_2_0 : public TessResultCallback<R> {
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessResultCallback<R>;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_2_0(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run() {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class P1, class P2>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _ConstTessMemberResultCallback_2_0<del, void, T, P1, P2>
|
|
|
|
: public TessClosure {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessClosure;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_2_0(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-26 14:37:52 +08:00
|
|
|
void Run() override {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class P2>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _ConstTessMemberResultCallback_2_0<true, R, T1, P1, P2>::base*
|
|
|
|
NewTessCallback(const T1* obj, R (T2::*member)(P1, P2) const,
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2) {
|
|
|
|
return new _ConstTessMemberResultCallback_2_0<true, R, T1, P1, P2>(
|
|
|
|
obj, member, p1, p2);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class P2>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _ConstTessMemberResultCallback_2_0<false, R, T1, P1, P2>::base*
|
|
|
|
NewPermanentTessCallback(const T1* obj, R (T2::*member)(P1, P2) const,
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2) {
|
|
|
|
return new _ConstTessMemberResultCallback_2_0<false, R, T1, P1, P2>(
|
|
|
|
obj, member, p1, p2);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class P1, class P2>
|
|
|
|
class _TessMemberResultCallback_2_0 : public TessResultCallback<R> {
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessResultCallback<R>;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_2_0(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run() {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class P1, class P2>
|
|
|
|
class _TessMemberResultCallback_2_0<del, void, T, P1, P2> : public TessClosure {
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessClosure;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_2_0(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-26 14:37:52 +08:00
|
|
|
void Run() override {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class P2>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessMemberResultCallback_2_0<true, R, T1, P1, P2>::base*
|
|
|
|
NewTessCallback(T1* obj, R (T2::*member)(P1, P2),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2) {
|
|
|
|
return new _TessMemberResultCallback_2_0<true, R, T1, P1, P2>(obj, member, p1,
|
|
|
|
p2);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class P2>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessMemberResultCallback_2_0<false, R, T1, P1, P2>::base*
|
|
|
|
NewPermanentTessCallback(T1* obj, R (T2::*member)(P1, P2),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2) {
|
|
|
|
return new _TessMemberResultCallback_2_0<false, R, T1, P1, P2>(obj, member,
|
|
|
|
p1, p2);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class P1, class P2>
|
|
|
|
class _TessFunctionResultCallback_2_0 : public TessResultCallback<R> {
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessResultCallback<R>;
|
|
|
|
using FunctionSignature = R (*)(P1, P2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_2_0(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2)
|
|
|
|
: function_(function), p1_(p1), p2_(p2) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run() {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
function_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class P1, class P2>
|
|
|
|
class _TessFunctionResultCallback_2_0<del, void, P1, P2> : public TessClosure {
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessClosure;
|
|
|
|
using FunctionSignature = void (*)(P1, P2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_2_0(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2)
|
|
|
|
: function_(function), p1_(p1), p2_(p2) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-26 14:37:52 +08:00
|
|
|
void Run() override {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
function_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class R, class P1, class P2>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_2_0<true, R, P1, P2>::base*
|
|
|
|
NewTessCallback(R (*function)(P1, P2), typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2) {
|
|
|
|
return new _TessFunctionResultCallback_2_0<true, R, P1, P2>(function, p1, p2);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class R, class P1, class P2>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_2_0<false, R, P1, P2>::base*
|
|
|
|
NewPermanentTessCallback(R (*function)(P1, P2), typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2) {
|
|
|
|
return new _TessFunctionResultCallback_2_0<false, R, P1, P2>(function, p1,
|
|
|
|
p2);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3>
|
|
|
|
class _ConstTessMemberResultCallback_3_0 : public TessResultCallback<R> {
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessResultCallback<R>;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
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) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run() {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class P1, class P2, class P3>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _ConstTessMemberResultCallback_3_0<del, void, T, P1, P2, P3>
|
|
|
|
: public TessClosure {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessClosure;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
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) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-26 14:37:52 +08:00
|
|
|
void Run() override {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline
|
|
|
|
typename _ConstTessMemberResultCallback_3_0<true, R, T1, P1, P2, P3>::base*
|
|
|
|
NewTessCallback(const T1* obj, R (T2::*member)(P1, P2, P3) const,
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3) {
|
|
|
|
return new _ConstTessMemberResultCallback_3_0<true, R, T1, P1, P2, P3>(
|
|
|
|
obj, member, p1, p2, p3);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline
|
|
|
|
typename _ConstTessMemberResultCallback_3_0<false, R, T1, P1, P2, P3>::base*
|
|
|
|
NewPermanentTessCallback(const T1* obj, R (T2::*member)(P1, P2, P3) const,
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3) {
|
|
|
|
return new _ConstTessMemberResultCallback_3_0<false, R, T1, P1, P2, P3>(
|
|
|
|
obj, member, p1, p2, p3);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3>
|
|
|
|
class _TessMemberResultCallback_3_0 : public TessResultCallback<R> {
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessResultCallback<R>;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_3_0(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2), p3_(p3) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run() {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class P1, class P2, class P3>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessMemberResultCallback_3_0<del, void, T, P1, P2, P3>
|
|
|
|
: public TessClosure {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessClosure;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_3_0(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2), p3_(p3) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-26 14:37:52 +08:00
|
|
|
void Run() override {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessMemberResultCallback_3_0<true, R, T1, P1, P2, P3>::base*
|
|
|
|
NewTessCallback(T1* obj, R (T2::*member)(P1, P2, P3),
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3) {
|
|
|
|
return new _TessMemberResultCallback_3_0<true, R, T1, P1, P2, P3>(obj, member,
|
|
|
|
p1, p2, p3);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessMemberResultCallback_3_0<false, R, T1, P1, P2, P3>::base*
|
|
|
|
NewPermanentTessCallback(T1* obj, R (T2::*member)(P1, P2, P3),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3) {
|
|
|
|
return new _TessMemberResultCallback_3_0<false, R, T1, P1, P2, P3>(
|
|
|
|
obj, member, p1, p2, p3);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class P1, class P2, class P3>
|
|
|
|
class _TessFunctionResultCallback_3_0 : public TessResultCallback<R> {
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessResultCallback<R>;
|
|
|
|
using FunctionSignature = R (*)(P1, P2, P3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_3_0(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3)
|
|
|
|
: function_(function), p1_(p1), p2_(p2), p3_(p3) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run() {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
function_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class P1, class P2, class P3>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessFunctionResultCallback_3_0<del, void, P1, P2, P3>
|
|
|
|
: public TessClosure {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessClosure;
|
|
|
|
using FunctionSignature = void (*)(P1, P2, P3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_3_0(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3)
|
|
|
|
: function_(function), p1_(p1), p2_(p2), p3_(p3) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-26 14:37:52 +08:00
|
|
|
void Run() override {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
function_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class R, class P1, class P2, class P3>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_3_0<true, R, P1, P2, P3>::base*
|
|
|
|
NewTessCallback(R (*function)(P1, P2, P3), typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3) {
|
|
|
|
return new _TessFunctionResultCallback_3_0<true, R, P1, P2, P3>(function, p1,
|
|
|
|
p2, p3);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class R, class P1, class P2, class P3>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_3_0<false, R, P1, P2, P3>::base*
|
|
|
|
NewPermanentTessCallback(R (*function)(P1, P2, P3),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3) {
|
|
|
|
return new _TessFunctionResultCallback_3_0<false, R, P1, P2, P3>(function, p1,
|
|
|
|
p2, p3);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class P4>
|
|
|
|
class _ConstTessMemberResultCallback_4_0 : public TessResultCallback<R> {
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessResultCallback<R>;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, P4) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
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) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run() {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class P1, class P2, class P3, class P4>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _ConstTessMemberResultCallback_4_0<del, void, T, P1, P2, P3, P4>
|
|
|
|
: public TessClosure {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessClosure;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, P4) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
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) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-26 14:37:52 +08:00
|
|
|
void Run() override {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _ConstTessMemberResultCallback_4_0<true, R, T1, P1, P2, P3,
|
|
|
|
P4>::base*
|
|
|
|
NewTessCallback(const T1* obj, R (T2::*member)(P1, P2, P3, P4) const,
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4) {
|
|
|
|
return new _ConstTessMemberResultCallback_4_0<true, R, T1, P1, P2, P3, P4>(
|
|
|
|
obj, member, p1, p2, p3, p4);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _ConstTessMemberResultCallback_4_0<false, R, T1, P1, P2, P3,
|
|
|
|
P4>::base*
|
|
|
|
NewPermanentTessCallback(const T1* obj, R (T2::*member)(P1, P2, P3, P4) const,
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4) {
|
|
|
|
return new _ConstTessMemberResultCallback_4_0<false, R, T1, P1, P2, P3, P4>(
|
|
|
|
obj, member, p1, p2, p3, p4);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class P4>
|
|
|
|
class _TessMemberResultCallback_4_0 : public TessResultCallback<R> {
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessResultCallback<R>;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, P4);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
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) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run() {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class P1, class P2, class P3, class P4>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessMemberResultCallback_4_0<del, void, T, P1, P2, P3, P4>
|
|
|
|
: public TessClosure {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessClosure;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, P4);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
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) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-26 14:37:52 +08:00
|
|
|
void Run() override {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline
|
|
|
|
typename _TessMemberResultCallback_4_0<true, R, T1, P1, P2, P3, P4>::base*
|
|
|
|
NewTessCallback(T1* obj, R (T2::*member)(P1, P2, P3, P4),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4) {
|
|
|
|
return new _TessMemberResultCallback_4_0<true, R, T1, P1, P2, P3, P4>(
|
|
|
|
obj, member, p1, p2, p3, p4);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline
|
|
|
|
typename _TessMemberResultCallback_4_0<false, R, T1, P1, P2, P3, P4>::base*
|
|
|
|
NewPermanentTessCallback(T1* obj, R (T2::*member)(P1, P2, P3, P4),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4) {
|
|
|
|
return new _TessMemberResultCallback_4_0<false, R, T1, P1, P2, P3, P4>(
|
|
|
|
obj, member, p1, p2, p3, p4);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class P1, class P2, class P3, class P4>
|
|
|
|
class _TessFunctionResultCallback_4_0 : public TessResultCallback<R> {
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessResultCallback<R>;
|
|
|
|
using FunctionSignature = R (*)(P1, P2, P3, P4);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_4_0(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4)
|
|
|
|
: function_(function), p1_(p1), p2_(p2), p3_(p3), p4_(p4) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run() {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, p4_);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, p4_);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
function_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class P1, class P2, class P3, class P4>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessFunctionResultCallback_4_0<del, void, P1, P2, P3, P4>
|
|
|
|
: public TessClosure {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessClosure;
|
|
|
|
using FunctionSignature = void (*)(P1, P2, P3, P4);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_4_0(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4)
|
|
|
|
: function_(function), p1_(p1), p2_(p2), p3_(p3), p4_(p4) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-26 14:37:52 +08:00
|
|
|
void Run() override {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, p4_);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, p4_);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
function_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class R, class P1, class P2, class P3, class P4>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_4_0<true, R, P1, P2, P3, P4>::base*
|
|
|
|
NewTessCallback(R (*function)(P1, P2, P3, P4), typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2, typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4) {
|
|
|
|
return new _TessFunctionResultCallback_4_0<true, R, P1, P2, P3, P4>(
|
|
|
|
function, p1, p2, p3, p4);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class R, class P1, class P2, class P3, class P4>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_4_0<false, R, P1, P2, P3, P4>::base*
|
|
|
|
NewPermanentTessCallback(R (*function)(P1, P2, P3, P4),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4) {
|
|
|
|
return new _TessFunctionResultCallback_4_0<false, R, P1, P2, P3, P4>(
|
|
|
|
function, p1, p2, p3, p4);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class P4,
|
|
|
|
class P5>
|
2013-09-23 23:26:50 +08:00
|
|
|
class _ConstTessMemberResultCallback_5_0 : public TessResultCallback<R> {
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessResultCallback<R>;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, P4, P5) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_5_0(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-26 14:37:52 +08:00
|
|
|
R Run() override {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class P1, class P2, class P3, class P4, class P5>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _ConstTessMemberResultCallback_5_0<del, void, T, P1, P2, P3, P4, P5>
|
|
|
|
: public TessClosure {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessClosure;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, P4, P5) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_5_0(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-26 14:37:52 +08:00
|
|
|
void Run() override {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5>
|
|
|
|
inline typename _ConstTessMemberResultCallback_5_0<true, R, T1, P1, P2, P3, P4,
|
|
|
|
P5>::base*
|
|
|
|
NewTessCallback(const T1* obj, R (T2::*member)(P1, P2, P3, P4, P5) const,
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3, typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5) {
|
|
|
|
return new _ConstTessMemberResultCallback_5_0<true, R, T1, P1, P2, P3, P4,
|
|
|
|
P5>(obj, member, p1, p2, p3, p4,
|
|
|
|
p5);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5>
|
|
|
|
inline typename _ConstTessMemberResultCallback_5_0<false, R, T1, P1, P2, P3, P4,
|
|
|
|
P5>::base*
|
|
|
|
NewPermanentTessCallback(const T1* obj,
|
|
|
|
R (T2::*member)(P1, P2, P3, P4, P5) const,
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5) {
|
|
|
|
return new _ConstTessMemberResultCallback_5_0<false, R, T1, P1, P2, P3, P4,
|
|
|
|
P5>(obj, member, p1, p2, p3, p4,
|
|
|
|
p5);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class P4,
|
|
|
|
class P5>
|
2013-09-23 23:26:50 +08:00
|
|
|
class _TessMemberResultCallback_5_0 : public TessResultCallback<R> {
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessResultCallback<R>;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, P4, P5);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_5_0(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run() {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class P1, class P2, class P3, class P4, class P5>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessMemberResultCallback_5_0<del, void, T, P1, P2, P3, P4, P5>
|
|
|
|
: public TessClosure {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessClosure;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, P4, P5);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_5_0(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-26 14:37:52 +08:00
|
|
|
void Run() override {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5>
|
|
|
|
inline typename _TessMemberResultCallback_5_0<true, R, T1, P1, P2, P3, P4,
|
|
|
|
P5>::base*
|
|
|
|
NewTessCallback(T1* obj, R (T2::*member)(P1, P2, P3, P4, P5),
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3, typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5) {
|
|
|
|
return new _TessMemberResultCallback_5_0<true, R, T1, P1, P2, P3, P4, P5>(
|
|
|
|
obj, member, p1, p2, p3, p4, p5);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5>
|
|
|
|
inline typename _TessMemberResultCallback_5_0<false, R, T1, P1, P2, P3, P4,
|
|
|
|
P5>::base*
|
|
|
|
NewPermanentTessCallback(T1* obj, R (T2::*member)(P1, P2, P3, P4, P5),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5) {
|
|
|
|
return new _TessMemberResultCallback_5_0<false, R, T1, P1, P2, P3, P4, P5>(
|
|
|
|
obj, member, p1, p2, p3, p4, p5);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class P1, class P2, class P3, class P4, class P5>
|
|
|
|
class _TessFunctionResultCallback_5_0 : public TessResultCallback<R> {
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessResultCallback<R>;
|
|
|
|
using FunctionSignature = R (*)(P1, P2, P3, P4, P5);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_5_0(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5)
|
|
|
|
: function_(function), p1_(p1), p2_(p2), p3_(p3), p4_(p4), p5_(p5) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run() {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, p4_, p5_);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, p4_, p5_);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
function_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class P1, class P2, class P3, class P4, class P5>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessFunctionResultCallback_5_0<del, void, P1, P2, P3, P4, P5>
|
|
|
|
: public TessClosure {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessClosure;
|
|
|
|
using FunctionSignature = void (*)(P1, P2, P3, P4, P5);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_5_0(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5)
|
|
|
|
: function_(function), p1_(p1), p2_(p2), p3_(p3), p4_(p4), p5_(p5) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-26 14:37:52 +08:00
|
|
|
void Run() override {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, p4_, p5_);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, p4_, p5_);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
function_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class R, class P1, class P2, class P3, class P4, class P5>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline
|
|
|
|
typename _TessFunctionResultCallback_5_0<true, R, P1, P2, P3, P4, P5>::base*
|
|
|
|
NewTessCallback(R (*function)(P1, P2, P3, P4, P5),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5) {
|
|
|
|
return new _TessFunctionResultCallback_5_0<true, R, P1, P2, P3, P4, P5>(
|
|
|
|
function, p1, p2, p3, p4, p5);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class R, class P1, class P2, class P3, class P4, class P5>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_5_0<false, R, P1, P2, P3, P4,
|
|
|
|
P5>::base*
|
|
|
|
NewPermanentTessCallback(R (*function)(P1, P2, P3, P4, P5),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5) {
|
|
|
|
return new _TessFunctionResultCallback_5_0<false, R, P1, P2, P3, P4, P5>(
|
|
|
|
function, p1, p2, p3, p4, p5);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class P6>
|
2013-09-23 23:26:50 +08:00
|
|
|
class _ConstTessMemberResultCallback_6_0 : public TessResultCallback<R> {
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessResultCallback<R>;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, P4, P5, P6) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
typename remove_reference<P6>::type p6_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_6_0(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5),
|
|
|
|
p6_(p6) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-26 14:37:52 +08:00
|
|
|
R Run() override {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class T, class P1, class P2, class P3, class P4, class P5,
|
|
|
|
class P6>
|
|
|
|
class _ConstTessMemberResultCallback_6_0<del, void, T, P1, P2, P3, P4, P5, P6>
|
|
|
|
: public TessClosure {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessClosure;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, P4, P5, P6) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
typename remove_reference<P6>::type p6_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_6_0(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5),
|
|
|
|
p6_(p6) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-26 14:37:52 +08:00
|
|
|
void Run() override {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class P6>
|
|
|
|
inline typename _ConstTessMemberResultCallback_6_0<true, R, T1, P1, P2, P3, P4,
|
|
|
|
P5, P6>::base*
|
|
|
|
NewTessCallback(const T1* obj, R (T2::*member)(P1, P2, P3, P4, P5, P6) const,
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3, typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5,
|
|
|
|
typename Identity<P6>::type p6) {
|
|
|
|
return new _ConstTessMemberResultCallback_6_0<true, R, T1, P1, P2, P3, P4, P5,
|
|
|
|
P6>(obj, member, p1, p2, p3, p4,
|
|
|
|
p5, p6);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class P6>
|
|
|
|
inline typename _ConstTessMemberResultCallback_6_0<false, R, T1, P1, P2, P3, P4,
|
|
|
|
P5, P6>::base*
|
|
|
|
NewPermanentTessCallback(
|
|
|
|
const T1* obj, R (T2::*member)(P1, P2, P3, P4, P5, P6) const,
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3, typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5, typename Identity<P6>::type p6) {
|
|
|
|
return new _ConstTessMemberResultCallback_6_0<false, R, T1, P1, P2, P3, P4,
|
|
|
|
P5, P6>(obj, member, p1, p2, p3,
|
|
|
|
p4, p5, p6);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class P6>
|
2013-09-23 23:26:50 +08:00
|
|
|
class _TessMemberResultCallback_6_0 : public TessResultCallback<R> {
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessResultCallback<R>;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, P4, P5, P6);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
typename remove_reference<P6>::type p6_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_6_0(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5),
|
|
|
|
p6_(p6) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run() {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class T, class P1, class P2, class P3, class P4, class P5,
|
|
|
|
class P6>
|
|
|
|
class _TessMemberResultCallback_6_0<del, void, T, P1, P2, P3, P4, P5, P6>
|
|
|
|
: public TessClosure {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessClosure;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, P4, P5, P6);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
typename remove_reference<P6>::type p6_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_6_0(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5),
|
|
|
|
p6_(p6) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-26 14:37:52 +08:00
|
|
|
void Run() override {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class P6>
|
|
|
|
inline typename _TessMemberResultCallback_6_0<true, R, T1, P1, P2, P3, P4, P5,
|
|
|
|
P6>::base*
|
|
|
|
NewTessCallback(T1* obj, R (T2::*member)(P1, P2, P3, P4, P5, P6),
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3, typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5,
|
|
|
|
typename Identity<P6>::type p6) {
|
|
|
|
return new _TessMemberResultCallback_6_0<true, R, T1, P1, P2, P3, P4, P5, P6>(
|
|
|
|
obj, member, p1, p2, p3, p4, p5, p6);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class P6>
|
|
|
|
inline typename _TessMemberResultCallback_6_0<false, R, T1, P1, P2, P3, P4, P5,
|
|
|
|
P6>::base*
|
|
|
|
NewPermanentTessCallback(T1* obj, R (T2::*member)(P1, P2, P3, P4, P5, P6),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5,
|
|
|
|
typename Identity<P6>::type p6) {
|
|
|
|
return new _TessMemberResultCallback_6_0<false, R, T1, P1, P2, P3, P4, P5,
|
|
|
|
P6>(obj, member, p1, p2, p3, p4, p5,
|
|
|
|
p6);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class P1, class P2, class P3, class P4, class P5,
|
|
|
|
class P6>
|
2013-09-23 23:26:50 +08:00
|
|
|
class _TessFunctionResultCallback_6_0 : public TessResultCallback<R> {
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessResultCallback<R>;
|
|
|
|
using FunctionSignature = R (*)(P1, P2, P3, P4, P5, P6);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
typename remove_reference<P6>::type p6_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_6_0(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
|
|
|
|
: function_(function),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5),
|
|
|
|
p6_(p6) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run() {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, p4_, p5_, p6_);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, p4_, p5_, p6_);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
function_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class P1, class P2, class P3, class P4, class P5, class P6>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessFunctionResultCallback_6_0<del, void, P1, P2, P3, P4, P5, P6>
|
|
|
|
: public TessClosure {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessClosure;
|
|
|
|
using FunctionSignature = void (*)(P1, P2, P3, P4, P5, P6);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
typename remove_reference<P6>::type p6_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_6_0(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
|
|
|
|
: function_(function),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5),
|
|
|
|
p6_(p6) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-26 14:37:52 +08:00
|
|
|
void Run() override {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, p4_, p5_, p6_);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, p4_, p5_, p6_);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
function_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class R, class P1, class P2, class P3, class P4, class P5, class P6>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_6_0<true, R, P1, P2, P3, P4, P5,
|
|
|
|
P6>::base*
|
|
|
|
NewTessCallback(R (*function)(P1, P2, P3, P4, P5, P6),
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3, typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5,
|
|
|
|
typename Identity<P6>::type p6) {
|
|
|
|
return new _TessFunctionResultCallback_6_0<true, R, P1, P2, P3, P4, P5, P6>(
|
|
|
|
function, p1, p2, p3, p4, p5, p6);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class R, class P1, class P2, class P3, class P4, class P5, class P6>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_6_0<false, R, P1, P2, P3, P4, P5,
|
|
|
|
P6>::base*
|
|
|
|
NewPermanentTessCallback(R (*function)(P1, P2, P3, P4, P5, P6),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5,
|
|
|
|
typename Identity<P6>::type p6) {
|
|
|
|
return new _TessFunctionResultCallback_6_0<false, R, P1, P2, P3, P4, P5, P6>(
|
|
|
|
function, p1, p2, p3, p4, p5, p6);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
2009-07-11 10:50:24 +08:00
|
|
|
template <class A1>
|
2010-11-24 02:34:14 +08:00
|
|
|
class TessCallback1 {
|
2009-07-11 10:50:24 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual ~TessCallback1() = default;
|
2013-09-23 23:26:50 +08:00
|
|
|
virtual void Run(A1) = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class R, class A1>
|
|
|
|
class TessResultCallback1 {
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual ~TessResultCallback1() = default;
|
2013-09-23 23:26:50 +08:00
|
|
|
virtual R Run(A1) = 0;
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class A1, class A2>
|
2013-09-23 23:26:50 +08:00
|
|
|
class TessCallback2 {
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual ~TessCallback2() = default;
|
|
|
|
virtual void Run(A1, A2) = 0;
|
2013-09-23 23:26:50 +08:00
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class R, class A1, class A2>
|
2013-09-23 23:26:50 +08:00
|
|
|
class TessResultCallback2 {
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual ~TessResultCallback2() = default;
|
|
|
|
virtual R Run(A1, A2) = 0;
|
2013-09-23 23:26:50 +08:00
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class A1, class A2, class A3>
|
2013-09-23 23:26:50 +08:00
|
|
|
class TessCallback3 {
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual ~TessCallback3() = default;
|
|
|
|
virtual void Run(A1, A2, A3) = 0;
|
2013-09-23 23:26:50 +08:00
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class R, class A1, class A2, class A3>
|
2013-09-23 23:26:50 +08:00
|
|
|
class TessResultCallback3 {
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual ~TessResultCallback3() = default;
|
|
|
|
virtual R Run(A1, A2, A3) = 0;
|
2013-09-23 23:26:50 +08:00
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class A1, class A2, class A3, class A4>
|
2013-09-23 23:26:50 +08:00
|
|
|
class TessCallback4 {
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual ~TessCallback4() = default;
|
|
|
|
virtual void Run(A1, A2, A3, A4) = 0;
|
2013-09-23 23:26:50 +08:00
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class R, class A1, class A2, class A3, class A4>
|
2013-09-23 23:26:50 +08:00
|
|
|
class TessResultCallback4 {
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual ~TessResultCallback4() = default;
|
|
|
|
virtual R Run(A1, A2, A3, A4) = 0;
|
2013-09-23 23:26:50 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _ConstTessMemberResultCallback_0_1 : public TessResultCallback1<R, A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback1<R, A1> base;
|
|
|
|
using MemberSignature = R (T::*)(A1) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_0_1(const T* object,
|
|
|
|
MemberSignature member)
|
|
|
|
: object_(object), member_(member) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run(A1 a1) {
|
|
|
|
if (!del) {
|
|
|
|
R result = (object_->*member_)(a1);
|
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(a1);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class A1>
|
|
|
|
class _ConstTessMemberResultCallback_0_1<del, void, T, A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
: public TessCallback1<A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessCallback1<A1>;
|
|
|
|
using MemberSignature = void (T::*)(A1) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_0_1(const T* object,
|
|
|
|
MemberSignature member)
|
|
|
|
: object_(object), member_(member) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual void Run(A1 a1) {
|
|
|
|
if (!del) {
|
|
|
|
(object_->*member_)(a1);
|
|
|
|
} else {
|
|
|
|
(object_->*member_)(a1);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _ConstTessMemberResultCallback_0_1<true, R, T1, A1>::base*
|
|
|
|
NewTessCallback(const T1* obj, R (T2::*member)(A1) const) {
|
|
|
|
return new _ConstTessMemberResultCallback_0_1<true, R, T1, A1>(obj, member);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _ConstTessMemberResultCallback_0_1<false, R, T1, A1>::base*
|
|
|
|
NewPermanentTessCallback(const T1* obj, R (T2::*member)(A1) const) {
|
|
|
|
return new _ConstTessMemberResultCallback_0_1<false, R, T1, A1>(obj, member);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessMemberResultCallback_0_1 : public TessResultCallback1<R, A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback1<R, A1> base;
|
|
|
|
using MemberSignature = R (T::*)(A1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_0_1(T* object, MemberSignature member)
|
|
|
|
: object_(object), member_(member) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-26 14:37:52 +08:00
|
|
|
R Run(A1 a1) override {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
|
|
|
R result = (object_->*member_)(a1);
|
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(a1);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class A1>
|
|
|
|
class _TessMemberResultCallback_0_1<del, void, T, A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
: public TessCallback1<A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessCallback1<A1>;
|
|
|
|
using MemberSignature = void (T::*)(A1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_0_1(T* object, MemberSignature member)
|
|
|
|
: object_(object), member_(member) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-26 14:37:52 +08:00
|
|
|
void Run(A1 a1) override {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
|
|
|
(object_->*member_)(a1);
|
|
|
|
} else {
|
|
|
|
(object_->*member_)(a1);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessMemberResultCallback_0_1<true, R, T1, A1>::base*
|
|
|
|
NewTessCallback(T1* obj, R (T2::*member)(A1)) {
|
|
|
|
return new _TessMemberResultCallback_0_1<true, R, T1, A1>(obj, member);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessMemberResultCallback_0_1<false, R, T1, A1>::base*
|
|
|
|
NewPermanentTessCallback(T1* obj, R (T2::*member)(A1)) {
|
|
|
|
return new _TessMemberResultCallback_0_1<false, R, T1, A1>(obj, member);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessFunctionResultCallback_0_1 : public TessResultCallback1<R, A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback1<R, A1> base;
|
|
|
|
using FunctionSignature = R (*)(A1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline explicit _TessFunctionResultCallback_0_1(FunctionSignature function)
|
|
|
|
: function_(function) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run(A1 a1) {
|
|
|
|
if (!del) {
|
|
|
|
R result = (*function_)(a1);
|
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(a1);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
function_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class A1>
|
|
|
|
class _TessFunctionResultCallback_0_1<del, void, A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
: public TessCallback1<A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessCallback1<A1>;
|
|
|
|
using FunctionSignature = void (*)(A1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline explicit _TessFunctionResultCallback_0_1(FunctionSignature function)
|
|
|
|
: function_(function) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-26 14:37:52 +08:00
|
|
|
void Run(A1 a1) override {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
|
|
|
(*function_)(a1);
|
|
|
|
} else {
|
|
|
|
(*function_)(a1);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
function_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class R, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_0_1<true, R, A1>::base*
|
2013-09-23 23:26:50 +08:00
|
|
|
NewTessCallback(R (*function)(A1)) {
|
2019-03-31 16:24:28 +08:00
|
|
|
return new _TessFunctionResultCallback_0_1<true, R, A1>(function);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class R, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_0_1<false, R, A1>::base*
|
2013-09-23 23:26:50 +08:00
|
|
|
NewPermanentTessCallback(R (*function)(A1)) {
|
2019-03-31 16:24:28 +08:00
|
|
|
return new _TessFunctionResultCallback_0_1<false, R, A1>(function);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class P1, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _ConstTessMemberResultCallback_1_1 : public TessResultCallback1<R, A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback1<R, A1> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, A1) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_1_1(const T* object,
|
|
|
|
MemberSignature member, P1 p1)
|
|
|
|
: object_(object), member_(member), p1_(p1) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, a1);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class P1, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _ConstTessMemberResultCallback_1_1<del, void, T, P1, A1>
|
|
|
|
: public TessCallback1<A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessCallback1<A1>;
|
|
|
|
using MemberSignature = void (T::*)(P1, A1) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_1_1(const T* object,
|
|
|
|
MemberSignature member, P1 p1)
|
|
|
|
: object_(object), member_(member), p1_(p1) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual void Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _ConstTessMemberResultCallback_1_1<true, R, T1, P1, A1>::base*
|
|
|
|
NewTessCallback(const T1* obj, R (T2::*member)(P1, A1) const,
|
|
|
|
typename Identity<P1>::type p1) {
|
|
|
|
return new _ConstTessMemberResultCallback_1_1<true, R, T1, P1, A1>(
|
|
|
|
obj, member, p1);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _ConstTessMemberResultCallback_1_1<false, R, T1, P1, A1>::base*
|
|
|
|
NewPermanentTessCallback(const T1* obj, R (T2::*member)(P1, A1) const,
|
|
|
|
typename Identity<P1>::type p1) {
|
|
|
|
return new _ConstTessMemberResultCallback_1_1<false, R, T1, P1, A1>(
|
|
|
|
obj, member, p1);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class P1, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessMemberResultCallback_1_1 : public TessResultCallback1<R, A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback1<R, A1> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, A1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
|
|
|
|
public:
|
2018-09-29 14:12:33 +08:00
|
|
|
inline _TessMemberResultCallback_1_1(T* object, MemberSignature member, P1 p1)
|
2019-03-31 16:24:28 +08:00
|
|
|
: object_(object), member_(member), p1_(p1) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, a1);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class P1, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessMemberResultCallback_1_1<del, void, T, P1, A1>
|
|
|
|
: public TessCallback1<A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessCallback1<A1>;
|
|
|
|
using MemberSignature = void (T::*)(P1, A1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
|
|
|
|
public:
|
2018-09-29 14:12:33 +08:00
|
|
|
inline _TessMemberResultCallback_1_1(T* object, MemberSignature member, P1 p1)
|
2019-03-31 16:24:28 +08:00
|
|
|
: object_(object), member_(member), p1_(p1) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual void Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessMemberResultCallback_1_1<true, R, T1, P1, A1>::base*
|
|
|
|
NewTessCallback(T1* obj, R (T2::*member)(P1, A1),
|
|
|
|
typename Identity<P1>::type p1) {
|
|
|
|
return new _TessMemberResultCallback_1_1<true, R, T1, P1, A1>(obj, member,
|
|
|
|
p1);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessMemberResultCallback_1_1<false, R, T1, P1, A1>::base*
|
|
|
|
NewPermanentTessCallback(T1* obj, R (T2::*member)(P1, A1),
|
|
|
|
typename Identity<P1>::type p1) {
|
|
|
|
return new _TessMemberResultCallback_1_1<false, R, T1, P1, A1>(obj, member,
|
|
|
|
p1);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class P1, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessFunctionResultCallback_1_1 : public TessResultCallback1<R, A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback1<R, A1> base;
|
|
|
|
using FunctionSignature = R (*)(P1, A1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
|
|
|
|
public:
|
|
|
|
inline _TessFunctionResultCallback_1_1(FunctionSignature function, P1 p1)
|
2019-03-31 16:24:28 +08:00
|
|
|
: function_(function), p1_(p1) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, a1);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
function_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class P1, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessFunctionResultCallback_1_1<del, void, P1, A1>
|
|
|
|
: public TessCallback1<A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessCallback1<A1>;
|
|
|
|
using FunctionSignature = void (*)(P1, A1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
|
|
|
|
public:
|
|
|
|
inline _TessFunctionResultCallback_1_1(FunctionSignature function, P1 p1)
|
2019-03-31 16:24:28 +08:00
|
|
|
: function_(function), p1_(p1) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-26 14:37:52 +08:00
|
|
|
void Run(A1 a1) override {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
function_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class R, class P1, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_1_1<true, R, P1, A1>::base*
|
|
|
|
NewTessCallback(R (*function)(P1, A1), typename Identity<P1>::type p1) {
|
|
|
|
return new _TessFunctionResultCallback_1_1<true, R, P1, A1>(function, p1);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class R, class P1, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_1_1<false, R, P1, A1>::base*
|
|
|
|
NewPermanentTessCallback(R (*function)(P1, A1),
|
|
|
|
typename Identity<P1>::type p1) {
|
|
|
|
return new _TessFunctionResultCallback_1_1<false, R, P1, A1>(function, p1);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class P1, class P2, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _ConstTessMemberResultCallback_2_1 : public TessResultCallback1<R, A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback1<R, A1> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, A1) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_2_1(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, a1);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class P1, class P2, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _ConstTessMemberResultCallback_2_1<del, void, T, P1, P2, A1>
|
|
|
|
: public TessCallback1<A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessCallback1<A1>;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, A1) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_2_1(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual void Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class P2, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline
|
|
|
|
typename _ConstTessMemberResultCallback_2_1<true, R, T1, P1, P2, A1>::base*
|
|
|
|
NewTessCallback(const T1* obj, R (T2::*member)(P1, P2, A1) const,
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2) {
|
|
|
|
return new _ConstTessMemberResultCallback_2_1<true, R, T1, P1, P2, A1>(
|
|
|
|
obj, member, p1, p2);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class P2, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline
|
|
|
|
typename _ConstTessMemberResultCallback_2_1<false, R, T1, P1, P2, A1>::base*
|
|
|
|
NewPermanentTessCallback(const T1* obj, R (T2::*member)(P1, P2, A1) const,
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2) {
|
|
|
|
return new _ConstTessMemberResultCallback_2_1<false, R, T1, P1, P2, A1>(
|
|
|
|
obj, member, p1, p2);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class P1, class P2, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessMemberResultCallback_2_1 : public TessResultCallback1<R, A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback1<R, A1> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, A1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_2_1(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, a1);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class P1, class P2, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessMemberResultCallback_2_1<del, void, T, P1, P2, A1>
|
|
|
|
: public TessCallback1<A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessCallback1<A1>;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, A1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_2_1(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual void Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class P2, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessMemberResultCallback_2_1<true, R, T1, P1, P2, A1>::base*
|
|
|
|
NewTessCallback(T1* obj, R (T2::*member)(P1, P2, A1),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2) {
|
|
|
|
return new _TessMemberResultCallback_2_1<true, R, T1, P1, P2, A1>(obj, member,
|
|
|
|
p1, p2);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class P2, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessMemberResultCallback_2_1<false, R, T1, P1, P2, A1>::base*
|
|
|
|
NewPermanentTessCallback(T1* obj, R (T2::*member)(P1, P2, A1),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2) {
|
|
|
|
return new _TessMemberResultCallback_2_1<false, R, T1, P1, P2, A1>(
|
|
|
|
obj, member, p1, p2);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class P1, class P2, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessFunctionResultCallback_2_1 : public TessResultCallback1<R, A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback1<R, A1> base;
|
|
|
|
using FunctionSignature = R (*)(P1, P2, A1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_2_1(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2)
|
|
|
|
: function_(function), p1_(p1), p2_(p2) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, a1);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
function_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class P1, class P2, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessFunctionResultCallback_2_1<del, void, P1, P2, A1>
|
|
|
|
: public TessCallback1<A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessCallback1<A1>;
|
|
|
|
using FunctionSignature = void (*)(P1, P2, A1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_2_1(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2)
|
|
|
|
: function_(function), p1_(p1), p2_(p2) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual void Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
function_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class R, class P1, class P2, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_2_1<true, R, P1, P2, A1>::base*
|
|
|
|
NewTessCallback(R (*function)(P1, P2, A1), typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2) {
|
|
|
|
return new _TessFunctionResultCallback_2_1<true, R, P1, P2, A1>(function, p1,
|
|
|
|
p2);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class R, class P1, class P2, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_2_1<false, R, P1, P2, A1>::base*
|
|
|
|
NewPermanentTessCallback(R (*function)(P1, P2, A1),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2) {
|
|
|
|
return new _TessFunctionResultCallback_2_1<false, R, P1, P2, A1>(function, p1,
|
|
|
|
p2);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _ConstTessMemberResultCallback_3_1 : public TessResultCallback1<R, A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback1<R, A1> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, A1) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_3_1(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2), p3_(p3) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, a1);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class P1, class P2, class P3, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _ConstTessMemberResultCallback_3_1<del, void, T, P1, P2, P3, A1>
|
|
|
|
: public TessCallback1<A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessCallback1<A1>;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, A1) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_3_1(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2), p3_(p3) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual void Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _ConstTessMemberResultCallback_3_1<true, R, T1, P1, P2, P3,
|
|
|
|
A1>::base*
|
|
|
|
NewTessCallback(const T1* obj, R (T2::*member)(P1, P2, P3, A1) const,
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3) {
|
|
|
|
return new _ConstTessMemberResultCallback_3_1<true, R, T1, P1, P2, P3, A1>(
|
|
|
|
obj, member, p1, p2, p3);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _ConstTessMemberResultCallback_3_1<false, R, T1, P1, P2, P3,
|
|
|
|
A1>::base*
|
|
|
|
NewPermanentTessCallback(const T1* obj, R (T2::*member)(P1, P2, P3, A1) const,
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3) {
|
|
|
|
return new _ConstTessMemberResultCallback_3_1<false, R, T1, P1, P2, P3, A1>(
|
|
|
|
obj, member, p1, p2, p3);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessMemberResultCallback_3_1 : public TessResultCallback1<R, A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback1<R, A1> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, A1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_3_1(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2), p3_(p3) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, a1);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class P1, class P2, class P3, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessMemberResultCallback_3_1<del, void, T, P1, P2, P3, A1>
|
|
|
|
: public TessCallback1<A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessCallback1<A1>;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, A1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_3_1(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2), p3_(p3) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual void Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline
|
|
|
|
typename _TessMemberResultCallback_3_1<true, R, T1, P1, P2, P3, A1>::base*
|
|
|
|
NewTessCallback(T1* obj, R (T2::*member)(P1, P2, P3, A1),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3) {
|
|
|
|
return new _TessMemberResultCallback_3_1<true, R, T1, P1, P2, P3, A1>(
|
|
|
|
obj, member, p1, p2, p3);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline
|
|
|
|
typename _TessMemberResultCallback_3_1<false, R, T1, P1, P2, P3, A1>::base*
|
|
|
|
NewPermanentTessCallback(T1* obj, R (T2::*member)(P1, P2, P3, A1),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3) {
|
|
|
|
return new _TessMemberResultCallback_3_1<false, R, T1, P1, P2, P3, A1>(
|
|
|
|
obj, member, p1, p2, p3);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class P1, class P2, class P3, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessFunctionResultCallback_3_1 : public TessResultCallback1<R, A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback1<R, A1> base;
|
|
|
|
using FunctionSignature = R (*)(P1, P2, P3, A1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_3_1(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3)
|
|
|
|
: function_(function), p1_(p1), p2_(p2), p3_(p3) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, a1);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
function_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class P1, class P2, class P3, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessFunctionResultCallback_3_1<del, void, P1, P2, P3, A1>
|
|
|
|
: public TessCallback1<A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessCallback1<A1>;
|
|
|
|
using FunctionSignature = void (*)(P1, P2, P3, A1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_3_1(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3)
|
|
|
|
: function_(function), p1_(p1), p2_(p2), p3_(p3) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual void Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
function_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class R, class P1, class P2, class P3, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_3_1<true, R, P1, P2, P3, A1>::base*
|
|
|
|
NewTessCallback(R (*function)(P1, P2, P3, A1), typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3) {
|
|
|
|
return new _TessFunctionResultCallback_3_1<true, R, P1, P2, P3, A1>(
|
|
|
|
function, p1, p2, p3);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class R, class P1, class P2, class P3, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_3_1<false, R, P1, P2, P3, A1>::base*
|
|
|
|
NewPermanentTessCallback(R (*function)(P1, P2, P3, A1),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3) {
|
|
|
|
return new _TessFunctionResultCallback_3_1<false, R, P1, P2, P3, A1>(
|
|
|
|
function, p1, p2, p3);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class P4,
|
|
|
|
class A1>
|
|
|
|
class _ConstTessMemberResultCallback_4_1 : public TessResultCallback1<R, A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback1<R, A1> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, P4, A1) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_4_1(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) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, a1);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class P1, class P2, class P3, class P4, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _ConstTessMemberResultCallback_4_1<del, void, T, P1, P2, P3, P4, A1>
|
|
|
|
: public TessCallback1<A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessCallback1<A1>;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, P4, A1) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_4_1(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) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual void Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class A1>
|
|
|
|
inline typename _ConstTessMemberResultCallback_4_1<true, R, T1, P1, P2, P3, P4,
|
|
|
|
A1>::base*
|
|
|
|
NewTessCallback(const T1* obj, R (T2::*member)(P1, P2, P3, P4, A1) const,
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4) {
|
|
|
|
return new _ConstTessMemberResultCallback_4_1<true, R, T1, P1, P2, P3, P4,
|
|
|
|
A1>(obj, member, p1, p2, p3,
|
|
|
|
p4);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class A1>
|
|
|
|
inline typename _ConstTessMemberResultCallback_4_1<false, R, T1, P1, P2, P3, P4,
|
|
|
|
A1>::base*
|
|
|
|
NewPermanentTessCallback(const T1* obj,
|
|
|
|
R (T2::*member)(P1, P2, P3, P4, A1) const,
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4) {
|
|
|
|
return new _ConstTessMemberResultCallback_4_1<false, R, T1, P1, P2, P3, P4,
|
|
|
|
A1>(obj, member, p1, p2, p3,
|
|
|
|
p4);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class P4,
|
|
|
|
class A1>
|
|
|
|
class _TessMemberResultCallback_4_1 : public TessResultCallback1<R, A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback1<R, A1> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, P4, A1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_4_1(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2), p3_(p3), p4_(p4) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, a1);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class P1, class P2, class P3, class P4, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessMemberResultCallback_4_1<del, void, T, P1, P2, P3, P4, A1>
|
|
|
|
: public TessCallback1<A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessCallback1<A1>;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, P4, A1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_4_1(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2), p3_(p3), p4_(p4) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual void Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class A1>
|
|
|
|
inline typename _TessMemberResultCallback_4_1<true, R, T1, P1, P2, P3, P4,
|
|
|
|
A1>::base*
|
|
|
|
NewTessCallback(T1* obj, R (T2::*member)(P1, P2, P3, P4, A1),
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4) {
|
|
|
|
return new _TessMemberResultCallback_4_1<true, R, T1, P1, P2, P3, P4, A1>(
|
|
|
|
obj, member, p1, p2, p3, p4);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class A1>
|
|
|
|
inline typename _TessMemberResultCallback_4_1<false, R, T1, P1, P2, P3, P4,
|
|
|
|
A1>::base*
|
|
|
|
NewPermanentTessCallback(T1* obj, R (T2::*member)(P1, P2, P3, P4, A1),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4) {
|
|
|
|
return new _TessMemberResultCallback_4_1<false, R, T1, P1, P2, P3, P4, A1>(
|
|
|
|
obj, member, p1, p2, p3, p4);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class P1, class P2, class P3, class P4, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessFunctionResultCallback_4_1 : public TessResultCallback1<R, A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback1<R, A1> base;
|
|
|
|
using FunctionSignature = R (*)(P1, P2, P3, P4, A1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_4_1(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4)
|
|
|
|
: function_(function), p1_(p1), p2_(p2), p3_(p3), p4_(p4) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, p4_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, p4_, a1);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
function_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class P1, class P2, class P3, class P4, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessFunctionResultCallback_4_1<del, void, P1, P2, P3, P4, A1>
|
|
|
|
: public TessCallback1<A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessCallback1<A1>;
|
|
|
|
using FunctionSignature = void (*)(P1, P2, P3, P4, A1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_4_1(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4)
|
|
|
|
: function_(function), p1_(p1), p2_(p2), p3_(p3), p4_(p4) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual void Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, p4_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, p4_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
function_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class R, class P1, class P2, class P3, class P4, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline
|
|
|
|
typename _TessFunctionResultCallback_4_1<true, R, P1, P2, P3, P4, A1>::base*
|
|
|
|
NewTessCallback(R (*function)(P1, P2, P3, P4, A1),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4) {
|
|
|
|
return new _TessFunctionResultCallback_4_1<true, R, P1, P2, P3, P4, A1>(
|
|
|
|
function, p1, p2, p3, p4);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class R, class P1, class P2, class P3, class P4, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_4_1<false, R, P1, P2, P3, P4,
|
|
|
|
A1>::base*
|
|
|
|
NewPermanentTessCallback(R (*function)(P1, P2, P3, P4, A1),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4) {
|
|
|
|
return new _TessFunctionResultCallback_4_1<false, R, P1, P2, P3, P4, A1>(
|
|
|
|
function, p1, p2, p3, p4);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class A1>
|
|
|
|
class _ConstTessMemberResultCallback_5_1 : public TessResultCallback1<R, A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback1<R, A1> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, P4, P5, A1) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_5_1(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_, a1);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class T, class P1, class P2, class P3, class P4, class P5,
|
|
|
|
class A1>
|
|
|
|
class _ConstTessMemberResultCallback_5_1<del, void, T, P1, P2, P3, P4, P5, A1>
|
|
|
|
: public TessCallback1<A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessCallback1<A1>;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, P4, P5, A1) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_5_1(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual void Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class A1>
|
|
|
|
inline typename _ConstTessMemberResultCallback_5_1<true, R, T1, P1, P2, P3, P4,
|
|
|
|
P5, A1>::base*
|
|
|
|
NewTessCallback(const T1* obj, R (T2::*member)(P1, P2, P3, P4, P5, A1) const,
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3, typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5) {
|
|
|
|
return new _ConstTessMemberResultCallback_5_1<true, R, T1, P1, P2, P3, P4, P5,
|
|
|
|
A1>(obj, member, p1, p2, p3, p4,
|
|
|
|
p5);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class A1>
|
|
|
|
inline typename _ConstTessMemberResultCallback_5_1<false, R, T1, P1, P2, P3, P4,
|
|
|
|
P5, A1>::base*
|
|
|
|
NewPermanentTessCallback(const T1* obj,
|
|
|
|
R (T2::*member)(P1, P2, P3, P4, P5, A1) const,
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5) {
|
|
|
|
return new _ConstTessMemberResultCallback_5_1<false, R, T1, P1, P2, P3, P4,
|
|
|
|
P5, A1>(obj, member, p1, p2, p3,
|
|
|
|
p4, p5);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class A1>
|
|
|
|
class _TessMemberResultCallback_5_1 : public TessResultCallback1<R, A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback1<R, A1> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, P4, P5, A1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_5_1(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_, a1);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class T, class P1, class P2, class P3, class P4, class P5,
|
|
|
|
class A1>
|
|
|
|
class _TessMemberResultCallback_5_1<del, void, T, P1, P2, P3, P4, P5, A1>
|
|
|
|
: public TessCallback1<A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessCallback1<A1>;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, P4, P5, A1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_5_1(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual void Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class A1>
|
|
|
|
inline typename _TessMemberResultCallback_5_1<true, R, T1, P1, P2, P3, P4, P5,
|
|
|
|
A1>::base*
|
|
|
|
NewTessCallback(T1* obj, R (T2::*member)(P1, P2, P3, P4, P5, A1),
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3, typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5) {
|
|
|
|
return new _TessMemberResultCallback_5_1<true, R, T1, P1, P2, P3, P4, P5, A1>(
|
|
|
|
obj, member, p1, p2, p3, p4, p5);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class A1>
|
|
|
|
inline typename _TessMemberResultCallback_5_1<false, R, T1, P1, P2, P3, P4, P5,
|
|
|
|
A1>::base*
|
|
|
|
NewPermanentTessCallback(T1* obj, R (T2::*member)(P1, P2, P3, P4, P5, A1),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5) {
|
|
|
|
return new _TessMemberResultCallback_5_1<false, R, T1, P1, P2, P3, P4, P5,
|
|
|
|
A1>(obj, member, p1, p2, p3, p4, p5);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class P1, class P2, class P3, class P4, class P5,
|
|
|
|
class A1>
|
|
|
|
class _TessFunctionResultCallback_5_1 : public TessResultCallback1<R, A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback1<R, A1> base;
|
|
|
|
using FunctionSignature = R (*)(P1, P2, P3, P4, P5, A1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_5_1(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5)
|
|
|
|
: function_(function), p1_(p1), p2_(p2), p3_(p3), p4_(p4), p5_(p5) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, p4_, p5_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, p4_, p5_, a1);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
function_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class P1, class P2, class P3, class P4, class P5, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessFunctionResultCallback_5_1<del, void, P1, P2, P3, P4, P5, A1>
|
|
|
|
: public TessCallback1<A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessCallback1<A1>;
|
|
|
|
using FunctionSignature = void (*)(P1, P2, P3, P4, P5, A1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_5_1(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5)
|
|
|
|
: function_(function), p1_(p1), p2_(p2), p3_(p3), p4_(p4), p5_(p5) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual void Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, p4_, p5_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, p4_, p5_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
function_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class R, class P1, class P2, class P3, class P4, class P5, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_5_1<true, R, P1, P2, P3, P4, P5,
|
|
|
|
A1>::base*
|
|
|
|
NewTessCallback(R (*function)(P1, P2, P3, P4, P5, A1),
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3, typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5) {
|
|
|
|
return new _TessFunctionResultCallback_5_1<true, R, P1, P2, P3, P4, P5, A1>(
|
|
|
|
function, p1, p2, p3, p4, p5);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class R, class P1, class P2, class P3, class P4, class P5, class A1>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_5_1<false, R, P1, P2, P3, P4, P5,
|
|
|
|
A1>::base*
|
|
|
|
NewPermanentTessCallback(R (*function)(P1, P2, P3, P4, P5, A1),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5) {
|
|
|
|
return new _TessFunctionResultCallback_5_1<false, R, P1, P2, P3, P4, P5, A1>(
|
|
|
|
function, p1, p2, p3, p4, p5);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class P6, class A1>
|
|
|
|
class _ConstTessMemberResultCallback_6_1 : public TessResultCallback1<R, A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback1<R, A1> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, P4, P5, P6, A1) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
typename remove_reference<P6>::type p6_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_6_1(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5),
|
|
|
|
p6_(p6) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_, a1);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class T, class P1, class P2, class P3, class P4, class P5,
|
|
|
|
class P6, class A1>
|
|
|
|
class _ConstTessMemberResultCallback_6_1<del, void, T, P1, P2, P3, P4, P5, P6,
|
|
|
|
A1> : public TessCallback1<A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessCallback1<A1>;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, P4, P5, P6, A1) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
typename remove_reference<P6>::type p6_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_6_1(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5),
|
|
|
|
p6_(p6) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual void Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class P6, class A1>
|
|
|
|
inline typename _ConstTessMemberResultCallback_6_1<true, R, T1, P1, P2, P3, P4,
|
|
|
|
P5, P6, A1>::base*
|
|
|
|
NewTessCallback(const T1* obj,
|
|
|
|
R (T2::*member)(P1, P2, P3, P4, P5, P6, A1) const,
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3, typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5,
|
|
|
|
typename Identity<P6>::type p6) {
|
|
|
|
return new _ConstTessMemberResultCallback_6_1<true, R, T1, P1, P2, P3, P4, P5,
|
|
|
|
P6, A1>(obj, member, p1, p2, p3,
|
|
|
|
p4, p5, p6);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class P6, class A1>
|
|
|
|
inline typename _ConstTessMemberResultCallback_6_1<false, R, T1, P1, P2, P3, P4,
|
|
|
|
P5, P6, A1>::base*
|
|
|
|
NewPermanentTessCallback(
|
|
|
|
const T1* obj, R (T2::*member)(P1, P2, P3, P4, P5, P6, A1) const,
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3, typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5, typename Identity<P6>::type p6) {
|
|
|
|
return new _ConstTessMemberResultCallback_6_1<false, R, T1, P1, P2, P3, P4,
|
|
|
|
P5, P6, A1>(obj, member, p1, p2,
|
|
|
|
p3, p4, p5, p6);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class P6, class A1>
|
|
|
|
class _TessMemberResultCallback_6_1 : public TessResultCallback1<R, A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback1<R, A1> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, P4, P5, P6, A1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
typename remove_reference<P6>::type p6_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_6_1(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5),
|
|
|
|
p6_(p6) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_, a1);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class T, class P1, class P2, class P3, class P4, class P5,
|
|
|
|
class P6, class A1>
|
|
|
|
class _TessMemberResultCallback_6_1<del, void, T, P1, P2, P3, P4, P5, P6, A1>
|
|
|
|
: public TessCallback1<A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessCallback1<A1>;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, P4, P5, P6, A1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
typename remove_reference<P6>::type p6_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_6_1(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5),
|
|
|
|
p6_(p6) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual void Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class P6, class A1>
|
|
|
|
inline typename _TessMemberResultCallback_6_1<true, R, T1, P1, P2, P3, P4, P5,
|
|
|
|
P6, A1>::base*
|
|
|
|
NewTessCallback(T1* obj, R (T2::*member)(P1, P2, P3, P4, P5, P6, A1),
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3, typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5,
|
|
|
|
typename Identity<P6>::type p6) {
|
|
|
|
return new _TessMemberResultCallback_6_1<true, R, T1, P1, P2, P3, P4, P5, P6,
|
|
|
|
A1>(obj, member, p1, p2, p3, p4, p5,
|
|
|
|
p6);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class P6, class A1>
|
|
|
|
inline typename _TessMemberResultCallback_6_1<false, R, T1, P1, P2, P3, P4, P5,
|
|
|
|
P6, A1>::base*
|
|
|
|
NewPermanentTessCallback(T1* obj, R (T2::*member)(P1, P2, P3, P4, P5, P6, A1),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5,
|
|
|
|
typename Identity<P6>::type p6) {
|
|
|
|
return new _TessMemberResultCallback_6_1<false, R, T1, P1, P2, P3, P4, P5, P6,
|
|
|
|
A1>(obj, member, p1, p2, p3, p4, p5,
|
|
|
|
p6);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class P1, class P2, class P3, class P4, class P5,
|
|
|
|
class P6, class A1>
|
|
|
|
class _TessFunctionResultCallback_6_1 : public TessResultCallback1<R, A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback1<R, A1> base;
|
|
|
|
using FunctionSignature = R (*)(P1, P2, P3, P4, P5, P6, A1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
typename remove_reference<P6>::type p6_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_6_1(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
|
|
|
|
: function_(function),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5),
|
|
|
|
p6_(p6) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, p4_, p5_, p6_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, p4_, p5_, p6_, a1);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
function_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class P1, class P2, class P3, class P4, class P5, class P6,
|
|
|
|
class A1>
|
|
|
|
class _TessFunctionResultCallback_6_1<del, void, P1, P2, P3, P4, P5, P6, A1>
|
|
|
|
: public TessCallback1<A1> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
using base = TessCallback1<A1>;
|
|
|
|
using FunctionSignature = void (*)(P1, P2, P3, P4, P5, P6, A1);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
typename remove_reference<P6>::type p6_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_6_1(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
|
|
|
|
: function_(function),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5),
|
|
|
|
p6_(p6) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual void Run(A1 a1) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, p4_, p5_, p6_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, p4_, p5_, p6_, a1);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
function_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class R, class P1, class P2, class P3, class P4, class P5, class P6,
|
|
|
|
class A1>
|
|
|
|
inline typename _TessFunctionResultCallback_6_1<true, R, P1, P2, P3, P4, P5, P6,
|
|
|
|
A1>::base*
|
|
|
|
NewTessCallback(R (*function)(P1, P2, P3, P4, P5, P6, A1),
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3, typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5,
|
|
|
|
typename Identity<P6>::type p6) {
|
|
|
|
return new _TessFunctionResultCallback_6_1<true, R, P1, P2, P3, P4, P5, P6,
|
|
|
|
A1>(function, p1, p2, p3, p4, p5,
|
|
|
|
p6);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class R, class P1, class P2, class P3, class P4, class P5, class P6,
|
|
|
|
class A1>
|
|
|
|
inline typename _TessFunctionResultCallback_6_1<false, R, P1, P2, P3, P4, P5,
|
|
|
|
P6, A1>::base*
|
|
|
|
NewPermanentTessCallback(R (*function)(P1, P2, P3, P4, P5, P6, A1),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5,
|
|
|
|
typename Identity<P6>::type p6) {
|
|
|
|
return new _TessFunctionResultCallback_6_1<false, R, P1, P2, P3, P4, P5, P6,
|
|
|
|
A1>(function, p1, p2, p3, p4, p5,
|
|
|
|
p6);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _ConstTessMemberResultCallback_0_2
|
|
|
|
: public TessResultCallback2<R, A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback2<R, A1, A2> base;
|
|
|
|
using MemberSignature = R (T::*)(A1, A2) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_0_2(const T* object,
|
|
|
|
MemberSignature member)
|
|
|
|
: object_(object), member_(member) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
R Run(A1 a1, A2 a2) override {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(a1, a2);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class A1, class A2>
|
|
|
|
class _ConstTessMemberResultCallback_0_2<del, void, T, A1, A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
: public TessCallback2<A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback2<A1, A2> base;
|
|
|
|
using MemberSignature = void (T::*)(A1, A2) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_0_2(const T* object,
|
|
|
|
MemberSignature member)
|
|
|
|
: object_(object), member_(member) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _ConstTessMemberResultCallback_0_2<true, R, T1, A1, A2>::base*
|
|
|
|
NewTessCallback(const T1* obj, R (T2::*member)(A1, A2) const) {
|
|
|
|
return new _ConstTessMemberResultCallback_0_2<true, R, T1, A1, A2>(obj,
|
|
|
|
member);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _ConstTessMemberResultCallback_0_2<false, R, T1, A1, A2>::base*
|
|
|
|
NewPermanentTessCallback(const T1* obj, R (T2::*member)(A1, A2) const) {
|
|
|
|
return new _ConstTessMemberResultCallback_0_2<false, R, T1, A1, A2>(obj,
|
|
|
|
member);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessMemberResultCallback_0_2 : public TessResultCallback2<R, A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback2<R, A1, A2> base;
|
|
|
|
using MemberSignature = R (T::*)(A1, A2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_0_2(T* object, MemberSignature member)
|
|
|
|
: object_(object), member_(member) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
R Run(A1 a1, A2 a2) override {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(a1, a2);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class A1, class A2>
|
|
|
|
class _TessMemberResultCallback_0_2<del, void, T, A1, A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
: public TessCallback2<A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback2<A1, A2> base;
|
|
|
|
using MemberSignature = void (T::*)(A1, A2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_0_2(T* object, MemberSignature member)
|
|
|
|
: object_(object), member_(member) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessMemberResultCallback_0_2<true, R, T1, A1, A2>::base*
|
|
|
|
NewTessCallback(T1* obj, R (T2::*member)(A1, A2)) {
|
|
|
|
return new _TessMemberResultCallback_0_2<true, R, T1, A1, A2>(obj, member);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessMemberResultCallback_0_2<false, R, T1, A1, A2>::base*
|
|
|
|
NewPermanentTessCallback(T1* obj, R (T2::*member)(A1, A2)) {
|
|
|
|
return new _TessMemberResultCallback_0_2<false, R, T1, A1, A2>(obj, member);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessFunctionResultCallback_0_2 : public TessResultCallback2<R, A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback2<R, A1, A2> base;
|
|
|
|
using FunctionSignature = R (*)(A1, A2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline explicit _TessFunctionResultCallback_0_2(FunctionSignature function)
|
|
|
|
: function_(function) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
R Run(A1 a1, A2 a2) override {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(a1, a2);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
function_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class A1, class A2>
|
|
|
|
class _TessFunctionResultCallback_0_2<del, void, A1, A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
: public TessCallback2<A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback2<A1, A2> base;
|
|
|
|
using FunctionSignature = void (*)(A1, A2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline explicit _TessFunctionResultCallback_0_2(FunctionSignature function)
|
|
|
|
: function_(function) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
function_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class R, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_0_2<true, R, A1, A2>::base*
|
|
|
|
NewTessCallback(R (*function)(A1, A2)) {
|
|
|
|
return new _TessFunctionResultCallback_0_2<true, R, A1, A2>(function);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class R, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_0_2<false, R, A1, A2>::base*
|
|
|
|
NewPermanentTessCallback(R (*function)(A1, A2)) {
|
|
|
|
return new _TessFunctionResultCallback_0_2<false, R, A1, A2>(function);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class P1, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _ConstTessMemberResultCallback_1_2
|
|
|
|
: public TessResultCallback2<R, A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback2<R, A1, A2> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, A1, A2) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_1_2(const T* object,
|
|
|
|
MemberSignature member, P1 p1)
|
|
|
|
: object_(object), member_(member), p1_(p1) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, a1, a2);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class P1, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _ConstTessMemberResultCallback_1_2<del, void, T, P1, A1, A2>
|
|
|
|
: public TessCallback2<A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback2<A1, A2> base;
|
|
|
|
using MemberSignature = void (T::*)(P1, A1, A2) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_1_2(const T* object,
|
|
|
|
MemberSignature member, P1 p1)
|
|
|
|
: object_(object), member_(member), p1_(p1) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline
|
|
|
|
typename _ConstTessMemberResultCallback_1_2<true, R, T1, P1, A1, A2>::base*
|
|
|
|
NewTessCallback(const T1* obj, R (T2::*member)(P1, A1, A2) const,
|
|
|
|
typename Identity<P1>::type p1) {
|
|
|
|
return new _ConstTessMemberResultCallback_1_2<true, R, T1, P1, A1, A2>(
|
|
|
|
obj, member, p1);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline
|
|
|
|
typename _ConstTessMemberResultCallback_1_2<false, R, T1, P1, A1, A2>::base*
|
|
|
|
NewPermanentTessCallback(const T1* obj, R (T2::*member)(P1, A1, A2) const,
|
|
|
|
typename Identity<P1>::type p1) {
|
|
|
|
return new _ConstTessMemberResultCallback_1_2<false, R, T1, P1, A1, A2>(
|
|
|
|
obj, member, p1);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class P1, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessMemberResultCallback_1_2 : public TessResultCallback2<R, A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback2<R, A1, A2> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, A1, A2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
|
|
|
|
public:
|
2018-09-29 14:12:33 +08:00
|
|
|
inline _TessMemberResultCallback_1_2(T* object, MemberSignature member, P1 p1)
|
2019-03-31 16:24:28 +08:00
|
|
|
: object_(object), member_(member), p1_(p1) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, a1, a2);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class P1, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessMemberResultCallback_1_2<del, void, T, P1, A1, A2>
|
|
|
|
: public TessCallback2<A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback2<A1, A2> base;
|
|
|
|
using MemberSignature = void (T::*)(P1, A1, A2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
|
|
|
|
public:
|
2018-09-29 14:12:33 +08:00
|
|
|
inline _TessMemberResultCallback_1_2(T* object, MemberSignature member, P1 p1)
|
2019-03-31 16:24:28 +08:00
|
|
|
: object_(object), member_(member), p1_(p1) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessMemberResultCallback_1_2<true, R, T1, P1, A1, A2>::base*
|
|
|
|
NewTessCallback(T1* obj, R (T2::*member)(P1, A1, A2),
|
|
|
|
typename Identity<P1>::type p1) {
|
|
|
|
return new _TessMemberResultCallback_1_2<true, R, T1, P1, A1, A2>(obj, member,
|
|
|
|
p1);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessMemberResultCallback_1_2<false, R, T1, P1, A1, A2>::base*
|
|
|
|
NewPermanentTessCallback(T1* obj, R (T2::*member)(P1, A1, A2),
|
|
|
|
typename Identity<P1>::type p1) {
|
|
|
|
return new _TessMemberResultCallback_1_2<false, R, T1, P1, A1, A2>(
|
|
|
|
obj, member, p1);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class P1, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessFunctionResultCallback_1_2 : public TessResultCallback2<R, A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback2<R, A1, A2> base;
|
|
|
|
using FunctionSignature = R (*)(P1, A1, A2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
|
|
|
|
public:
|
|
|
|
inline _TessFunctionResultCallback_1_2(FunctionSignature function, P1 p1)
|
2019-03-31 16:24:28 +08:00
|
|
|
: function_(function), p1_(p1) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, a1, a2);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
function_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class P1, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessFunctionResultCallback_1_2<del, void, P1, A1, A2>
|
|
|
|
: public TessCallback2<A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback2<A1, A2> base;
|
|
|
|
using FunctionSignature = void (*)(P1, A1, A2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
|
|
|
|
public:
|
|
|
|
inline _TessFunctionResultCallback_1_2(FunctionSignature function, P1 p1)
|
2019-03-31 16:24:28 +08:00
|
|
|
: function_(function), p1_(p1) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
function_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class R, class P1, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_1_2<true, R, P1, A1, A2>::base*
|
|
|
|
NewTessCallback(R (*function)(P1, A1, A2), typename Identity<P1>::type p1) {
|
|
|
|
return new _TessFunctionResultCallback_1_2<true, R, P1, A1, A2>(function, p1);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class R, class P1, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_1_2<false, R, P1, A1, A2>::base*
|
|
|
|
NewPermanentTessCallback(R (*function)(P1, A1, A2),
|
|
|
|
typename Identity<P1>::type p1) {
|
|
|
|
return new _TessFunctionResultCallback_1_2<false, R, P1, A1, A2>(function,
|
|
|
|
p1);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class P1, class P2, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _ConstTessMemberResultCallback_2_2
|
|
|
|
: public TessResultCallback2<R, A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback2<R, A1, A2> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, A1, A2) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_2_2(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, a1, a2);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class P1, class P2, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _ConstTessMemberResultCallback_2_2<del, void, T, P1, P2, A1, A2>
|
|
|
|
: public TessCallback2<A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback2<A1, A2> base;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, A1, A2) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_2_2(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class P2, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _ConstTessMemberResultCallback_2_2<true, R, T1, P1, P2, A1,
|
|
|
|
A2>::base*
|
|
|
|
NewTessCallback(const T1* obj, R (T2::*member)(P1, P2, A1, A2) const,
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2) {
|
|
|
|
return new _ConstTessMemberResultCallback_2_2<true, R, T1, P1, P2, A1, A2>(
|
|
|
|
obj, member, p1, p2);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class P2, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _ConstTessMemberResultCallback_2_2<false, R, T1, P1, P2, A1,
|
|
|
|
A2>::base*
|
|
|
|
NewPermanentTessCallback(const T1* obj, R (T2::*member)(P1, P2, A1, A2) const,
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2) {
|
|
|
|
return new _ConstTessMemberResultCallback_2_2<false, R, T1, P1, P2, A1, A2>(
|
|
|
|
obj, member, p1, p2);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class P1, class P2, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessMemberResultCallback_2_2 : public TessResultCallback2<R, A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback2<R, A1, A2> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, A1, A2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_2_2(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
R Run(A1 a1, A2 a2) override {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, a1, a2);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class P1, class P2, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessMemberResultCallback_2_2<del, void, T, P1, P2, A1, A2>
|
|
|
|
: public TessCallback2<A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback2<A1, A2> base;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, A1, A2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_2_2(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class P2, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline
|
|
|
|
typename _TessMemberResultCallback_2_2<true, R, T1, P1, P2, A1, A2>::base*
|
|
|
|
NewTessCallback(T1* obj, R (T2::*member)(P1, P2, A1, A2),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2) {
|
|
|
|
return new _TessMemberResultCallback_2_2<true, R, T1, P1, P2, A1, A2>(
|
|
|
|
obj, member, p1, p2);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class P2, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline
|
|
|
|
typename _TessMemberResultCallback_2_2<false, R, T1, P1, P2, A1, A2>::base*
|
|
|
|
NewPermanentTessCallback(T1* obj, R (T2::*member)(P1, P2, A1, A2),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2) {
|
|
|
|
return new _TessMemberResultCallback_2_2<false, R, T1, P1, P2, A1, A2>(
|
|
|
|
obj, member, p1, p2);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class P1, class P2, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessFunctionResultCallback_2_2 : public TessResultCallback2<R, A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback2<R, A1, A2> base;
|
|
|
|
using FunctionSignature = R (*)(P1, P2, A1, A2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_2_2(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2)
|
|
|
|
: function_(function), p1_(p1), p2_(p2) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, a1, a2);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
function_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class P1, class P2, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessFunctionResultCallback_2_2<del, void, P1, P2, A1, A2>
|
|
|
|
: public TessCallback2<A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback2<A1, A2> base;
|
|
|
|
using FunctionSignature = void (*)(P1, P2, A1, A2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_2_2(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2)
|
|
|
|
: function_(function), p1_(p1), p2_(p2) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
function_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class R, class P1, class P2, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_2_2<true, R, P1, P2, A1, A2>::base*
|
|
|
|
NewTessCallback(R (*function)(P1, P2, A1, A2), typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2) {
|
|
|
|
return new _TessFunctionResultCallback_2_2<true, R, P1, P2, A1, A2>(function,
|
|
|
|
p1, p2);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class R, class P1, class P2, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_2_2<false, R, P1, P2, A1, A2>::base*
|
|
|
|
NewPermanentTessCallback(R (*function)(P1, P2, A1, A2),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2) {
|
|
|
|
return new _TessFunctionResultCallback_2_2<false, R, P1, P2, A1, A2>(function,
|
|
|
|
p1, p2);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class A1,
|
|
|
|
class A2>
|
|
|
|
class _ConstTessMemberResultCallback_3_2
|
|
|
|
: public TessResultCallback2<R, A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback2<R, A1, A2> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, A1, A2) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_3_2(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2), p3_(p3) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, a1, a2);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class P1, class P2, class P3, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _ConstTessMemberResultCallback_3_2<del, void, T, P1, P2, P3, A1, A2>
|
|
|
|
: public TessCallback2<A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback2<A1, A2> base;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, A1, A2) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_3_2(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2), p3_(p3) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class A1,
|
|
|
|
class A2>
|
|
|
|
inline typename _ConstTessMemberResultCallback_3_2<true, R, T1, P1, P2, P3, A1,
|
|
|
|
A2>::base*
|
|
|
|
NewTessCallback(const T1* obj, R (T2::*member)(P1, P2, P3, A1, A2) const,
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3) {
|
|
|
|
return new _ConstTessMemberResultCallback_3_2<true, R, T1, P1, P2, P3, A1,
|
|
|
|
A2>(obj, member, p1, p2, p3);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class A1,
|
|
|
|
class A2>
|
|
|
|
inline typename _ConstTessMemberResultCallback_3_2<false, R, T1, P1, P2, P3, A1,
|
|
|
|
A2>::base*
|
|
|
|
NewPermanentTessCallback(const T1* obj,
|
|
|
|
R (T2::*member)(P1, P2, P3, A1, A2) const,
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3) {
|
|
|
|
return new _ConstTessMemberResultCallback_3_2<false, R, T1, P1, P2, P3, A1,
|
|
|
|
A2>(obj, member, p1, p2, p3);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class A1,
|
|
|
|
class A2>
|
|
|
|
class _TessMemberResultCallback_3_2 : public TessResultCallback2<R, A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback2<R, A1, A2> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, A1, A2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_3_2(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2), p3_(p3) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, a1, a2);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class P1, class P2, class P3, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessMemberResultCallback_3_2<del, void, T, P1, P2, P3, A1, A2>
|
|
|
|
: public TessCallback2<A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback2<A1, A2> base;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, A1, A2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_3_2(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2), p3_(p3) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class A1,
|
|
|
|
class A2>
|
|
|
|
inline typename _TessMemberResultCallback_3_2<true, R, T1, P1, P2, P3, A1,
|
|
|
|
A2>::base*
|
|
|
|
NewTessCallback(T1* obj, R (T2::*member)(P1, P2, P3, A1, A2),
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3) {
|
|
|
|
return new _TessMemberResultCallback_3_2<true, R, T1, P1, P2, P3, A1, A2>(
|
|
|
|
obj, member, p1, p2, p3);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class A1,
|
|
|
|
class A2>
|
|
|
|
inline typename _TessMemberResultCallback_3_2<false, R, T1, P1, P2, P3, A1,
|
|
|
|
A2>::base*
|
|
|
|
NewPermanentTessCallback(T1* obj, R (T2::*member)(P1, P2, P3, A1, A2),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3) {
|
|
|
|
return new _TessMemberResultCallback_3_2<false, R, T1, P1, P2, P3, A1, A2>(
|
|
|
|
obj, member, p1, p2, p3);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class P1, class P2, class P3, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessFunctionResultCallback_3_2 : public TessResultCallback2<R, A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback2<R, A1, A2> base;
|
|
|
|
using FunctionSignature = R (*)(P1, P2, P3, A1, A2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_3_2(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3)
|
|
|
|
: function_(function), p1_(p1), p2_(p2), p3_(p3) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, a1, a2);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
function_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class P1, class P2, class P3, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessFunctionResultCallback_3_2<del, void, P1, P2, P3, A1, A2>
|
|
|
|
: public TessCallback2<A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback2<A1, A2> base;
|
|
|
|
using FunctionSignature = void (*)(P1, P2, P3, A1, A2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_3_2(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3)
|
|
|
|
: function_(function), p1_(p1), p2_(p2), p3_(p3) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
function_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class R, class P1, class P2, class P3, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline
|
|
|
|
typename _TessFunctionResultCallback_3_2<true, R, P1, P2, P3, A1, A2>::base*
|
|
|
|
NewTessCallback(R (*function)(P1, P2, P3, A1, A2),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3) {
|
|
|
|
return new _TessFunctionResultCallback_3_2<true, R, P1, P2, P3, A1, A2>(
|
|
|
|
function, p1, p2, p3);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class R, class P1, class P2, class P3, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_3_2<false, R, P1, P2, P3, A1,
|
|
|
|
A2>::base*
|
|
|
|
NewPermanentTessCallback(R (*function)(P1, P2, P3, A1, A2),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3) {
|
|
|
|
return new _TessFunctionResultCallback_3_2<false, R, P1, P2, P3, A1, A2>(
|
|
|
|
function, p1, p2, p3);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class P4,
|
|
|
|
class A1, class A2>
|
|
|
|
class _ConstTessMemberResultCallback_4_2
|
|
|
|
: public TessResultCallback2<R, A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback2<R, A1, A2> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, P4, A1, A2) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_4_2(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) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, a1, a2);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class T, class P1, class P2, class P3, class P4, class A1,
|
|
|
|
class A2>
|
|
|
|
class _ConstTessMemberResultCallback_4_2<del, void, T, P1, P2, P3, P4, A1, A2>
|
|
|
|
: public TessCallback2<A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback2<A1, A2> base;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, P4, A1, A2) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_4_2(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) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class A1, class A2>
|
|
|
|
inline typename _ConstTessMemberResultCallback_4_2<true, R, T1, P1, P2, P3, P4,
|
|
|
|
A1, A2>::base*
|
|
|
|
NewTessCallback(const T1* obj, R (T2::*member)(P1, P2, P3, P4, A1, A2) const,
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4) {
|
|
|
|
return new _ConstTessMemberResultCallback_4_2<true, R, T1, P1, P2, P3, P4, A1,
|
|
|
|
A2>(obj, member, p1, p2, p3,
|
|
|
|
p4);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class A1, class A2>
|
|
|
|
inline typename _ConstTessMemberResultCallback_4_2<false, R, T1, P1, P2, P3, P4,
|
|
|
|
A1, A2>::base*
|
|
|
|
NewPermanentTessCallback(const T1* obj,
|
|
|
|
R (T2::*member)(P1, P2, P3, P4, A1, A2) const,
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4) {
|
|
|
|
return new _ConstTessMemberResultCallback_4_2<false, R, T1, P1, P2, P3, P4,
|
|
|
|
A1, A2>(obj, member, p1, p2, p3,
|
|
|
|
p4);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class P4,
|
|
|
|
class A1, class A2>
|
|
|
|
class _TessMemberResultCallback_4_2 : public TessResultCallback2<R, A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback2<R, A1, A2> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, P4, A1, A2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_4_2(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2), p3_(p3), p4_(p4) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, a1, a2);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class T, class P1, class P2, class P3, class P4, class A1,
|
|
|
|
class A2>
|
|
|
|
class _TessMemberResultCallback_4_2<del, void, T, P1, P2, P3, P4, A1, A2>
|
|
|
|
: public TessCallback2<A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback2<A1, A2> base;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, P4, A1, A2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_4_2(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2), p3_(p3), p4_(p4) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class A1, class A2>
|
|
|
|
inline typename _TessMemberResultCallback_4_2<true, R, T1, P1, P2, P3, P4, A1,
|
|
|
|
A2>::base*
|
|
|
|
NewTessCallback(T1* obj, R (T2::*member)(P1, P2, P3, P4, A1, A2),
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4) {
|
|
|
|
return new _TessMemberResultCallback_4_2<true, R, T1, P1, P2, P3, P4, A1, A2>(
|
|
|
|
obj, member, p1, p2, p3, p4);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class A1, class A2>
|
|
|
|
inline typename _TessMemberResultCallback_4_2<false, R, T1, P1, P2, P3, P4, A1,
|
|
|
|
A2>::base*
|
|
|
|
NewPermanentTessCallback(T1* obj, R (T2::*member)(P1, P2, P3, P4, A1, A2),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4) {
|
|
|
|
return new _TessMemberResultCallback_4_2<false, R, T1, P1, P2, P3, P4, A1,
|
|
|
|
A2>(obj, member, p1, p2, p3, p4);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class P1, class P2, class P3, class P4, class A1,
|
|
|
|
class A2>
|
|
|
|
class _TessFunctionResultCallback_4_2 : public TessResultCallback2<R, A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback2<R, A1, A2> base;
|
|
|
|
using FunctionSignature = R (*)(P1, P2, P3, P4, A1, A2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_4_2(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4)
|
|
|
|
: function_(function), p1_(p1), p2_(p2), p3_(p3), p4_(p4) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, p4_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, p4_, a1, a2);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
function_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class P1, class P2, class P3, class P4, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessFunctionResultCallback_4_2<del, void, P1, P2, P3, P4, A1, A2>
|
|
|
|
: public TessCallback2<A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback2<A1, A2> base;
|
|
|
|
using FunctionSignature = void (*)(P1, P2, P3, P4, A1, A2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_4_2(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4)
|
|
|
|
: function_(function), p1_(p1), p2_(p2), p3_(p3), p4_(p4) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, p4_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, p4_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
function_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class R, class P1, class P2, class P3, class P4, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_4_2<true, R, P1, P2, P3, P4, A1,
|
|
|
|
A2>::base*
|
|
|
|
NewTessCallback(R (*function)(P1, P2, P3, P4, A1, A2),
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4) {
|
|
|
|
return new _TessFunctionResultCallback_4_2<true, R, P1, P2, P3, P4, A1, A2>(
|
|
|
|
function, p1, p2, p3, p4);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class R, class P1, class P2, class P3, class P4, class A1, class A2>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_4_2<false, R, P1, P2, P3, P4, A1,
|
|
|
|
A2>::base*
|
|
|
|
NewPermanentTessCallback(R (*function)(P1, P2, P3, P4, A1, A2),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4) {
|
|
|
|
return new _TessFunctionResultCallback_4_2<false, R, P1, P2, P3, P4, A1, A2>(
|
|
|
|
function, p1, p2, p3, p4);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class A1, class A2>
|
|
|
|
class _ConstTessMemberResultCallback_5_2
|
|
|
|
: public TessResultCallback2<R, A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback2<R, A1, A2> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, P4, P5, A1, A2) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_5_2(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_, a1, a2);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class T, class P1, class P2, class P3, class P4, class P5,
|
|
|
|
class A1, class A2>
|
|
|
|
class _ConstTessMemberResultCallback_5_2<del, void, T, P1, P2, P3, P4, P5, A1,
|
|
|
|
A2> : public TessCallback2<A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback2<A1, A2> base;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, P4, P5, A1, A2) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_5_2(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class A1, class A2>
|
|
|
|
inline typename _ConstTessMemberResultCallback_5_2<true, R, T1, P1, P2, P3, P4,
|
|
|
|
P5, A1, A2>::base*
|
|
|
|
NewTessCallback(const T1* obj,
|
|
|
|
R (T2::*member)(P1, P2, P3, P4, P5, A1, A2) const,
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3, typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5) {
|
|
|
|
return new _ConstTessMemberResultCallback_5_2<true, R, T1, P1, P2, P3, P4, P5,
|
|
|
|
A1, A2>(obj, member, p1, p2, p3,
|
|
|
|
p4, p5);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class A1, class A2>
|
|
|
|
inline typename _ConstTessMemberResultCallback_5_2<false, R, T1, P1, P2, P3, P4,
|
|
|
|
P5, A1, A2>::base*
|
|
|
|
NewPermanentTessCallback(const T1* obj,
|
|
|
|
R (T2::*member)(P1, P2, P3, P4, P5, A1, A2) const,
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5) {
|
|
|
|
return new _ConstTessMemberResultCallback_5_2<false, R, T1, P1, P2, P3, P4,
|
|
|
|
P5, A1, A2>(obj, member, p1, p2,
|
|
|
|
p3, p4, p5);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class A1, class A2>
|
|
|
|
class _TessMemberResultCallback_5_2 : public TessResultCallback2<R, A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback2<R, A1, A2> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, P4, P5, A1, A2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_5_2(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_, a1, a2);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class T, class P1, class P2, class P3, class P4, class P5,
|
|
|
|
class A1, class A2>
|
|
|
|
class _TessMemberResultCallback_5_2<del, void, T, P1, P2, P3, P4, P5, A1, A2>
|
|
|
|
: public TessCallback2<A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback2<A1, A2> base;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, P4, P5, A1, A2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_5_2(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class A1, class A2>
|
|
|
|
inline typename _TessMemberResultCallback_5_2<true, R, T1, P1, P2, P3, P4, P5,
|
|
|
|
A1, A2>::base*
|
|
|
|
NewTessCallback(T1* obj, R (T2::*member)(P1, P2, P3, P4, P5, A1, A2),
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3, typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5) {
|
|
|
|
return new _TessMemberResultCallback_5_2<true, R, T1, P1, P2, P3, P4, P5, A1,
|
|
|
|
A2>(obj, member, p1, p2, p3, p4, p5);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class A1, class A2>
|
|
|
|
inline typename _TessMemberResultCallback_5_2<false, R, T1, P1, P2, P3, P4, P5,
|
|
|
|
A1, A2>::base*
|
|
|
|
NewPermanentTessCallback(T1* obj, R (T2::*member)(P1, P2, P3, P4, P5, A1, A2),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5) {
|
|
|
|
return new _TessMemberResultCallback_5_2<false, R, T1, P1, P2, P3, P4, P5, A1,
|
|
|
|
A2>(obj, member, p1, p2, p3, p4, p5);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class P1, class P2, class P3, class P4, class P5,
|
|
|
|
class A1, class A2>
|
|
|
|
class _TessFunctionResultCallback_5_2 : public TessResultCallback2<R, A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback2<R, A1, A2> base;
|
|
|
|
using FunctionSignature = R (*)(P1, P2, P3, P4, P5, A1, A2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_5_2(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5)
|
|
|
|
: function_(function), p1_(p1), p2_(p2), p3_(p3), p4_(p4), p5_(p5) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, p4_, p5_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, p4_, p5_, a1, a2);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
function_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class P1, class P2, class P3, class P4, class P5, class A1,
|
|
|
|
class A2>
|
|
|
|
class _TessFunctionResultCallback_5_2<del, void, P1, P2, P3, P4, P5, A1, A2>
|
|
|
|
: public TessCallback2<A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback2<A1, A2> base;
|
|
|
|
using FunctionSignature = void (*)(P1, P2, P3, P4, P5, A1, A2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_5_2(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5)
|
|
|
|
: function_(function), p1_(p1), p2_(p2), p3_(p3), p4_(p4), p5_(p5) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, p4_, p5_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, p4_, p5_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
function_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class R, class P1, class P2, class P3, class P4, class P5, class A1,
|
|
|
|
class A2>
|
|
|
|
inline typename _TessFunctionResultCallback_5_2<true, R, P1, P2, P3, P4, P5, A1,
|
|
|
|
A2>::base*
|
|
|
|
NewTessCallback(R (*function)(P1, P2, P3, P4, P5, A1, A2),
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3, typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5) {
|
|
|
|
return new _TessFunctionResultCallback_5_2<true, R, P1, P2, P3, P4, P5, A1,
|
|
|
|
A2>(function, p1, p2, p3, p4, p5);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class R, class P1, class P2, class P3, class P4, class P5, class A1,
|
|
|
|
class A2>
|
|
|
|
inline typename _TessFunctionResultCallback_5_2<false, R, P1, P2, P3, P4, P5,
|
|
|
|
A1, A2>::base*
|
|
|
|
NewPermanentTessCallback(R (*function)(P1, P2, P3, P4, P5, A1, A2),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5) {
|
|
|
|
return new _TessFunctionResultCallback_5_2<false, R, P1, P2, P3, P4, P5, A1,
|
|
|
|
A2>(function, p1, p2, p3, p4, p5);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class P6, class A1, class A2>
|
|
|
|
class _ConstTessMemberResultCallback_6_2
|
|
|
|
: public TessResultCallback2<R, A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback2<R, A1, A2> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, P4, P5, P6, A1, A2) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
typename remove_reference<P6>::type p6_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_6_2(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5),
|
|
|
|
p6_(p6) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_, a1, a2);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class T, class P1, class P2, class P3, class P4, class P5,
|
|
|
|
class P6, class A1, class A2>
|
|
|
|
class _ConstTessMemberResultCallback_6_2<del, void, T, P1, P2, P3, P4, P5, P6,
|
|
|
|
A1, A2>
|
|
|
|
: public TessCallback2<A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback2<A1, A2> base;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, P4, P5, P6, A1, A2) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
typename remove_reference<P6>::type p6_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_6_2(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5),
|
|
|
|
p6_(p6) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class P6, class A1, class A2>
|
|
|
|
inline typename _ConstTessMemberResultCallback_6_2<true, R, T1, P1, P2, P3, P4,
|
|
|
|
P5, P6, A1, A2>::base*
|
|
|
|
NewTessCallback(const T1* obj,
|
|
|
|
R (T2::*member)(P1, P2, P3, P4, P5, P6, A1, A2) const,
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3, typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5,
|
|
|
|
typename Identity<P6>::type p6) {
|
|
|
|
return new _ConstTessMemberResultCallback_6_2<true, R, T1, P1, P2, P3, P4, P5,
|
|
|
|
P6, A1, A2>(obj, member, p1, p2,
|
|
|
|
p3, p4, p5, p6);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class P6, class A1, class A2>
|
|
|
|
inline typename _ConstTessMemberResultCallback_6_2<false, R, T1, P1, P2, P3, P4,
|
|
|
|
P5, P6, A1, A2>::base*
|
|
|
|
NewPermanentTessCallback(
|
|
|
|
const T1* obj, R (T2::*member)(P1, P2, P3, P4, P5, P6, A1, A2) const,
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3, typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5, typename Identity<P6>::type p6) {
|
|
|
|
return new _ConstTessMemberResultCallback_6_2<false, R, T1, P1, P2, P3, P4,
|
|
|
|
P5, P6, A1, A2>(
|
|
|
|
obj, member, p1, p2, p3, p4, p5, p6);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class P6, class A1, class A2>
|
|
|
|
class _TessMemberResultCallback_6_2 : public TessResultCallback2<R, A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback2<R, A1, A2> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, P4, P5, P6, A1, A2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
typename remove_reference<P6>::type p6_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_6_2(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5),
|
|
|
|
p6_(p6) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_, a1, a2);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class T, class P1, class P2, class P3, class P4, class P5,
|
|
|
|
class P6, class A1, class A2>
|
|
|
|
class _TessMemberResultCallback_6_2<del, void, T, P1, P2, P3, P4, P5, P6, A1,
|
|
|
|
A2> : public TessCallback2<A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback2<A1, A2> base;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, P4, P5, P6, A1, A2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
typename remove_reference<P6>::type p6_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_6_2(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5),
|
|
|
|
p6_(p6) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class P6, class A1, class A2>
|
|
|
|
inline typename _TessMemberResultCallback_6_2<true, R, T1, P1, P2, P3, P4, P5,
|
|
|
|
P6, A1, A2>::base*
|
|
|
|
NewTessCallback(T1* obj, R (T2::*member)(P1, P2, P3, P4, P5, P6, A1, A2),
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3, typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5,
|
|
|
|
typename Identity<P6>::type p6) {
|
|
|
|
return new _TessMemberResultCallback_6_2<true, R, T1, P1, P2, P3, P4, P5, P6,
|
|
|
|
A1, A2>(obj, member, p1, p2, p3, p4,
|
|
|
|
p5, p6);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class P6, class A1, class A2>
|
|
|
|
inline typename _TessMemberResultCallback_6_2<false, R, T1, P1, P2, P3, P4, P5,
|
|
|
|
P6, A1, A2>::base*
|
|
|
|
NewPermanentTessCallback(
|
|
|
|
T1* obj, R (T2::*member)(P1, P2, P3, P4, P5, P6, A1, A2),
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3, typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5, typename Identity<P6>::type p6) {
|
|
|
|
return new _TessMemberResultCallback_6_2<false, R, T1, P1, P2, P3, P4, P5, P6,
|
|
|
|
A1, A2>(obj, member, p1, p2, p3, p4,
|
|
|
|
p5, p6);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class P1, class P2, class P3, class P4, class P5,
|
|
|
|
class P6, class A1, class A2>
|
|
|
|
class _TessFunctionResultCallback_6_2 : public TessResultCallback2<R, A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback2<R, A1, A2> base;
|
|
|
|
using FunctionSignature = R (*)(P1, P2, P3, P4, P5, P6, A1, A2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
typename remove_reference<P6>::type p6_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_6_2(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
|
|
|
|
: function_(function),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5),
|
|
|
|
p6_(p6) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, p4_, p5_, p6_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, p4_, p5_, p6_, a1, a2);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
function_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class P1, class P2, class P3, class P4, class P5, class P6,
|
|
|
|
class A1, class A2>
|
|
|
|
class _TessFunctionResultCallback_6_2<del, void, P1, P2, P3, P4, P5, P6, A1, A2>
|
|
|
|
: public TessCallback2<A1, A2> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback2<A1, A2> base;
|
|
|
|
using FunctionSignature = void (*)(P1, P2, P3, P4, P5, P6, A1, A2);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
typename remove_reference<P6>::type p6_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_6_2(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
|
|
|
|
: function_(function),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5),
|
|
|
|
p6_(p6) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, p4_, p5_, p6_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, p4_, p5_, p6_, a1, a2);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
function_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class R, class P1, class P2, class P3, class P4, class P5, class P6,
|
|
|
|
class A1, class A2>
|
|
|
|
inline typename _TessFunctionResultCallback_6_2<true, R, P1, P2, P3, P4, P5, P6,
|
|
|
|
A1, A2>::base*
|
|
|
|
NewTessCallback(R (*function)(P1, P2, P3, P4, P5, P6, A1, A2),
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3, typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5,
|
|
|
|
typename Identity<P6>::type p6) {
|
|
|
|
return new _TessFunctionResultCallback_6_2<true, R, P1, P2, P3, P4, P5, P6,
|
|
|
|
A1, A2>(function, p1, p2, p3, p4,
|
|
|
|
p5, p6);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class R, class P1, class P2, class P3, class P4, class P5, class P6,
|
|
|
|
class A1, class A2>
|
|
|
|
inline typename _TessFunctionResultCallback_6_2<false, R, P1, P2, P3, P4, P5,
|
|
|
|
P6, A1, A2>::base*
|
|
|
|
NewPermanentTessCallback(R (*function)(P1, P2, P3, P4, P5, P6, A1, A2),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5,
|
|
|
|
typename Identity<P6>::type p6) {
|
|
|
|
return new _TessFunctionResultCallback_6_2<false, R, P1, P2, P3, P4, P5, P6,
|
|
|
|
A1, A2>(function, p1, p2, p3, p4,
|
|
|
|
p5, p6);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class A1, class A2, class A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _ConstTessMemberResultCallback_0_3
|
|
|
|
: public TessResultCallback3<R, A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback3<R, A1, A2, A3> base;
|
|
|
|
using MemberSignature = R (T::*)(A1, A2, A3) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_0_3(const T* object,
|
|
|
|
MemberSignature member)
|
|
|
|
: object_(object), member_(member) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
R Run(A1 a1, A2 a2, A3 a3) override {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(a1, a2, a3);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class A1, class A2, class A3>
|
|
|
|
class _ConstTessMemberResultCallback_0_3<del, void, T, A1, A2, A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
: public TessCallback3<A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback3<A1, A2, A3> base;
|
|
|
|
using MemberSignature = void (T::*)(A1, A2, A3) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_0_3(const T* object,
|
|
|
|
MemberSignature member)
|
|
|
|
: object_(object), member_(member) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class A1, class A2, class A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline
|
|
|
|
typename _ConstTessMemberResultCallback_0_3<true, R, T1, A1, A2, A3>::base*
|
|
|
|
NewTessCallback(const T1* obj, R (T2::*member)(A1, A2, A3) const) {
|
|
|
|
return new _ConstTessMemberResultCallback_0_3<true, R, T1, A1, A2, A3>(
|
2013-09-23 23:26:50 +08:00
|
|
|
obj, member);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class A1, class A2, class A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline
|
|
|
|
typename _ConstTessMemberResultCallback_0_3<false, R, T1, A1, A2, A3>::base*
|
|
|
|
NewPermanentTessCallback(const T1* obj, R (T2::*member)(A1, A2, A3) const) {
|
|
|
|
return new _ConstTessMemberResultCallback_0_3<false, R, T1, A1, A2, A3>(
|
2013-09-23 23:26:50 +08:00
|
|
|
obj, member);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class A1, class A2, class A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessMemberResultCallback_0_3
|
|
|
|
: public TessResultCallback3<R, A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback3<R, A1, A2, A3> base;
|
|
|
|
using MemberSignature = R (T::*)(A1, A2, A3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_0_3(T* object, MemberSignature member)
|
|
|
|
: object_(object), member_(member) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(a1, a2, a3);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class A1, class A2, class A3>
|
|
|
|
class _TessMemberResultCallback_0_3<del, void, T, A1, A2, A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
: public TessCallback3<A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback3<A1, A2, A3> base;
|
|
|
|
using MemberSignature = void (T::*)(A1, A2, A3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_0_3(T* object, MemberSignature member)
|
|
|
|
: object_(object), member_(member) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class A1, class A2, class A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessMemberResultCallback_0_3<true, R, T1, A1, A2, A3>::base*
|
|
|
|
NewTessCallback(T1* obj, R (T2::*member)(A1, A2, A3)) {
|
|
|
|
return new _TessMemberResultCallback_0_3<true, R, T1, A1, A2, A3>(obj,
|
|
|
|
member);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class A1, class A2, class A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessMemberResultCallback_0_3<false, R, T1, A1, A2, A3>::base*
|
|
|
|
NewPermanentTessCallback(T1* obj, R (T2::*member)(A1, A2, A3)) {
|
|
|
|
return new _TessMemberResultCallback_0_3<false, R, T1, A1, A2, A3>(obj,
|
|
|
|
member);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class A1, class A2, class A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessFunctionResultCallback_0_3
|
|
|
|
: public TessResultCallback3<R, A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback3<R, A1, A2, A3> base;
|
|
|
|
using FunctionSignature = R (*)(A1, A2, A3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline explicit _TessFunctionResultCallback_0_3(FunctionSignature function)
|
|
|
|
: function_(function) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(a1, a2, a3);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
function_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class A1, class A2, class A3>
|
|
|
|
class _TessFunctionResultCallback_0_3<del, void, A1, A2, A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
: public TessCallback3<A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback3<A1, A2, A3> base;
|
|
|
|
using FunctionSignature = void (*)(A1, A2, A3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline explicit _TessFunctionResultCallback_0_3(FunctionSignature function)
|
|
|
|
: function_(function) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
function_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class R, class A1, class A2, class A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_0_3<true, R, A1, A2, A3>::base*
|
|
|
|
NewTessCallback(R (*function)(A1, A2, A3)) {
|
|
|
|
return new _TessFunctionResultCallback_0_3<true, R, A1, A2, A3>(function);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class R, class A1, class A2, class A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_0_3<false, R, A1, A2, A3>::base*
|
|
|
|
NewPermanentTessCallback(R (*function)(A1, A2, A3)) {
|
|
|
|
return new _TessFunctionResultCallback_0_3<false, R, A1, A2, A3>(function);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class P1, class A1, class A2, class A3>
|
|
|
|
class _ConstTessMemberResultCallback_1_3
|
2019-03-31 16:24:28 +08:00
|
|
|
: public TessResultCallback3<R, A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback3<R, A1, A2, A3> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, A1, A2, A3) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_1_3(T* object, MemberSignature member,
|
|
|
|
P1 p1)
|
|
|
|
: object_(object), member_(member), p1_(p1) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run(A1 a1, A2 a2, A3 a3) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, a1, a2, a3);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class P1, class A1, class A2, class A3>
|
|
|
|
class _ConstTessMemberResultCallback_1_3<del, void, T, P1, A1, A2, A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
: public TessCallback3<A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback3<A1, A2, A3> base;
|
|
|
|
using MemberSignature = void (T::*)(P1, A1, A2, A3) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_1_3(T* object, MemberSignature member,
|
|
|
|
P1 p1)
|
|
|
|
: object_(object), member_(member), p1_(p1) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual void Run(A1 a1, A2 a2, A3 a3) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class A1, class A2, class A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _ConstTessMemberResultCallback_1_3<true, R, T1, P1, A1, A2,
|
|
|
|
A3>::base*
|
|
|
|
NewTessCallback(T1* obj, R (T2::*member)(P1, A1, A2, A3),
|
|
|
|
typename Identity<P1>::type p1) {
|
|
|
|
return new _ConstTessMemberResultCallback_1_3<true, R, T1, P1, A1, A2, A3>(
|
|
|
|
obj, member, p1);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class A1, class A2, class A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _ConstTessMemberResultCallback_1_3<false, R, T1, P1, A1, A2,
|
|
|
|
A3>::base*
|
|
|
|
NewPermanentTessCallback(T1* obj, R (T2::*member)(P1, A1, A2, A3),
|
|
|
|
typename Identity<P1>::type p1) {
|
|
|
|
return new _ConstTessMemberResultCallback_1_3<false, R, T1, P1, A1, A2, A3>(
|
|
|
|
obj, member, p1);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class P1, class A1, class A2, class A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessMemberResultCallback_1_3
|
|
|
|
: public TessResultCallback3<R, A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback3<R, A1, A2, A3> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, A1, A2, A3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_1_3(T* object, MemberSignature member, P1 p1)
|
|
|
|
: object_(object), member_(member), p1_(p1) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run(A1 a1, A2 a2, A3 a3) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, a1, a2, a3);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class P1, class A1, class A2, class A3>
|
|
|
|
class _TessMemberResultCallback_1_3<del, void, T, P1, A1, A2, A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
: public TessCallback3<A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback3<A1, A2, A3> base;
|
|
|
|
using MemberSignature = void (T::*)(P1, A1, A2, A3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_1_3(T* object, MemberSignature member, P1 p1)
|
|
|
|
: object_(object), member_(member), p1_(p1) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual void Run(A1 a1, A2 a2, A3 a3) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class A1, class A2, class A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline
|
|
|
|
typename _TessMemberResultCallback_1_3<true, R, T1, P1, A1, A2, A3>::base*
|
|
|
|
NewTessCallback(T1* obj, R (T2::*member)(P1, A1, A2, A3),
|
|
|
|
typename Identity<P1>::type p1) {
|
|
|
|
return new _TessMemberResultCallback_1_3<true, R, T1, P1, A1, A2, A3>(
|
|
|
|
obj, member, p1);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class P1, class A1, class A2, class A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline
|
|
|
|
typename _TessMemberResultCallback_1_3<false, R, T1, P1, A1, A2, A3>::base*
|
|
|
|
NewPermanentTessCallback(T1* obj, R (T2::*member)(P1, A1, A2, A3),
|
|
|
|
typename Identity<P1>::type p1) {
|
|
|
|
return new _TessMemberResultCallback_1_3<false, R, T1, P1, A1, A2, A3>(
|
|
|
|
obj, member, p1);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class P1, class A1, class A2, class A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessFunctionResultCallback_1_3 : public TessCallback3<A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback3<A1, A2, A3> base;
|
|
|
|
using FunctionSignature = R (*)(P1, A1, A2, A3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
|
|
|
|
public:
|
|
|
|
inline _TessFunctionResultCallback_1_3(FunctionSignature function, P1 p1)
|
2019-03-31 16:24:28 +08:00
|
|
|
: function_(function), p1_(p1) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual R Run(A1 a1, A2 a2, A3 a3) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, a1, a2, a3);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
function_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class P1, class A1, class A2, class A3>
|
|
|
|
class _TessFunctionResultCallback_1_3<del, void, P1, A1, A2, A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
: public TessCallback3<A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback3<A1, A2, A3> base;
|
|
|
|
using FunctionSignature = void (*)(P1, A1, A2, A3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
|
|
|
|
public:
|
|
|
|
inline _TessFunctionResultCallback_1_3(FunctionSignature function, P1 p1)
|
2019-03-31 16:24:28 +08:00
|
|
|
: function_(function), p1_(p1) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
virtual void Run(A1 a1, A2 a2, A3 a3) {
|
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
function_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class R, class P1, class A1, class A2, class A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_1_3<true, R, P1, A1, A2, A3>::base*
|
|
|
|
NewTessCallback(R (*function)(P1, A1, A2, A3), typename Identity<P1>::type p1) {
|
|
|
|
return new _TessFunctionResultCallback_1_3<true, R, P1, A1, A2, A3>(function,
|
|
|
|
p1);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class R, class P1, class A1, class A2, class A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_1_3<false, R, P1, A1, A2, A3>::base*
|
|
|
|
NewPermanentTessCallback(R (*function)(P1, A1, A2, A3),
|
|
|
|
typename Identity<P1>::type p1) {
|
|
|
|
return new _TessFunctionResultCallback_1_3<false, R, P1, A1, A2, A3>(function,
|
|
|
|
p1);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class T, class P1, class P2, class A1, class A2,
|
|
|
|
class A3>
|
|
|
|
class _ConstTessMemberResultCallback_2_3
|
|
|
|
: public TessResultCallback3<R, A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback3<R, A1, A2, A3> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, A1, A2, A3) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_2_3(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, a1, a2, a3);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class P1, class P2, class A1, class A2, class A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _ConstTessMemberResultCallback_2_3<del, void, T, P1, P2, A1, A2, A3>
|
|
|
|
: public TessCallback3<A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback3<A1, A2, A3> base;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, A1, A2, A3) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_2_3(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class A1, class A2,
|
|
|
|
class A3>
|
|
|
|
inline typename _ConstTessMemberResultCallback_2_3<true, R, T1, P1, P2, A1, A2,
|
|
|
|
A3>::base*
|
|
|
|
NewTessCallback(const T1* obj, R (T2::*member)(P1, P2, A1, A2, A3) const,
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2) {
|
|
|
|
return new _ConstTessMemberResultCallback_2_3<true, R, T1, P1, P2, A1, A2,
|
|
|
|
A3>(obj, member, p1, p2);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class A1, class A2,
|
|
|
|
class A3>
|
|
|
|
inline typename _ConstTessMemberResultCallback_2_3<false, R, T1, P1, P2, A1, A2,
|
|
|
|
A3>::base*
|
|
|
|
NewPermanentTessCallback(const T1* obj,
|
|
|
|
R (T2::*member)(P1, P2, A1, A2, A3) const,
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2) {
|
|
|
|
return new _ConstTessMemberResultCallback_2_3<false, R, T1, P1, P2, A1, A2,
|
|
|
|
A3>(obj, member, p1, p2);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class T, class P1, class P2, class A1, class A2,
|
|
|
|
class A3>
|
|
|
|
class _TessMemberResultCallback_2_3
|
|
|
|
: public TessResultCallback3<R, A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback3<R, A1, A2, A3> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, A1, A2, A3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_2_3(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, a1, a2, a3);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class P1, class P2, class A1, class A2, class A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessMemberResultCallback_2_3<del, void, T, P1, P2, A1, A2, A3>
|
|
|
|
: public TessCallback3<A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback3<A1, A2, A3> base;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, A1, A2, A3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_2_3(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class A1, class A2,
|
|
|
|
class A3>
|
|
|
|
inline typename _TessMemberResultCallback_2_3<true, R, T1, P1, P2, A1, A2,
|
|
|
|
A3>::base*
|
|
|
|
NewTessCallback(T1* obj, R (T2::*member)(P1, P2, A1, A2, A3),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2) {
|
|
|
|
return new _TessMemberResultCallback_2_3<true, R, T1, P1, P2, A1, A2, A3>(
|
|
|
|
obj, member, p1, p2);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class A1, class A2,
|
|
|
|
class A3>
|
|
|
|
inline typename _TessMemberResultCallback_2_3<false, R, T1, P1, P2, A1, A2,
|
|
|
|
A3>::base*
|
|
|
|
NewPermanentTessCallback(T1* obj, R (T2::*member)(P1, P2, A1, A2, A3),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2) {
|
|
|
|
return new _TessMemberResultCallback_2_3<false, R, T1, P1, P2, A1, A2, A3>(
|
|
|
|
obj, member, p1, p2);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class P1, class P2, class A1, class A2, class A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessFunctionResultCallback_2_3
|
|
|
|
: public TessResultCallback3<R, A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback3<R, A1, A2, A3> base;
|
|
|
|
using FunctionSignature = R (*)(P1, P2, A1, A2, A3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_2_3(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2)
|
|
|
|
: function_(function), p1_(p1), p2_(p2) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, a1, a2, a3);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
function_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class P1, class P2, class A1, class A2, class A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessFunctionResultCallback_2_3<del, void, P1, P2, A1, A2, A3>
|
|
|
|
: public TessCallback3<A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback3<A1, A2, A3> base;
|
|
|
|
using FunctionSignature = void (*)(P1, P2, A1, A2, A3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_2_3(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2)
|
|
|
|
: function_(function), p1_(p1), p2_(p2) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
function_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class R, class P1, class P2, class A1, class A2, class A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline
|
|
|
|
typename _TessFunctionResultCallback_2_3<true, R, P1, P2, A1, A2, A3>::base*
|
|
|
|
NewTessCallback(R (*function)(P1, P2, A1, A2, A3),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2) {
|
|
|
|
return new _TessFunctionResultCallback_2_3<true, R, P1, P2, A1, A2, A3>(
|
|
|
|
function, p1, p2);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class R, class P1, class P2, class A1, class A2, class A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_2_3<false, R, P1, P2, A1, A2,
|
|
|
|
A3>::base*
|
|
|
|
NewPermanentTessCallback(R (*function)(P1, P2, A1, A2, A3),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2) {
|
|
|
|
return new _TessFunctionResultCallback_2_3<false, R, P1, P2, A1, A2, A3>(
|
|
|
|
function, p1, p2);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class A1,
|
|
|
|
class A2, class A3>
|
|
|
|
class _ConstTessMemberResultCallback_3_3
|
|
|
|
: public TessResultCallback3<R, A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback3<R, A1, A2, A3> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, A1, A2, A3) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_3_3(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2), p3_(p3) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, a1, a2, a3);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class T, class P1, class P2, class P3, class A1, class A2,
|
|
|
|
class A3>
|
|
|
|
class _ConstTessMemberResultCallback_3_3<del, void, T, P1, P2, P3, A1, A2, A3>
|
|
|
|
: public TessCallback3<A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback3<A1, A2, A3> base;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, A1, A2, A3) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_3_3(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2), p3_(p3) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class A1,
|
|
|
|
class A2, class A3>
|
|
|
|
inline typename _ConstTessMemberResultCallback_3_3<true, R, T1, P1, P2, P3, A1,
|
|
|
|
A2, A3>::base*
|
|
|
|
NewTessCallback(const T1* obj, R (T2::*member)(P1, P2, P3, A1, A2, A3) const,
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3) {
|
|
|
|
return new _ConstTessMemberResultCallback_3_3<true, R, T1, P1, P2, P3, A1, A2,
|
|
|
|
A3>(obj, member, p1, p2, p3);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class A1,
|
|
|
|
class A2, class A3>
|
|
|
|
inline typename _ConstTessMemberResultCallback_3_3<false, R, T1, P1, P2, P3, A1,
|
|
|
|
A2, A3>::base*
|
|
|
|
NewPermanentTessCallback(const T1* obj,
|
|
|
|
R (T2::*member)(P1, P2, P3, A1, A2, A3) const,
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3) {
|
|
|
|
return new _ConstTessMemberResultCallback_3_3<false, R, T1, P1, P2, P3, A1,
|
|
|
|
A2, A3>(obj, member, p1, p2,
|
|
|
|
p3);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class A1,
|
|
|
|
class A2, class A3>
|
|
|
|
class _TessMemberResultCallback_3_3
|
|
|
|
: public TessResultCallback3<R, A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback3<R, A1, A2, A3> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, A1, A2, A3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_3_3(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2), p3_(p3) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, a1, a2, a3);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class T, class P1, class P2, class P3, class A1, class A2,
|
|
|
|
class A3>
|
|
|
|
class _TessMemberResultCallback_3_3<del, void, T, P1, P2, P3, A1, A2, A3>
|
|
|
|
: public TessCallback3<A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback3<A1, A2, A3> base;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, A1, A2, A3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_3_3(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2), p3_(p3) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class A1,
|
|
|
|
class A2, class A3>
|
|
|
|
inline typename _TessMemberResultCallback_3_3<true, R, T1, P1, P2, P3, A1, A2,
|
|
|
|
A3>::base*
|
|
|
|
NewTessCallback(T1* obj, R (T2::*member)(P1, P2, P3, A1, A2, A3),
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3) {
|
|
|
|
return new _TessMemberResultCallback_3_3<true, R, T1, P1, P2, P3, A1, A2, A3>(
|
|
|
|
obj, member, p1, p2, p3);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class A1,
|
|
|
|
class A2, class A3>
|
|
|
|
inline typename _TessMemberResultCallback_3_3<false, R, T1, P1, P2, P3, A1, A2,
|
|
|
|
A3>::base*
|
|
|
|
NewPermanentTessCallback(T1* obj, R (T2::*member)(P1, P2, P3, A1, A2, A3),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3) {
|
|
|
|
return new _TessMemberResultCallback_3_3<false, R, T1, P1, P2, P3, A1, A2,
|
|
|
|
A3>(obj, member, p1, p2, p3);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class P1, class P2, class P3, class A1, class A2,
|
|
|
|
class A3>
|
|
|
|
class _TessFunctionResultCallback_3_3
|
|
|
|
: public TessResultCallback3<R, A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback3<R, A1, A2, A3> base;
|
|
|
|
using FunctionSignature = R (*)(P1, P2, P3, A1, A2, A3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_3_3(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3)
|
|
|
|
: function_(function), p1_(p1), p2_(p2), p3_(p3) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, a1, a2, a3);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
function_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class P1, class P2, class P3, class A1, class A2, class A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessFunctionResultCallback_3_3<del, void, P1, P2, P3, A1, A2, A3>
|
|
|
|
: public TessCallback3<A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback3<A1, A2, A3> base;
|
|
|
|
using FunctionSignature = void (*)(P1, P2, P3, A1, A2, A3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_3_3(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3)
|
|
|
|
: function_(function), p1_(p1), p2_(p2), p3_(p3) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
function_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class R, class P1, class P2, class P3, class A1, class A2, class A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_3_3<true, R, P1, P2, P3, A1, A2,
|
|
|
|
A3>::base*
|
|
|
|
NewTessCallback(R (*function)(P1, P2, P3, A1, A2, A3),
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3) {
|
|
|
|
return new _TessFunctionResultCallback_3_3<true, R, P1, P2, P3, A1, A2, A3>(
|
|
|
|
function, p1, p2, p3);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <class R, class P1, class P2, class P3, class A1, class A2, class A3>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _TessFunctionResultCallback_3_3<false, R, P1, P2, P3, A1, A2,
|
|
|
|
A3>::base*
|
|
|
|
NewPermanentTessCallback(R (*function)(P1, P2, P3, A1, A2, A3),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3) {
|
|
|
|
return new _TessFunctionResultCallback_3_3<false, R, P1, P2, P3, A1, A2, A3>(
|
|
|
|
function, p1, p2, p3);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class P4,
|
|
|
|
class A1, class A2, class A3>
|
|
|
|
class _ConstTessMemberResultCallback_4_3
|
|
|
|
: public TessResultCallback3<R, A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback3<R, A1, A2, A3> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, P4, A1, A2, A3) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_4_3(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) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, a1, a2, a3);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class T, class P1, class P2, class P3, class P4, class A1,
|
|
|
|
class A2, class A3>
|
|
|
|
class _ConstTessMemberResultCallback_4_3<del, void, T, P1, P2, P3, P4, A1, A2,
|
|
|
|
A3>
|
|
|
|
: public TessCallback3<A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback3<A1, A2, A3> base;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, P4, A1, A2, A3) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_4_3(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) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class A1, class A2, class A3>
|
|
|
|
inline typename _ConstTessMemberResultCallback_4_3<true, R, T1, P1, P2, P3, P4,
|
|
|
|
A1, A2, A3>::base*
|
|
|
|
NewTessCallback(const T1* obj,
|
|
|
|
R (T2::*member)(P1, P2, P3, P4, A1, A2, A3) const,
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4) {
|
|
|
|
return new _ConstTessMemberResultCallback_4_3<true, R, T1, P1, P2, P3, P4, A1,
|
|
|
|
A2, A3>(obj, member, p1, p2, p3,
|
|
|
|
p4);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class A1, class A2, class A3>
|
|
|
|
inline typename _ConstTessMemberResultCallback_4_3<false, R, T1, P1, P2, P3, P4,
|
|
|
|
A1, A2, A3>::base*
|
|
|
|
NewPermanentTessCallback(const T1* obj,
|
|
|
|
R (T2::*member)(P1, P2, P3, P4, A1, A2, A3) const,
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4) {
|
|
|
|
return new _ConstTessMemberResultCallback_4_3<false, R, T1, P1, P2, P3, P4,
|
|
|
|
A1, A2, A3>(obj, member, p1, p2,
|
|
|
|
p3, p4);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class P4,
|
|
|
|
class A1, class A2, class A3>
|
|
|
|
class _TessMemberResultCallback_4_3
|
|
|
|
: public TessResultCallback3<R, A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback3<R, A1, A2, A3> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, P4, A1, A2, A3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_4_3(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2), p3_(p3), p4_(p4) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, a1, a2, a3);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class T, class P1, class P2, class P3, class P4, class A1,
|
|
|
|
class A2, class A3>
|
|
|
|
class _TessMemberResultCallback_4_3<del, void, T, P1, P2, P3, P4, A1, A2, A3>
|
|
|
|
: public TessCallback3<A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback3<A1, A2, A3> base;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, P4, A1, A2, A3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_4_3(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4)
|
|
|
|
: object_(object), member_(member), p1_(p1), p2_(p2), p3_(p3), p4_(p4) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class A1, class A2, class A3>
|
|
|
|
inline typename _TessMemberResultCallback_4_3<true, R, T1, P1, P2, P3, P4, A1,
|
|
|
|
A2, A3>::base*
|
|
|
|
NewTessCallback(T1* obj, R (T2::*member)(P1, P2, P3, P4, A1, A2, A3),
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4) {
|
|
|
|
return new _TessMemberResultCallback_4_3<true, R, T1, P1, P2, P3, P4, A1, A2,
|
|
|
|
A3>(obj, member, p1, p2, p3, p4);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class A1, class A2, class A3>
|
|
|
|
inline typename _TessMemberResultCallback_4_3<false, R, T1, P1, P2, P3, P4, A1,
|
|
|
|
A2, A3>::base*
|
|
|
|
NewPermanentTessCallback(T1* obj, R (T2::*member)(P1, P2, P3, P4, A1, A2, A3),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4) {
|
|
|
|
return new _TessMemberResultCallback_4_3<false, R, T1, P1, P2, P3, P4, A1, A2,
|
|
|
|
A3>(obj, member, p1, p2, p3, p4);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class P1, class P2, class P3, class P4, class A1,
|
|
|
|
class A2, class A3>
|
|
|
|
class _TessFunctionResultCallback_4_3
|
|
|
|
: public TessResultCallback3<R, A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback3<R, A1, A2, A3> base;
|
|
|
|
using FunctionSignature = R (*)(P1, P2, P3, P4, A1, A2, A3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_4_3(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4)
|
|
|
|
: function_(function), p1_(p1), p2_(p2), p3_(p3), p4_(p4) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, p4_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, p4_, a1, a2, a3);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
function_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class P1, class P2, class P3, class P4, class A1, class A2,
|
|
|
|
class A3>
|
|
|
|
class _TessFunctionResultCallback_4_3<del, void, P1, P2, P3, P4, A1, A2, A3>
|
|
|
|
: public TessCallback3<A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback3<A1, A2, A3> base;
|
|
|
|
using FunctionSignature = void (*)(P1, P2, P3, P4, A1, A2, A3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_4_3(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4)
|
|
|
|
: function_(function), p1_(p1), p2_(p2), p3_(p3), p4_(p4) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, p4_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, p4_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
function_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class R, class P1, class P2, class P3, class P4, class A1, class A2,
|
|
|
|
class A3>
|
|
|
|
inline typename _TessFunctionResultCallback_4_3<true, R, P1, P2, P3, P4, A1, A2,
|
|
|
|
A3>::base*
|
|
|
|
NewTessCallback(R (*function)(P1, P2, P3, P4, A1, A2, A3),
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4) {
|
|
|
|
return new _TessFunctionResultCallback_4_3<true, R, P1, P2, P3, P4, A1, A2,
|
|
|
|
A3>(function, p1, p2, p3, p4);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class R, class P1, class P2, class P3, class P4, class A1, class A2,
|
|
|
|
class A3>
|
|
|
|
inline typename _TessFunctionResultCallback_4_3<false, R, P1, P2, P3, P4, A1,
|
|
|
|
A2, A3>::base*
|
|
|
|
NewPermanentTessCallback(R (*function)(P1, P2, P3, P4, A1, A2, A3),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4) {
|
|
|
|
return new _TessFunctionResultCallback_4_3<false, R, P1, P2, P3, P4, A1, A2,
|
|
|
|
A3>(function, p1, p2, p3, p4);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class A1, class A2, class A3>
|
|
|
|
class _ConstTessMemberResultCallback_5_3
|
|
|
|
: public TessResultCallback3<R, A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback3<R, A1, A2, A3> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, P4, P5, A1, A2, A3) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_5_3(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_, a1, a2, a3);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class T, class P1, class P2, class P3, class P4, class P5,
|
|
|
|
class A1, class A2, class A3>
|
|
|
|
class _ConstTessMemberResultCallback_5_3<del, void, T, P1, P2, P3, P4, P5, A1,
|
|
|
|
A2, A3>
|
|
|
|
: public TessCallback3<A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback3<A1, A2, A3> base;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, P4, P5, A1, A2, A3) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_5_3(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class A1, class A2, class A3>
|
|
|
|
inline typename _ConstTessMemberResultCallback_5_3<true, R, T1, P1, P2, P3, P4,
|
|
|
|
P5, A1, A2, A3>::base*
|
|
|
|
NewTessCallback(const T1* obj,
|
|
|
|
R (T2::*member)(P1, P2, P3, P4, P5, A1, A2, A3) const,
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3, typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5) {
|
|
|
|
return new _ConstTessMemberResultCallback_5_3<true, R, T1, P1, P2, P3, P4, P5,
|
|
|
|
A1, A2, A3>(obj, member, p1, p2,
|
|
|
|
p3, p4, p5);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class A1, class A2, class A3>
|
|
|
|
inline typename _ConstTessMemberResultCallback_5_3<false, R, T1, P1, P2, P3, P4,
|
|
|
|
P5, A1, A2, A3>::base*
|
|
|
|
NewPermanentTessCallback(const T1* obj,
|
|
|
|
R (T2::*member)(P1, P2, P3, P4, P5, A1, A2, A3) const,
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5) {
|
|
|
|
return new _ConstTessMemberResultCallback_5_3<false, R, T1, P1, P2, P3, P4,
|
|
|
|
P5, A1, A2, A3>(obj, member, p1,
|
|
|
|
p2, p3, p4, p5);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class A1, class A2, class A3>
|
|
|
|
class _TessMemberResultCallback_5_3
|
|
|
|
: public TessResultCallback3<R, A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback3<R, A1, A2, A3> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, P4, P5, A1, A2, A3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_5_3(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_, a1, a2, a3);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class T, class P1, class P2, class P3, class P4, class P5,
|
|
|
|
class A1, class A2, class A3>
|
|
|
|
class _TessMemberResultCallback_5_3<del, void, T, P1, P2, P3, P4, P5, A1, A2,
|
|
|
|
A3> : public TessCallback3<A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback3<A1, A2, A3> base;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, P4, P5, A1, A2, A3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_5_3(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class A1, class A2, class A3>
|
|
|
|
inline typename _TessMemberResultCallback_5_3<true, R, T1, P1, P2, P3, P4, P5,
|
|
|
|
A1, A2, A3>::base*
|
|
|
|
NewTessCallback(T1* obj, R (T2::*member)(P1, P2, P3, P4, P5, A1, A2, A3),
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3, typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5) {
|
|
|
|
return new _TessMemberResultCallback_5_3<true, R, T1, P1, P2, P3, P4, P5, A1,
|
|
|
|
A2, A3>(obj, member, p1, p2, p3, p4,
|
|
|
|
p5);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class A1, class A2, class A3>
|
|
|
|
inline typename _TessMemberResultCallback_5_3<false, R, T1, P1, P2, P3, P4, P5,
|
|
|
|
A1, A2, A3>::base*
|
|
|
|
NewPermanentTessCallback(T1* obj,
|
|
|
|
R (T2::*member)(P1, P2, P3, P4, P5, A1, A2, A3),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5) {
|
|
|
|
return new _TessMemberResultCallback_5_3<false, R, T1, P1, P2, P3, P4, P5, A1,
|
|
|
|
A2, A3>(obj, member, p1, p2, p3, p4,
|
|
|
|
p5);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class P1, class P2, class P3, class P4, class P5,
|
|
|
|
class A1, class A2, class A3>
|
|
|
|
class _TessFunctionResultCallback_5_3
|
|
|
|
: public TessResultCallback3<R, A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback3<R, A1, A2, A3> base;
|
|
|
|
using FunctionSignature = R (*)(P1, P2, P3, P4, P5, A1, A2, A3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_5_3(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5)
|
|
|
|
: function_(function), p1_(p1), p2_(p2), p3_(p3), p4_(p4), p5_(p5) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, p4_, p5_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, p4_, p5_, a1, a2, a3);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
function_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class P1, class P2, class P3, class P4, class P5, class A1,
|
|
|
|
class A2, class A3>
|
|
|
|
class _TessFunctionResultCallback_5_3<del, void, P1, P2, P3, P4, P5, A1, A2, A3>
|
|
|
|
: public TessCallback3<A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback3<A1, A2, A3> base;
|
|
|
|
using FunctionSignature = void (*)(P1, P2, P3, P4, P5, A1, A2, A3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_5_3(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5)
|
|
|
|
: function_(function), p1_(p1), p2_(p2), p3_(p3), p4_(p4), p5_(p5) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, p4_, p5_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, p4_, p5_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
function_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class R, class P1, class P2, class P3, class P4, class P5, class A1,
|
|
|
|
class A2, class A3>
|
|
|
|
inline typename _TessFunctionResultCallback_5_3<true, R, P1, P2, P3, P4, P5, A1,
|
|
|
|
A2, A3>::base*
|
|
|
|
NewTessCallback(R (*function)(P1, P2, P3, P4, P5, A1, A2, A3),
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3, typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5) {
|
|
|
|
return new _TessFunctionResultCallback_5_3<true, R, P1, P2, P3, P4, P5, A1,
|
|
|
|
A2, A3>(function, p1, p2, p3, p4,
|
|
|
|
p5);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class R, class P1, class P2, class P3, class P4, class P5, class A1,
|
|
|
|
class A2, class A3>
|
|
|
|
inline typename _TessFunctionResultCallback_5_3<false, R, P1, P2, P3, P4, P5,
|
|
|
|
A1, A2, A3>::base*
|
|
|
|
NewPermanentTessCallback(R (*function)(P1, P2, P3, P4, P5, A1, A2, A3),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5) {
|
|
|
|
return new _TessFunctionResultCallback_5_3<false, R, P1, P2, P3, P4, P5, A1,
|
|
|
|
A2, A3>(function, p1, p2, p3, p4,
|
|
|
|
p5);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class P6, class A1, class A2, class A3>
|
|
|
|
class _ConstTessMemberResultCallback_6_3
|
|
|
|
: public TessResultCallback3<R, A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback3<R, A1, A2, A3> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, P4, P5, P6, A1, A2, A3) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
typename remove_reference<P6>::type p6_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_6_3(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5),
|
|
|
|
p6_(p6) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_, a1, a2, a3);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class T, class P1, class P2, class P3, class P4, class P5,
|
|
|
|
class P6, class A1, class A2, class A3>
|
|
|
|
class _ConstTessMemberResultCallback_6_3<del, void, T, P1, P2, P3, P4, P5, P6,
|
|
|
|
A1, A2, A3>
|
|
|
|
: public TessCallback3<A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback3<A1, A2, A3> base;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, P4, P5, P6, A1, A2, A3) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
typename remove_reference<P6>::type p6_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_6_3(const T* object,
|
|
|
|
MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5),
|
|
|
|
p6_(p6) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class P6, class A1, class A2, class A3>
|
|
|
|
inline typename _ConstTessMemberResultCallback_6_3<true, R, T1, P1, P2, P3, P4,
|
|
|
|
P5, P6, A1, A2, A3>::base*
|
|
|
|
NewTessCallback(const T1* obj,
|
|
|
|
R (T2::*member)(P1, P2, P3, P4, P5, P6, A1, A2, A3) const,
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3, typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5,
|
|
|
|
typename Identity<P6>::type p6) {
|
|
|
|
return new _ConstTessMemberResultCallback_6_3<true, R, T1, P1, P2, P3, P4, P5,
|
|
|
|
P6, A1, A2, A3>(
|
|
|
|
obj, member, p1, p2, p3, p4, p5, p6);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class P6, class A1, class A2, class A3>
|
|
|
|
inline typename _ConstTessMemberResultCallback_6_3<false, R, T1, P1, P2, P3, P4,
|
|
|
|
P5, P6, A1, A2, A3>::base*
|
|
|
|
NewPermanentTessCallback(
|
|
|
|
const T1* obj, R (T2::*member)(P1, P2, P3, P4, P5, P6, A1, A2, A3) const,
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3, typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5, typename Identity<P6>::type p6) {
|
|
|
|
return new _ConstTessMemberResultCallback_6_3<false, R, T1, P1, P2, P3, P4,
|
|
|
|
P5, P6, A1, A2, A3>(
|
|
|
|
obj, member, p1, p2, p3, p4, p5, p6);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class T, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class P6, class A1, class A2, class A3>
|
|
|
|
class _TessMemberResultCallback_6_3
|
|
|
|
: public TessResultCallback3<R, A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback3<R, A1, A2, A3> base;
|
|
|
|
using MemberSignature = R (T::*)(P1, P2, P3, P4, P5, P6, A1, A2, A3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
typename remove_reference<P6>::type p6_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_6_3(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5),
|
|
|
|
p6_(p6) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_, a1, a2, a3);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class T, class P1, class P2, class P3, class P4, class P5,
|
|
|
|
class P6, class A1, class A2, class A3>
|
|
|
|
class _TessMemberResultCallback_6_3<del, void, T, P1, P2, P3, P4, P5, P6, A1,
|
|
|
|
A2, A3> : public TessCallback3<A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback3<A1, A2, A3> base;
|
|
|
|
using MemberSignature = void (T::*)(P1, P2, P3, P4, P5, P6, A1, A2, A3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
typename remove_reference<P6>::type p6_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessMemberResultCallback_6_3(T* object, MemberSignature member, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
|
|
|
|
: object_(object),
|
|
|
|
member_(member),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5),
|
|
|
|
p6_(p6) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(p1_, p2_, p3_, p4_, p5_, p6_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class P6, class A1, class A2, class A3>
|
|
|
|
inline typename _TessMemberResultCallback_6_3<true, R, T1, P1, P2, P3, P4, P5,
|
|
|
|
P6, A1, A2, A3>::base*
|
|
|
|
NewTessCallback(T1* obj, R (T2::*member)(P1, P2, P3, P4, P5, P6, A1, A2, A3),
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3, typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5,
|
|
|
|
typename Identity<P6>::type p6) {
|
|
|
|
return new _TessMemberResultCallback_6_3<true, R, T1, P1, P2, P3, P4, P5, P6,
|
|
|
|
A1, A2, A3>(obj, member, p1, p2, p3,
|
|
|
|
p4, p5, p6);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class T1, class T2, class R, class P1, class P2, class P3, class P4,
|
|
|
|
class P5, class P6, class A1, class A2, class A3>
|
|
|
|
inline typename _TessMemberResultCallback_6_3<false, R, T1, P1, P2, P3, P4, P5,
|
|
|
|
P6, A1, A2, A3>::base*
|
|
|
|
NewPermanentTessCallback(
|
|
|
|
T1* obj, R (T2::*member)(P1, P2, P3, P4, P5, P6, A1, A2, A3),
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3, typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5, typename Identity<P6>::type p6) {
|
|
|
|
return new _TessMemberResultCallback_6_3<false, R, T1, P1, P2, P3, P4, P5, P6,
|
|
|
|
A1, A2, A3>(obj, member, p1, p2, p3,
|
|
|
|
p4, p5, p6);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class R, class P1, class P2, class P3, class P4, class P5,
|
|
|
|
class P6, class A1, class A2, class A3>
|
|
|
|
class _TessFunctionResultCallback_6_3
|
|
|
|
: public TessResultCallback3<R, A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback3<R, A1, A2, A3> base;
|
|
|
|
using FunctionSignature = R (*)(P1, P2, P3, P4, P5, P6, A1, A2, A3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
typename remove_reference<P6>::type p6_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_6_3(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
|
|
|
|
: function_(function),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5),
|
|
|
|
p6_(p6) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, p4_, p5_, p6_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (*function_)(p1_, p2_, p3_, p4_, p5_, p6_, a1, a2, a3);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
function_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <bool del, class P1, class P2, class P3, class P4, class P5, class P6,
|
|
|
|
class A1, class A2, class A3>
|
|
|
|
class _TessFunctionResultCallback_6_3<del, void, P1, P2, P3, P4, P5, P6, A1, A2,
|
|
|
|
A3> : public TessCallback3<A1, A2, A3> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback3<A1, A2, A3> base;
|
|
|
|
using FunctionSignature = void (*)(P1, P2, P3, P4, P5, P6, A1, A2, A3);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
FunctionSignature function_;
|
|
|
|
typename remove_reference<P1>::type p1_;
|
|
|
|
typename remove_reference<P2>::type p2_;
|
|
|
|
typename remove_reference<P3>::type p3_;
|
|
|
|
typename remove_reference<P4>::type p4_;
|
|
|
|
typename remove_reference<P5>::type p5_;
|
|
|
|
typename remove_reference<P6>::type p6_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _TessFunctionResultCallback_6_3(FunctionSignature function, P1 p1,
|
|
|
|
P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
|
|
|
|
: function_(function),
|
|
|
|
p1_(p1),
|
|
|
|
p2_(p2),
|
|
|
|
p3_(p3),
|
|
|
|
p4_(p4),
|
|
|
|
p5_(p5),
|
|
|
|
p6_(p6) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2, A3 a3) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, p4_, p5_, p6_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(*function_)(p1_, p2_, p3_, p4_, p5_, p6_, a1, a2, a3);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
function_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class R, class P1, class P2, class P3, class P4, class P5, class P6,
|
|
|
|
class A1, class A2, class A3>
|
|
|
|
inline typename _TessFunctionResultCallback_6_3<true, R, P1, P2, P3, P4, P5, P6,
|
|
|
|
A1, A2, A3>::base*
|
|
|
|
NewTessCallback(R (*function)(P1, P2, P3, P4, P5, P6, A1, A2, A3),
|
|
|
|
typename Identity<P1>::type p1, typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3, typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5,
|
|
|
|
typename Identity<P6>::type p6) {
|
|
|
|
return new _TessFunctionResultCallback_6_3<true, R, P1, P2, P3, P4, P5, P6,
|
|
|
|
A1, A2, A3>(function, p1, p2, p3,
|
|
|
|
p4, p5, p6);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
template <class R, class P1, class P2, class P3, class P4, class P5, class P6,
|
|
|
|
class A1, class A2, class A3>
|
|
|
|
inline typename _TessFunctionResultCallback_6_3<false, R, P1, P2, P3, P4, P5,
|
|
|
|
P6, A1, A2, A3>::base*
|
|
|
|
NewPermanentTessCallback(R (*function)(P1, P2, P3, P4, P5, P6, A1, A2, A3),
|
|
|
|
typename Identity<P1>::type p1,
|
|
|
|
typename Identity<P2>::type p2,
|
|
|
|
typename Identity<P3>::type p3,
|
|
|
|
typename Identity<P4>::type p4,
|
|
|
|
typename Identity<P5>::type p5,
|
|
|
|
typename Identity<P6>::type p6) {
|
|
|
|
return new _TessFunctionResultCallback_6_3<false, R, P1, P2, P3, P4, P5, P6,
|
|
|
|
A1, A2, A3>(function, p1, p2, p3,
|
|
|
|
p4, p5, p6);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class A1, class A2, class A3, class A4>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _ConstTessMemberResultCallback_0_4
|
|
|
|
: public TessResultCallback4<R, A1, A2, A3, A4> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback4<R, A1, A2, A3, A4> base;
|
|
|
|
using MemberSignature = R (T::*)(A1, A2, A3, A4) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_0_4(const T* object,
|
|
|
|
MemberSignature member)
|
|
|
|
: object_(object), member_(member) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2, A3 a3, A4 a4) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(a1, a2, a3, a4);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(a1, a2, a3, a4);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class A1, class A2, class A3, class A4>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _ConstTessMemberResultCallback_0_4<del, void, T, A1, A2, A3, A4>
|
|
|
|
: public TessCallback4<A1, A2, A3, A4> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback4<A1, A2, A3, A4> base;
|
|
|
|
using MemberSignature = void (T::*)(A1, A2, A3, A4) const;
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const T* object_;
|
|
|
|
MemberSignature member_;
|
|
|
|
|
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
inline _ConstTessMemberResultCallback_0_4(const T* object,
|
|
|
|
MemberSignature member)
|
|
|
|
: object_(object), member_(member) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2, A3 a3, A4 a4) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(a1, a2, a3, a4);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(a1, a2, a3, a4);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class A1, class A2, class A3, class A4>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _ConstTessMemberResultCallback_0_4<true, R, T1, A1, A2, A3,
|
|
|
|
A4>::base*
|
|
|
|
NewTessCallback(const T1* obj, R (T2::*member)(A1, A2, A3, A4) const) {
|
|
|
|
return new _ConstTessMemberResultCallback_0_4<true, R, T1, A1, A2, A3, A4>(
|
|
|
|
obj, member);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class A1, class A2, class A3, class A4>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline typename _ConstTessMemberResultCallback_0_4<false, R, T1, A1, A2, A3,
|
|
|
|
A4>::base*
|
|
|
|
NewPermanentTessCallback(const T1* obj, R (T2::*member)(A1, A2, A3, A4) const) {
|
|
|
|
return new _ConstTessMemberResultCallback_0_4<false, R, T1, A1, A2, A3, A4>(
|
|
|
|
obj, member);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
template <bool del, class R, class T, class A1, class A2, class A3, class A4>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessMemberResultCallback_0_4
|
|
|
|
: public TessResultCallback4<R, A1, A2, A3, A4> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessResultCallback4<R, A1, A2, A3, A4> base;
|
|
|
|
using MemberSignature = R (T::*)(A1, A2, A3, A4);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
|
|
|
|
public:
|
2018-09-29 14:12:33 +08:00
|
|
|
inline _TessMemberResultCallback_0_4(T* object, MemberSignature member)
|
2019-03-31 16:24:28 +08:00
|
|
|
: object_(object), member_(member) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual R Run(A1 a1, A2 a2, A3 a3, A4 a4) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(a1, a2, a3, a4);
|
2013-09-23 23:26:50 +08:00
|
|
|
return result;
|
|
|
|
}
|
2019-03-31 16:24:28 +08:00
|
|
|
R result = (object_->*member_)(a1, a2, a3, a4);
|
|
|
|
// zero out the pointer to ensure segfault if used again
|
|
|
|
member_ = nullptr;
|
|
|
|
delete this;
|
|
|
|
return result;
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <bool del, class T, class A1, class A2, class A3, class A4>
|
2019-03-31 16:24:28 +08:00
|
|
|
class _TessMemberResultCallback_0_4<del, void, T, A1, A2, A3, A4>
|
|
|
|
: public TessCallback4<A1, A2, A3, A4> {
|
2013-09-23 23:26:50 +08:00
|
|
|
public:
|
2019-03-31 16:24:28 +08:00
|
|
|
typedef TessCallback4<A1, A2, A3, A4> base;
|
|
|
|
using MemberSignature = void (T::*)(A1, A2, A3, A4);
|
2013-09-23 23:26:50 +08:00
|
|
|
|
|
|
|
private:
|
2019-03-31 16:24:28 +08:00
|
|
|
T* object_;
|
2013-09-23 23:26:50 +08:00
|
|
|
MemberSignature member_;
|
|
|
|
|
|
|
|
public:
|
2018-09-29 14:12:33 +08:00
|
|
|
inline _TessMemberResultCallback_0_4(T* object, MemberSignature member)
|
2019-03-31 16:24:28 +08:00
|
|
|
: object_(object), member_(member) {}
|
2013-09-23 23:26:50 +08:00
|
|
|
|
2019-03-31 16:24:28 +08:00
|
|
|
virtual void Run(A1 a1, A2 a2, A3 a3, A4 a4) {
|
2013-09-23 23:26:50 +08:00
|
|
|
if (!del) {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(a1, a2, a3, a4);
|
2013-09-23 23:26:50 +08:00
|
|
|
} else {
|
2019-03-31 16:24:28 +08:00
|
|
|
(object_->*member_)(a1, a2, a3, a4);
|
2013-09-23 23:26:50 +08:00
|
|
|
// zero out the pointer to ensure segfault if used again
|
2016-12-13 00:20:28 +08:00
|
|
|
member_ = nullptr;
|
2013-09-23 23:26:50 +08:00
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef SWIG
|
|
|
|
template <class T1, class T2, class R, class A1, class A2, class A3, class A4>
|
2019-03-31 16:24:28 +08:00
|
|
|
inline
|
|
|
|
typename _TessMemberResultCallback_0_4<false, R, T1, A1, A2, A3, A4>::base*
|
|
|
|
NewPermanentTessCallback(T1* obj, R (T2::*member)(A1, A2, A3, A4)) {
|
|
|
|
return new _TessMemberResultCallback_0_4<false, R, T1, A1, A2, A3, A4>(
|
|
|
|
obj, member);
|
2013-09-23 23:26:50 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2017-01-26 08:20:19 +08:00
|
|
|
#endif // TESS_CALLBACK_SPECIALIZATIONS_H_
|