From: Marek P. <ma...@us...> - 2002-04-04 00:49:19
|
Update of /cvsroot/javaprofiler/library/src/commun In directory usw-pr-cvs1:/tmp/cvs-serv31762/src/commun Modified Files: iprof.cpp iprof.h Log Message: new getParents() method added to communication interface Index: iprof.cpp =================================================================== RCS file: /cvsroot/javaprofiler/library/src/commun/iprof.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** iprof.cpp 7 Mar 2002 00:27:21 -0000 1.14 --- iprof.cpp 4 Apr 2002 00:49:14 -0000 1.15 *************** *** 62,65 **** --- 62,66 ---- _func[F_RUN_GC] = &IProf::_runGC; _func[F_GET_CALLTREE] = &IProf::_getCallTree; + _func[F_GET_PARENTS] = &IProf::_getParents; if( setup.com.communType == Setup::COMMUN_SOCKET) *************** *** 288,290 **** --- 289,310 ---- getCallTree( threadObjId, b); + } + + void IProf::_getParents( Buffer& b) { + + const char* buf = b.getBuffer()+sizeof( jint); // jump the "action" field + + jint objId = ntohl( *(const jint*)buf); + + sParents parents; + jint rc = getParents( objId, parents); + + b.clear(); + b += rc; + + if( rc != RC_OK) return; + + b += parents.parentLeftObjId; + b += parents.parentUpObjId; + b += parents.parentRightObjId; } Index: iprof.h =================================================================== RCS file: /cvsroot/javaprofiler/library/src/commun/iprof.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** iprof.h 7 Mar 2002 00:27:21 -0000 1.16 --- iprof.h 4 Apr 2002 00:49:14 -0000 1.17 *************** *** 67,71 **** /// number of methods of the interface ! FUNC_COUNT = 13 }; --- 67,71 ---- /// number of methods of the interface ! FUNC_COUNT = 14 }; *************** *** 154,158 **** /// getCallTree() ! F_GET_CALLTREE = 12 }; --- 154,161 ---- /// getCallTree() ! F_GET_CALLTREE = 12, ! ! /// getParents() ! F_GET_PARENTS = 13 }; *************** *** 299,302 **** --- 302,320 ---- typedef List<sID,LI1> seqID; + /** Parent nodes of given object. This structure + ** contains object IDs of parents of given object. */ + + struct sParents { + + /// ID of parent #1 (on the left side in the structure) + objectID parentLeftObjId; + + /// ID of parent #2 (on up in the structure) + objectID parentUpObjId; + + /// ID of parent #3 (on the right side in the structure) + objectID parentRightObjId; + }; + /** Type of sequence. ** Type of objects in the sequence */ *************** *** 605,608 **** --- 623,636 ---- void _getCallTree( Buffer& b); + /** Get parents. This method processes in/out buffer, + ** gains arguments and calls getParents() method. When + ** finished, in 'b' there is binary output of called method. + ** + ** @param b in/out buffer + ** + ** @see getParents() */ + + void _getParents( Buffer& b); + private: *************** *** 719,722 **** --- 747,758 ---- virtual void getCallTree( objectID threadObjId, // in (jint) Buffer& b) = 0; // out + + /** Get parents. An abstract method implemented + ** by Prof class. + ** + ** @see Prof::getParents(), Prof */ + + virtual jint getParents( objectID objId, // in (jint) + sParents& parents) = 0; // out private: |