Changes in / [adb5cda:401f90]


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/TremoloParser.cpp

    radb5cda r401f90  
    100100FormatParser< tremolo >::~FormatParser()
    101101{
    102   std::cerr << "Clearing usedFields." << std::endl;
     102  LOG(1, "INFO: Clearing usedFields.");
    103103  usedFields.clear();
    104104  additionalAtomData.clear();
     
    118118  // reset atomIdMap, for we now get new serials
    119119  atomIdMap.clear();
    120         std::cerr << "Clearing usedFields." << std::endl;
     120  LOG(1, "INFO: Clearing usedFields.");
    121121  usedFields.clear();
    122122
     
    225225 */
    226226void 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;
    230228
    231229  TremoloKey::atomDataKey currentField;
     
    349347
    350348  lineStream << line.substr(offset);
    351         std::cerr << "Clearing usedFields in parseAtomDataKeysLine." << std::endl;
     349  LOG(1, "INFO: Clearing usedFields in parseAtomDataKeysLine.");
    352350  usedFields.clear();
    353351  while (lineStream.good()) {
     
    388386  stringstream lineStream;
    389387  atom* newAtom = World::getInstance().createAtom();
    390   TremoloAtomInfoContainer *atomInfo = NULL;
    391   additionalAtomData[newAtom->getId()] = TremoloAtomInfoContainer(); // fill with default values
    392   atomInfo = &additionalAtomData[newAtom->getId()];
     388  const atomId_t atomid = newAtom->getId();
     389  additionalAtomData[atomid] = TremoloAtomInfoContainer(); // fill with default values
     390  TremoloAtomInfoContainer *atomInfo = &additionalAtomData[atomid];
    393391  TremoloKey::atomDataKey currentField;
    394392  ConvertTo<double> toDouble;
     
    446444        ASSERT(tok_iter != tokens.end(), "FormatParser< tremolo >::readAtomDataLine() - no value for "+keyName+"!");
    447445        LOG(4, "INFO: Parsing key " << keyName << " with next token " << *tok_iter);
    448         atomIdMap[toInt(*tok_iter)] = newAtom->getId();
     446        atomIdMap[toInt(*tok_iter)] = atomid;
    449447        tok_iter++;
    450448        break;
     
    457455        }
    458456        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);
    460458        break;
    461459      default :
     
    467465    }
    468466  }
    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)
    471469    newmol->AddAtom(newAtom);
    472   }
    473470}
    474471
     
    651648          ++tok_iter) {
    652649        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'.");
    654651          tokenizer token((*tok_iter), equalitysep);
    655652          ASSERT(token.begin() != token.end(),
     
    660657        }
    661658        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'.");
    663660          tokenizer token((*tok_iter), equalitysep);
    664661          ASSERT(token.begin() != token.end(),
     
    677674        }
    678675      } 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." );
    680677      }
    681678    }
Note: See TracChangeset for help on using the changeset viewer.