#include <OpFunc.h>
Public Member Functions | |
GetOpFunc1 (A(T::*func)(L) const ) | |
void | op (const Eref &e, L index, ObjId recipient, FuncId fid) const |
A | returnOp (const Eref &e, const L &index) const |
Distinct reduceOp with the index. |
This specialized OpFunc is for looking up a single field value using a single argument. It generates an opFunc that takes two arguments: 1. FuncId of the function on the object that requested the value. 2. Index or other identifier to do the look up. The OpFunc then sends back a message with the info. Here T is the class that owns the function. A is the return type L is the lookup index.
GetOpFunc1< T, L, A >::GetOpFunc1 | ( | A(T::*)(L) const | func | ) | [inline] |
void GetOpFunc1< T, L, A >::op | ( | const Eref & | e, | |
L | index, | |||
ObjId | recipient, | |||
FuncId | fid | |||
) | const [inline, virtual] |
The buf just contains the funcid on the src element that is ready to receive the returned data. Also we are returning the data along the Msg that brought in the request, so we don't need to scan through all Msgs in the Element to find the right one. So we bypass the usual SrcFinfo::sendTo, and instead go right to the Qinfo::addToQ to send off data. Finally, the data is copied back-and-forth about 3 times. Wasteful, but the 'get' function is not to be heavily used.
Implements LookupGetOpFuncBase< L, A >.
References Element::cinfo(), ObjId::element(), ObjId::eref(), Cinfo::getOpFunc(), OpFunc1Base< A >::op(), and GetOpFunc1< T, L, A >::returnOp().
A GetOpFunc1< T, L, A >::returnOp | ( | const Eref & | e, | |
const L & | index | |||
) | const [inline, virtual] |
Distinct reduceOp with the index.
Implements LookupGetOpFuncBase< L, A >.
References Eref::data().
Referenced by GetOpFunc1< T, L, A >::op().