Commit 0fee4efd authored by claes's avatar claes

Node index in getNodeObject

parent 08e79f1a
......@@ -1183,7 +1183,7 @@ JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_getObjectInfoObjid
}
JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_getNodeObject
(JNIEnv *env, jclass obj)
(JNIEnv *env, jclass obj, jint jnix)
{
int sts;
jclass PwrtObjid_id;
......@@ -1195,6 +1195,7 @@ JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_getNodeObject
jint oix, vid;
jobject return_obj;
jint jsts;
int nix;
cdhrObjid_id = (*env)->FindClass( env, "jpwr/rt/CdhrObjid");
cdhrObjid_cid = (*env)->GetMethodID( env, cdhrObjid_id,
......@@ -1204,7 +1205,8 @@ JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_getNodeObject
PwrtObjid_cid = (*env)->GetMethodID( env, PwrtObjid_id,
"<init>", "(II)V");
sts = gdh_GetNodeObject( 0, &objid);
nix = jnix;
sts = gdh_GetNodeObject( nix, &objid);
if ( ODD(sts))
{
oix = (jint) objid.oix;
......
......@@ -266,7 +266,7 @@ JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_classIdToObjid
* Signature: ()Ljpwr/rt/CdhrObjid;
*/
JNIEXPORT jobject JNICALL Java_jpwr_rt_Gdh_getNodeObject
(JNIEnv *, jobject);
(JNIEnv *, jobject, jint);
/*
* Class: jpwr_rt_Gdh
......
......@@ -296,7 +296,7 @@ public class Gdh {
public native CdhrClassId getObjectClass( PwrtObjid objid);
public native CdhrObjid getClassList( int classid);
public native CdhrObjid classIdToObjid( int classid);
public native CdhrObjid getNodeObject();
public native CdhrObjid getNodeObject( int nodeIdx);
public native GdhrGetAttributeChar getAttributeChar( String attributeName);
public native CdhrObjAttr getClassAttribute( int classid, PwrtObjid objid_obj );
public static native String translateFilename( String filename);
......
......@@ -1201,7 +1201,9 @@ public class GdhServer
case GET_NODE_OBJECT:
try
{
CdhrObjid ret = gdh.getNodeObject();
int nix = in.readInt();
CdhrObjid ret = gdh.getNodeObject( nix);
out.writeInt(ret.getSts());
out.flush();
if(ret.oddSts())
......
......@@ -1345,11 +1345,12 @@ public class Gdh
}
public CdhrObjid getNodeObject()
public CdhrObjid getNodeObject( int nodeIdx)
{
try
{
out.writeInt(GET_NODE_OBJECT);
out.writeInt(nodeIdx);
out.flush();
int sts = in.readInt();
if(sts % 2 == 0)
......
......@@ -296,7 +296,7 @@ public class Gdh {
public native CdhrClassId getObjectClass( PwrtObjid objid);
public native CdhrObjid getClassList( int classid);
public native CdhrObjid classIdToObjid( int classid);
public native CdhrObjid getNodeObject();
public native CdhrObjid getNodeObject( int nodeIdx);
public native GdhrGetAttributeChar getAttributeChar( String attributeName);
public native CdhrObjAttr getClassAttribute( int classid, PwrtObjid objid_obj );
public static native String translateFilename( String filename);
......
......@@ -1201,7 +1201,9 @@ public class GdhServer
case GET_NODE_OBJECT:
try
{
CdhrObjid ret = gdh.getNodeObject();
int nix = in.readInt();
CdhrObjid ret = gdh.getNodeObject( nix);
out.writeInt(ret.getSts());
out.flush();
if(ret.oddSts())
......
......@@ -1345,11 +1345,12 @@ public class Gdh
}
public CdhrObjid getNodeObject()
public CdhrObjid getNodeObject( int nodeIdx)
{
try
{
out.writeInt(GET_NODE_OBJECT);
out.writeInt(nodeIdx);
out.flush();
int sts = in.readInt();
if(sts % 2 == 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment