# | Line 33 | Line 33 | SimInfo::SimInfo(){ | |
---|---|---|
33 | the_integrator = NULL; | |
34 | setTemp = 0; | |
35 | thermalTime = 0.0; | |
36 | + | currentTime = 0.0; |
37 | rCut = 0.0; | |
38 | ecr = 0.0; | |
39 | est = 0.0; | |
# | Line 527 | Line 528 | void SimInfo::checkCutOffs( void ){ | |
528 | ||
529 | oldEcr = ecr; | |
530 | oldRcut = rCut; | |
531 | + | } |
532 | + | |
533 | + | void SimInfo::addProperty(GenericData* prop){ |
534 | + | |
535 | + | map<string, GenericData*>::iterator result; |
536 | + | result = properties.find(prop->getID()); |
537 | + | |
538 | + | //we can't simply use properties[prop->getID()] = prop, |
539 | + | //it will cause memory leak if we already contain a propery which has the same name of prop |
540 | + | |
541 | + | if(result != properties.end()){ |
542 | + | |
543 | + | delete (*result).second; |
544 | + | (*result).second = prop; |
545 | + | |
546 | + | } |
547 | + | else{ |
548 | + | |
549 | + | properties[prop->getID()] = prop; |
550 | + | |
551 | + | } |
552 | + | |
553 | + | } |
554 | + | |
555 | + | GenericData* SimInfo::getProperty(const string& propName){ |
556 | + | |
557 | + | map<string, GenericData*>::iterator result; |
558 | + | |
559 | + | //string lowerCaseName = (); |
560 | + | |
561 | + | result = properties.find(propName); |
562 | + | |
563 | + | if(result != properties.end()) |
564 | + | return (*result).second; |
565 | + | else |
566 | + | return NULL; |
567 | } | |
568 | + | |
569 | + | vector<GenericData*> SimInfo::getProperties(){ |
570 | + | |
571 | + | vector<GenericData*> result; |
572 | + | map<string, GenericData*>::iterator i; |
573 | + | |
574 | + | for(i = properties.begin(); i != properties.end(); i++) |
575 | + | result.push_back((*i).second); |
576 | + | |
577 | + | return result; |
578 | + | } |
579 | + | |
580 | + |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |