Removed Functor2 class definition.
svn-id: r31639
This commit is contained in:
parent
5279c58072
commit
651bc3a278
2 changed files with 3 additions and 26 deletions
|
@ -51,7 +51,7 @@ int16 ScriptFunctions::callFunction(uint16 index, int16 argc, int16 *argv) {
|
||||||
return (*_externalFuncs[index])(argc, argv);
|
return (*_externalFuncs[index])(argc, argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef Functor2Mem<int16, int16*, int16, ScriptFunctionsRtz> ExternalFuncRtz;
|
typedef Common::Functor2Mem<int16, int16*, int16, ScriptFunctionsRtz> ExternalFuncRtz;
|
||||||
#define External(x) ExternalFuncRtz(this, &ScriptFunctionsRtz::x)
|
#define External(x) ExternalFuncRtz(this, &ScriptFunctionsRtz::x)
|
||||||
void ScriptFunctionsRtz::setupExternalsTable() {
|
void ScriptFunctionsRtz::setupExternalsTable() {
|
||||||
static const ExternalFuncRtz externalsTable[] = {
|
static const ExternalFuncRtz externalsTable[] = {
|
||||||
|
|
|
@ -28,37 +28,14 @@
|
||||||
|
|
||||||
#include "common/util.h"
|
#include "common/util.h"
|
||||||
#include "common/file.h"
|
#include "common/file.h"
|
||||||
|
#include "common/func.h"
|
||||||
#include "common/stream.h"
|
#include "common/stream.h"
|
||||||
|
|
||||||
namespace Made {
|
namespace Made {
|
||||||
|
|
||||||
class MadeEngine;
|
class MadeEngine;
|
||||||
|
|
||||||
template<class Arg1, class Arg2, class Res>
|
typedef Common::Functor2<int16, int16*, int16> ExternalFunc;
|
||||||
struct Functor2 : public Common::BinaryFunction<Arg1, Arg2, Res> {
|
|
||||||
virtual ~Functor2() {}
|
|
||||||
|
|
||||||
virtual bool isValid() const = 0;
|
|
||||||
virtual Res operator()(Arg1, Arg2) const = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<class Arg1, class Arg2, class Res, class T>
|
|
||||||
class Functor2Mem : public Functor2<Arg1, Arg2, Res> {
|
|
||||||
public:
|
|
||||||
typedef Res (T::*FuncType)(Arg1, Arg2);
|
|
||||||
|
|
||||||
Functor2Mem(T *t, const FuncType &func) : _t(t), _func(func) {}
|
|
||||||
|
|
||||||
bool isValid() const { return _func != 0; }
|
|
||||||
Res operator()(Arg1 v1, Arg2 v2) const {
|
|
||||||
return (_t->*_func)(v1, v2);
|
|
||||||
}
|
|
||||||
private:
|
|
||||||
mutable T *_t;
|
|
||||||
Res (T::*_func)(Arg1, Arg2);
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef Functor2<int16, int16*, int16> ExternalFunc;
|
|
||||||
|
|
||||||
class ScriptFunctions {
|
class ScriptFunctions {
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue