Hi
Once again it seems that I'm unable to correctly understand the examples
on javadoc overview...
I have a function that expects three parameters : an input int code, an
int by reference which will receive the number of tasks running and an
array of struct pvmtaskinfo by reference, which will receive an array of
structures pvmtaskinfo, one for each running task in the system...
I've mapped the int by reference to an IntByReference (so far so
good :p)
and I've tried mapping the last parameter to pvmtaskinfo, pvmtaskinfo[]
and PointerByReference but no matter what I do I don't manage to get it
work.
I've overriden useMemory which was protected => just a call to
super.useMemory(Pointer)... Also I have an no-arg constructor for
pvmtaskinfo.
Here is my current code (with the PointerByReference version) :
========================================
PointerByReference ptr = new PointerByReference();
IntByReference nbTasks = new IntByReference();
test.pvm_tasks(0, nbTasks, ptr);
Pointer[] allPtr = ptr.getValue().getPointerArray(0,
nbTasks.getValue());
for(int i = 0 ; i < allPtr.length ; i++)
{
if (allPtr[i] != null){
pvmtaskinfo toto = new pvmtaskinfo();
toto.useMemory(allPtr[i]);
toto.read();
//System.out.println(toto.ti_tid);
}
}
=======================================
Any clever idea? Need an expert point of view :p
Thanks
Simon