00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "link.h"
00012
00013
00014
00015
00016
00017
00018
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;
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