ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/mdtools/interface_implementation/MakeStamps.cpp
(Generate patch)

Comparing trunk/mdtools/interface_implementation/MakeStamps.cpp (file contents):
Revision 196 by chuckv, Thu Dec 5 21:37:51 2002 UTC vs.
Revision 198 by mmeineke, Fri Dec 6 21:20:42 2002 UTC

# Line 31 | Line 31 | MoleculeStamp* LinkedMolStamp::match( char* id ){
31        if(next != NULL ){
32          if( next->match( id ) != NULL){
33            sprintf( painCave.errMsg,
34 <                   "Molecule Stamp Error. Two separate of declarations of %s present.\n",
34 >                   "Molecule Stamp Error. Two separate of declarations of "
35 >                   "%s present.\n",
36                     id );
37            painCave.isFatal = 1;
38            simError();
# Line 48 | Line 49 | MoleculeStamp* LinkedMolStamp::match( char* id ){
49    }
50    
51    if( next != NULL ) return next->match( id );
52 +  
53 +  return NULL;
54 + }
55 +
56 + LinkedMolStamp* LinkedMolStamp::extract( char* id ){
57 +
58 +  if( mol_stamp != NULL ){
59 +    if(!strcmp( mol_stamp->getID(), id )){
60 +      
61 +      // make sure we aren't hiding somebody else with the same name
62 +      if(next != NULL ){
63 +        if( next->match( id ) != NULL){
64 +          sprintf( painCave.errMsg,
65 +                   "Molecule Stamp Error. Two separate of declarations of "
66 +                   "%s present.\n",
67 +                   id );
68 +          painCave.isFatal = 1;
69 +          simError();
70 + #ifdef IS_MPI
71 +          if( painCave.isEventLoop ){
72 +            if( worldRank == 0 ) mpiInterfaceExit();
73 +          }
74 + #endif //is_mpi
75 +        }
76 +      }
77 +          
78 +      prev->setNext( next );
79 +      if( next != NULL ) next->setPrev( prev );
80 +      return this;
81 +    }
82 +  }
83    
84 +  if( next != NULL ) return next->extract( id );
85 +  
86    return NULL;
87   }
88  
# Line 103 | Line 137 | MoleculeStamp* MakeStamps::getMolecule( char* the_id )
137    return key;
138   }
139  
140 < MoleculeStamp* MakeStamps::getMolecule( char* the_id ){
140 > LinkedMolStamp* MakeStamps::extractMolStamp( char* the_id ){
141    int key;
142    
143    key = hash( the_id );
144    if( my_mols[key] != NULL ){
145 <    return my_mols[key]->match( the_id );
145 >    return my_mols[key]->extract( the_id );
146    }
147    
148    return NULL;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines