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