template<typename fntype, typename msgtype>
HandledCode FX::FXIPCChannel::invokeMsgHandler ( fntype  fnptr,
msgtype *  msg 
) [inline, protected]

Outsources message handling to the channel's threadpool (used to perform significant amounts of processing). Simply do return invokeMsgHandler(mymethod, msg); and even if your method throws an exception it will be handled correctly. Your method should be of the spec HandledCode subclass::method(msgtype *msg)

Definition at line 805 of file FXIPC.h.

References FXERRHM, and FXSTATIC_ASSERT.

00806     {
00807         typedef typename Generic::FnInfo<fntype>::objectType objType;
00808         FXSTATIC_ASSERT((Generic::convertible<FXIPCChannel, objType>::value), Must_Be_Member_Function_Of_FXIPCChannel_subclass);
00809         typedef typename Generic::TL::create<void, fntype, FXAutoPtr<msgtype>, Generic::BoundFunctorV *>::value functtype;
00810         FXAutoPtr< Generic::BoundFunctor<functtype> > callv;
00811         // MSVC7.1 has issues with type deduction of int_handlerIndirect so we must help it
00812         void (FXIPCChannel::*mythunk)(fntype, FXAutoPtr<msgtype>, Generic::BoundFunctorV *)=&FXIPCChannel::int_handlerIndirect<objType, fntype, msgtype>;
00813         FXERRHM(callv=new Generic::BoundFunctor<functtype>(Generic::Functor<functtype>(this, mythunk)));
00814         Generic::TL::instance<0>(callv->parameters()).value=fnptr;
00815         Generic::TL::instance<1>(callv->parameters()).value=msg;
00816         Generic::TL::instance<2>(callv->parameters()).value=PtrPtr(callv);
00817         int_addMsgHandler(PtrPtr(callv));
00818         PtrRelease(callv);
00819         return HandledAsync;
00820     }


(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:34:33 2009 for TnFOX by doxygen v1.4.7