??????????????????????? ObjClosure1 ?? ??????????
????limonp-0.5.1/include/limonp/Closure.hpp
?????п?????? ObjClosure1 ?????????′???
template <class Obj?? class Funct?? class Arg1>
class ObjClosure1: public ClosureInterface {
public:
ObjClosure1(Obj* p?? Funct fun?? Arg1 arg1) {
p_ = p;
fun_ = fun;
arg1_ = arg1;
}
virtual ~ObjClosure1() {
}
virtual void Run() {
(p_->*fun_)(arg1_);
}
private:
Obj* p_;
Funct fun_;
Arg1 arg1_;
};
??????????
???????????????????????????? ??????????????????????????????????? ObjClosure1 ???????????洢??? ???????? Run() ??????????????
????virtual void Run() {
????(p_->*fun_)(arg1_);
????}
????????????????????е?????????漰????????????????á? ???????????????????? this ????????д?? C++ ??????????? ?????????C???????????ú????????£?????????????????д??? this ?????
????(*fun)(arg1_);
?????????? C++ ?У?????????????????????????????
????(p_->*fun_)(arg1_);
????????????? p_ ???? this ????????
????????????????? NewClosure ?? ???????????????????????????????????????????????????
?????????????????????????д????
??????
?????о????д????????????????о????????????????????????е?? ?????????????????????? ???????????????????ɡ?