Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

link.c

Go to the documentation of this file.
00001 /**********************************************************************
00002 *       FILE:     LINK.c
00003 *       AUTHOR:   E. Otis O
00004 *       DATE:     1 May 1993
00005 *       PURPOSE:
00006 *         There was one before, but thanks to some brilliant design
00007 *         inovations, this class has been scaled back significanly.
00008 *         Its ".c" file is kept here for possible future extensions.
00009 ***********************************************************************/
00010 
00011 #include "link.h"
00012 
00013 
00014 
00015 
00016 
00017 /**********************************************************************
00018 *       Public Functions
00019 ***********************************************************************/
00020 
00021 int Route::find_join(int joinNum) {
00022 
00023   if ( between(joinNum, 0, numJoins) ) return joins[joinNum];
00024   else {
00025     cerr << "Join link " << joinNum << " out of range ("
00026          << 0 << ".." << numJoins << ")\n";
00027     return 0;  // node 0 points to NULL
00028   }
00029 }
00030 
00031 /************************************************************/
00032 
00033 void Route::get_join(int join) {
00034 
00035   int *oldJoins= joins;
00036   int num= numJoins;
00037 
00038   joins= new int[++numJoins];
00039   assert ( joins != 0 );
00040   for (int i= 0; i < num; i++) joins[i]= oldJoins[i];
00041   joins[num]= join;
00042 
00043   delete oldJoins;
00044 }
00045 
00046 

Generated on Sun Jul 6 23:07:15 2003 for Scotland Yard by doxygen1.2.15