Two lines between functions
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33844 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
d5ca839e4f
commit
315c212bfd
@ -69,6 +69,7 @@ private:
|
||||
P p;
|
||||
};
|
||||
|
||||
|
||||
template<>
|
||||
class ParameterBinder<const BEntry *> {
|
||||
public:
|
||||
@ -86,6 +87,7 @@ private:
|
||||
BEntry p;
|
||||
};
|
||||
|
||||
|
||||
template<>
|
||||
class ParameterBinder<const entry_ref *> {
|
||||
public:
|
||||
@ -105,6 +107,7 @@ private:
|
||||
entry_ref p;
|
||||
};
|
||||
|
||||
|
||||
template<>
|
||||
class ParameterBinder<const node_ref *> {
|
||||
public:
|
||||
@ -122,6 +125,7 @@ private:
|
||||
node_ref p;
|
||||
};
|
||||
|
||||
|
||||
template<>
|
||||
class ParameterBinder<const BMessage *> {
|
||||
public:
|
||||
@ -149,12 +153,14 @@ private:
|
||||
BMessage *p;
|
||||
};
|
||||
|
||||
|
||||
class FunctionObject {
|
||||
public:
|
||||
virtual void operator()() = 0;
|
||||
virtual ~FunctionObject() {}
|
||||
};
|
||||
|
||||
|
||||
template<class R>
|
||||
class FunctionObjectWithResult : public FunctionObject {
|
||||
public:
|
||||
@ -165,6 +171,7 @@ protected:
|
||||
R result;
|
||||
};
|
||||
|
||||
|
||||
template <class Param1>
|
||||
class SingleParamFunctionObject : public FunctionObject {
|
||||
public:
|
||||
@ -184,6 +191,7 @@ private:
|
||||
ParameterBinder<Param1> p1;
|
||||
};
|
||||
|
||||
|
||||
template <class Result, class Param1>
|
||||
class SingleParamFunctionObjectWithResult : public FunctionObjectWithResult<Result> {
|
||||
public:
|
||||
@ -202,6 +210,7 @@ private:
|
||||
ParameterBinder<Param1> p1;
|
||||
};
|
||||
|
||||
|
||||
template <class Param1, class Param2>
|
||||
class TwoParamFunctionObject : public FunctionObject {
|
||||
public:
|
||||
@ -246,6 +255,7 @@ private:
|
||||
ParameterBinder<Param3> p3;
|
||||
};
|
||||
|
||||
|
||||
template <class Result, class Param1, class Param2, class Param3>
|
||||
class ThreeParamFunctionObjectWithResult : public FunctionObjectWithResult<Result> {
|
||||
public:
|
||||
@ -269,6 +279,7 @@ private:
|
||||
ParameterBinder<Param3> p3;
|
||||
};
|
||||
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4>
|
||||
class FourParamFunctionObject : public FunctionObject {
|
||||
public:
|
||||
@ -293,6 +304,7 @@ private:
|
||||
ParameterBinder<Param4> p4;
|
||||
};
|
||||
|
||||
|
||||
template <class Result, class Param1, class Param2, class Param3, class Param4>
|
||||
class FourParamFunctionObjectWithResult : public FunctionObjectWithResult<Result> {
|
||||
public:
|
||||
@ -318,6 +330,7 @@ private:
|
||||
ParameterBinder<Param4> p4;
|
||||
};
|
||||
|
||||
|
||||
template<class T>
|
||||
class PlainMemberFunctionObject : public FunctionObject {
|
||||
public:
|
||||
@ -335,6 +348,7 @@ private:
|
||||
T *target;
|
||||
};
|
||||
|
||||
|
||||
template<class T>
|
||||
class PlainLockingMemberFunctionObject : public FunctionObject {
|
||||
public:
|
||||
@ -358,6 +372,7 @@ private:
|
||||
BMessenger messenger;
|
||||
};
|
||||
|
||||
|
||||
template<class T, class R>
|
||||
class PlainMemberFunctionObjectWithResult : public FunctionObjectWithResult<R> {
|
||||
public:
|
||||
@ -376,6 +391,7 @@ private:
|
||||
T *target;
|
||||
};
|
||||
|
||||
|
||||
template<class T, class Param1>
|
||||
class SingleParamMemberFunctionObject : public FunctionObject {
|
||||
public:
|
||||
@ -395,6 +411,7 @@ private:
|
||||
ParameterBinder<Param1> p1;
|
||||
};
|
||||
|
||||
|
||||
template<class T, class Param1, class Param2>
|
||||
class TwoParamMemberFunctionObject : public FunctionObject {
|
||||
public:
|
||||
@ -439,6 +456,7 @@ protected:
|
||||
ParameterBinder<Param1> p1;
|
||||
};
|
||||
|
||||
|
||||
template<class T, class R, class Param1, class Param2>
|
||||
class TwoParamMemberFunctionObjectWithResult : public FunctionObjectWithResult<R> {
|
||||
public:
|
||||
@ -462,6 +480,7 @@ protected:
|
||||
ParameterBinder<Param2> p2;
|
||||
};
|
||||
|
||||
|
||||
// convenience factory functions
|
||||
// NewFunctionObject
|
||||
// NewMemberFunctionObject
|
||||
@ -477,6 +496,7 @@ NewFunctionObject(void (*function)(Param1), Param1 p1)
|
||||
return new SingleParamFunctionObject<Param1>(function, p1);
|
||||
}
|
||||
|
||||
|
||||
template<class Param1, class Param2>
|
||||
TwoParamFunctionObject<Param1, Param2> *
|
||||
NewFunctionObject(void (*function)(Param1, Param2), Param1 p1, Param2 p2)
|
||||
@ -484,6 +504,7 @@ NewFunctionObject(void (*function)(Param1, Param2), Param1 p1, Param2 p2)
|
||||
return new TwoParamFunctionObject<Param1, Param2>(function, p1, p2);
|
||||
}
|
||||
|
||||
|
||||
template<class Param1, class Param2, class Param3>
|
||||
ThreeParamFunctionObject<Param1, Param2, Param3> *
|
||||
NewFunctionObject(void (*function)(Param1, Param2, Param3),
|
||||
@ -492,6 +513,7 @@ NewFunctionObject(void (*function)(Param1, Param2, Param3),
|
||||
return new ThreeParamFunctionObject<Param1, Param2, Param3>(function, p1, p2, p3);
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
PlainMemberFunctionObject<T> *
|
||||
NewMemberFunctionObject(void (T::*function)(), T *onThis)
|
||||
@ -499,6 +521,7 @@ NewMemberFunctionObject(void (T::*function)(), T *onThis)
|
||||
return new PlainMemberFunctionObject<T>(function, onThis);
|
||||
}
|
||||
|
||||
|
||||
template<class T, class Param1>
|
||||
SingleParamMemberFunctionObject<T, Param1> *
|
||||
NewMemberFunctionObject(void (T::*function)(Param1), T *onThis, Param1 p1)
|
||||
@ -506,6 +529,7 @@ NewMemberFunctionObject(void (T::*function)(Param1), T *onThis, Param1 p1)
|
||||
return new SingleParamMemberFunctionObject<T, Param1>(function, onThis, p1);
|
||||
}
|
||||
|
||||
|
||||
template<class T, class Param1, class Param2>
|
||||
TwoParamMemberFunctionObject<T, Param1, Param2> *
|
||||
NewMemberFunctionObject(void (T::*function)(Param1, Param2), T *onThis,
|
||||
@ -515,6 +539,7 @@ NewMemberFunctionObject(void (T::*function)(Param1, Param2), T *onThis,
|
||||
p1, p2);
|
||||
}
|
||||
|
||||
|
||||
template<class T, class R, class Param1, class Param2>
|
||||
TwoParamMemberFunctionObjectWithResult<T, R, Param1, Param2> *
|
||||
NewMemberFunctionObjectWithResult(R (T::*function)(Param1, Param2),
|
||||
@ -524,6 +549,7 @@ NewMemberFunctionObjectWithResult(R (T::*function)(Param1, Param2),
|
||||
(function, onThis, p1, p2);
|
||||
}
|
||||
|
||||
|
||||
template<class HandlerOrSubclass>
|
||||
PlainLockingMemberFunctionObject<HandlerOrSubclass> *
|
||||
NewLockingMemberFunctionObject(void (HandlerOrSubclass::*function)(),
|
||||
|
Loading…
Reference in New Issue
Block a user