PLearn 0.1
|
Trampoline for a non-void non-const 2-argument method. More...
#include <RemoteTrampoline.h>
Public Types | |
enum | { expected_nargs = 2 } |
typedef RemoteTrampoline | inherited |
typedef R(T::* | MethodType )(A1, A2) |
Public Member Functions | |
RemoteTrampoline_2 (const string &methodname, const RemoteMethodDoc &doc, MethodType m, const flag_t &flgs=0) | |
virtual void | call (Object *instance, int nargs, PStream &io) const |
Perform the act of binding arguments on a stream with an object instance. | |
Protected Attributes | |
MethodType | m_method |
Trampoline for a non-void non-const 2-argument method.
Definition at line 413 of file RemoteTrampoline.h.
typedef RemoteTrampoline PLearn::RemoteTrampoline_2< T, R, A1, A2 >::inherited |
Definition at line 415 of file RemoteTrampoline.h.
typedef R(T::* PLearn::RemoteTrampoline_2< T, R, A1, A2 >::MethodType)(A1, A2) |
Definition at line 417 of file RemoteTrampoline.h.
anonymous enum |
Definition at line 416 of file RemoteTrampoline.h.
{ expected_nargs = 2 };
PLearn::RemoteTrampoline_2< T, R, A1, A2 >::RemoteTrampoline_2 | ( | const string & | methodname, |
const RemoteMethodDoc & | doc, | ||
MethodType | m, | ||
const flag_t & | flgs = 0 |
||
) | [inline] |
virtual void PLearn::RemoteTrampoline_2< T, R, A1, A2 >::call | ( | Object * | instance, |
int | nargs, | ||
PStream & | io | ||
) | const [inline, virtual] |
Perform the act of binding arguments on a stream with an object instance.
The actual number of arguments is passed only for error-checking, since the trampoline knows the number of arguments that it is expecting. If this is used to call a global function or a static method that was declared with declareFunction, instead of a regular method declared with declareMethod, then the instance argument is ignored (and should be passed 0 by convention).
Implements PLearn::RemoteTrampoline.
Definition at line 428 of file RemoteTrampoline.h.
References PLearn::RemoteTrampoline::checkNargs(), PLearn::RemoteTrampoline_0< T, R >::expected_nargs, PLearn::RemoteTrampoline_0< T, R >::m_method, PLearn::RemoteTrampoline::sendRemoteMethodResult(), and TRAMPOLINE_TYPE.
{ checkNargs(nargs, expected_nargs); TRAMPOLINE_TYPE(A1) a1; io >> a1; TRAMPOLINE_TYPE(A2) a2; io >> a2; TRAMPOLINE_TYPE(R) r = (as<T>(instance)->*m_method)(a1,a2); sendRemoteMethodResult(io, r); }
MethodType PLearn::RemoteTrampoline_2< T, R, A1, A2 >::m_method [protected] |
Definition at line 449 of file RemoteTrampoline.h.