Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Formula.cpp

    r426f2a re5c0a1  
    4747  for(const_iterator iter=end();iter!=begin();){
    4848    --iter;
    49     sstr << (*iter).first->symbol;
     49    sstr << (*iter).first->getSymbol();
    5050    if((*iter).second>1)
    5151      sstr << (*iter).second;
     
    146146
    147147bool Formula::hasElement(const string &shorthand) const{
    148   element * element = World::getInstance().getPeriode()->FindElement(shorthand);
     148  const element * element = World::getInstance().getPeriode()->FindElement(shorthand);
    149149  return hasElement(element);
    150150}
     
    167167
    168168void Formula::operator+=(const string &shorthand){
    169   element * element = World::getInstance().getPeriode()->FindElement(shorthand);
     169  const element * element = World::getInstance().getPeriode()->FindElement(shorthand);
    170170  operator+=(element);
    171171}
     
    198198
    199199void Formula::operator-=(const string &shorthand){
    200   element * element = World::getInstance().getPeriode()->FindElement(shorthand);
     200  const element * element = World::getInstance().getPeriode()->FindElement(shorthand);
    201201  operator-=(element);
    202202}
     
    220220
    221221void Formula::addElements(const string &shorthand,unsigned int count){
    222   element * element = World::getInstance().getPeriode()->FindElement(shorthand);
     222  const element * element = World::getInstance().getPeriode()->FindElement(shorthand);
    223223  addElements(element,count);
    224224}
     
    252252
    253253const unsigned int Formula::operator[](string shorthand) const{
    254   element * element = World::getInstance().getPeriode()->FindElement(shorthand);
     254  const element * element = World::getInstance().getPeriode()->FindElement(shorthand);
    255255  return operator[](element);
    256256}
     
    380380result_type
    381381Formula::_iterator<result_type>::operator*(){
    382   element *element = World::getInstance().getPeriode()->FindElement(pos+1);
     382  const element *element = World::getInstance().getPeriode()->FindElement(pos+1);
    383383  ASSERT(element,"Element with position of iterator not found");
    384384  return make_pair(element,(*set)[pos]);
     
    390390  // no one can keep this value around, so a static is ok to avoid temporaries
    391391  static value_type value=make_pair(reinterpret_cast<element*>(0),0); // no default constructor for std::pair
    392   element *element = World::getInstance().getPeriode()->FindElement(pos+1);
     392  const element *element = World::getInstance().getPeriode()->FindElement(pos+1);
    393393  ASSERT(element,"Element with position of iterator not found");
    394394  value = make_pair(element,(*set)[pos]);
Note: See TracChangeset for help on using the changeset viewer.