ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new-templateless/OOPSE/libmdtools/SimInfo.cpp
(Generate patch)

Comparing:
trunk/OOPSE/libmdtools/SimInfo.cpp (file contents), Revision 843 by mmeineke, Wed Oct 29 20:41:39 2003 UTC vs.
branches/new-templateless/OOPSE/libmdtools/SimInfo.cpp (file contents), Revision 850 by mmeineke, Mon Nov 3 22:07:17 2003 UTC

# Line 61 | Line 61 | SimInfo::SimInfo(){
61  
62    myConfiguration = new SimState();
63  
64 +  properties = new GenericData();
65 +
66    wrapMeSimInfo( this );
67   }
68  
# Line 68 | Line 70 | SimInfo::~SimInfo(){
70   SimInfo::~SimInfo(){
71  
72    delete myConfiguration;
73 <
72 <  map<string, GenericData*>::iterator i;
73 <  
74 <  for(i = properties.begin(); i != properties.end(); i++)
75 <    delete (*i).second;
76 <    
73 >  delete properties;    
74   }
75  
76   void SimInfo::setBox(double newBox[3]) {
# Line 525 | Line 522 | void SimInfo::setDefaultRcut( double theRcut ){
522    origRcut = theRcut;
523    rCut = theRcut;
524  
525 +  ( rCut > ecr )? rList = rCut + 1.0: rList = ecr + 1.0;
526 +
527    notifyFortranCutOffs( &rCut, &rList, &ecr, &est );
528   }
529  
# Line 539 | Line 538 | void SimInfo::setDefaultEcr( double theEcr ){
538    haveOrigEcr = 1;
539    origEcr = theEcr;
540    
541 +  ( rCut > ecr )? rList = rCut + 1.0: rList = ecr + 1.0;
542 +
543    ecr = theEcr;
544 +
545    notifyFortranCutOffs( &rCut, &rList, &ecr, &est );
546   }
547  
# Line 622 | Line 624 | void SimInfo::checkCutOffs( void ){
624      ( rCut > ecr )? rList = rCut + 1.0: rList = ecr + 1.0;
625      
626      if( cutChanged ){
625      
627        notifyFortranCutOffs( &rCut, &rList, &ecr, &est );
628      }
629      
# Line 639 | Line 640 | void SimInfo::checkCutOffs( void ){
640    
641   }
642  
643 < void SimInfo::addProperty(GenericData* prop){
643 > GenericData* SimInfo::getProperty(char* propName){
644  
645 <  map<string, GenericData*>::iterator result;
645 <  result = properties.find(prop->getID());
646 <  
647 <  //we can't simply use  properties[prop->getID()] = prop,
648 <  //it will cause memory leak if we already contain a propery which has the same name of prop
649 <  
650 <  if(result != properties.end()){
651 <    
652 <    delete (*result).second;
653 <    (*result).second = prop;
654 <      
655 <  }
656 <  else{
657 <
658 <    properties[prop->getID()] = prop;
659 <
660 <  }
661 <    
645 >  return properties->find( propName );
646   }
647  
664 GenericData* SimInfo::getProperty(const string& propName){
665
666  map<string, GenericData*>::iterator result;
667  
668  //string lowerCaseName = ();
669  
670  result = properties.find(propName);
671  
672  if(result != properties.end())
673    return (*result).second;  
674  else  
675    return NULL;  
676 }
677
678 vector<GenericData*> SimInfo::getProperties(){
679
680  vector<GenericData*> result;
681  map<string, GenericData*>::iterator i;
682  
683  for(i = properties.begin(); i != properties.end(); i++)
684    result.push_back((*i).second);
685    
686  return result;
687 }
688
648   double SimInfo::matTrace3(double m[3][3]){
649    double trace;
650    trace = m[0][0] + m[1][1] + m[2][2];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines