Changes in / [adb5cda:401f90]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/TremoloParser.cpp
radb5cda r401f90 100 100 FormatParser< tremolo >::~FormatParser() 101 101 { 102 std::cerr << "Clearing usedFields." << std::endl;102 LOG(1, "INFO: Clearing usedFields."); 103 103 usedFields.clear(); 104 104 additionalAtomData.clear(); … … 118 118 // reset atomIdMap, for we now get new serials 119 119 atomIdMap.clear(); 120 std::cerr << "Clearing usedFields." << std::endl;120 LOG(1, "INFO: Clearing usedFields."); 121 121 usedFields.clear(); 122 122 … … 225 225 */ 226 226 void FormatParser< tremolo >::saveLine(ostream* file, atom* currentAtom) { 227 //vector<string>::iterator it; 228 // TODO: Is unique for FormatParser< tremolo >::usedFields still required? 229 vector<string>::iterator it = unique(usedFields.begin(), usedFields.end()); // skips all duplicates in the vector 227 vector<string>::iterator it; 230 228 231 229 TremoloKey::atomDataKey currentField; … … 349 347 350 348 lineStream << line.substr(offset); 351 std::cerr << "Clearing usedFields in parseAtomDataKeysLine." << std::endl;349 LOG(1, "INFO: Clearing usedFields in parseAtomDataKeysLine."); 352 350 usedFields.clear(); 353 351 while (lineStream.good()) { … … 388 386 stringstream lineStream; 389 387 atom* newAtom = World::getInstance().createAtom(); 390 TremoloAtomInfoContainer *atomInfo = NULL;391 additionalAtomData[ newAtom->getId()] = TremoloAtomInfoContainer(); // fill with default values392 atomInfo = &additionalAtomData[newAtom->getId()];388 const atomId_t atomid = newAtom->getId(); 389 additionalAtomData[atomid] = TremoloAtomInfoContainer(); // fill with default values 390 TremoloAtomInfoContainer *atomInfo = &additionalAtomData[atomid]; 393 391 TremoloKey::atomDataKey currentField; 394 392 ConvertTo<double> toDouble; … … 446 444 ASSERT(tok_iter != tokens.end(), "FormatParser< tremolo >::readAtomDataLine() - no value for "+keyName+"!"); 447 445 LOG(4, "INFO: Parsing key " << keyName << " with next token " << *tok_iter); 448 atomIdMap[toInt(*tok_iter)] = newAtom->getId();446 atomIdMap[toInt(*tok_iter)] = atomid; 449 447 tok_iter++; 450 448 break; … … 457 455 } 458 456 readNeighbors(&lineStream, 459 atoi(it->substr(it->find("=") + 1, 1).c_str()), newAtom->getId());457 atoi(it->substr(it->find("=") + 1, 1).c_str()), atomid); 460 458 break; 461 459 default : … … 467 465 } 468 466 } 469 if (newmol != NULL) {470 //LOG(0, "New Atom: " << *newAtom << " with type " << newAtom->getType()->getName());467 LOG(3, "INFO: Parsed atom " << atomid << "."); 468 if (newmol != NULL) 471 469 newmol->AddAtom(newAtom); 472 }473 470 } 474 471 … … 651 648 ++tok_iter) { 652 649 if ((*tok_iter).find("particle_type") != string::npos) { 653 LOG(3, "INFO: found line '" << line<< "' containing keyword 'particle_type'.");650 LOG(3, "INFO: found token '" << *tok_iter << "' containing keyword 'particle_type'."); 654 651 tokenizer token((*tok_iter), equalitysep); 655 652 ASSERT(token.begin() != token.end(), … … 660 657 } 661 658 if ((*tok_iter).find("element_name") != string::npos) { 662 LOG(3, "INFO: found line '" << line<< "' containing keyword 'element_name'.");659 LOG(3, "INFO: found token '" << *tok_iter << "' containing keyword 'element_name'."); 663 660 tokenizer token((*tok_iter), equalitysep); 664 661 ASSERT(token.begin() != token.end(), … … 677 674 } 678 675 } else { 679 ELOG( 1, "INFO: Desired element " << element_type << " is not known." );676 ELOG(3, "Line does not contain both 'particle_type' and 'element_name' as keys." ); 680 677 } 681 678 }
Note:
See TracChangeset
for help on using the changeset viewer.