Text archives Help
- From: Abe Stephens <abe@sci.utah.edu>
- To: "'manta@sci.utah.edu'" <manta@sci.utah.edu>
- Subject: [MANTA] Callback question.
- Date: Tue, 21 Jun 2005 00:26:00 -0700
Hey
I've got my new const callback class for transactions:
template<class T, typename Arg1, typename Arg2>
class Callback_0Data_2Arg_const : public CallbackBase_0Data {
public:
Callback_0Data_2Arg_const(T* ptr, void (T::*pmf)(Arg1, Arg2)
const, Arg1 arg1, Arg2 arg2)
: ptr(ptr), pmf(pmf), arg1(arg1), arg2(arg2)
{
}
virtual ~Callback_0Data_2Arg_const()
{
}
virtual void call()
{
(ptr->*pmf)(arg1, arg2);
}
private:
T* ptr;
void (T::*pmf)(Arg1, Arg2) const;
Arg1 arg1;
Arg2 arg2;
};
And my create function:
template<class T, typename Arg1, typename Arg2> static
CallbackBase_0Data*
create(T* ptr, void (T::*pmf)(Arg1, Arg2) const, Arg1 arg1, Arg2 arg2) {
return new Callback_0Data_2Arg_const<T, Arg1, Arg2>(ptr, pmf,
arg1, arg2);
}
Now I want to create a callback for the method:
FMantaWindow::addCuttingPlane( Point &point, Vector &normal );
Problem is that Arg1 and Arg2 in create don't take references. So the
create function doesn't match. (At least I think that's why, but even
though this part of manta's code is template nirvana, it makes my head
spin. ;-) ) Anyone see a reason not to make Arg1 and Arg2 of create's
formal arguments references? (I'm about 65% sure I know what change
would do, but maybe someone else can parse this and tell me if it sounds
good....)
Abe
- [MANTA] Callback question., Abe Stephens, 06/21/2005
Archive powered by MHonArc 2.6.16.