Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Formula.hpp

    r426f2a rd8a0ec  
    1616
    1717#include "types.hpp"
    18 #include "helpers.hpp"
    1918
    2019class element;
     
    2322{
    2423public:
    25   typedef const element*                                key_type;
     24  typedef element*                                      key_type;
    2625  typedef unsigned int                                  mapped_type;
    2726  typedef std::pair<key_type, mapped_type>              value_type;
     
    6665
    6766  unsigned int getElementCount() const;
    68   bool hasElement(key_type)             const;
     67  bool hasElement(const element*)       const;
    6968  bool hasElement(atomicNumber_t)       const;
    7069  bool hasElement(const std::string&)   const;
    7170
    72   void operator+=(key_type);
     71  void operator+=(const element*);
    7372  void operator+=(atomicNumber_t);
    7473  void operator+=(const std::string&);
    7574
    76   void operator-=(key_type);
     75  void operator-=(const element*);
    7776  void operator-=(atomicNumber_t);
    7877  void operator-=(const std::string&);
    7978
    80   void addElements(key_type,unsigned int);
     79  void addElements(const element*,unsigned int);
    8180  void addElements(atomicNumber_t,unsigned int);
    8281  void addElements(const std::string&,unsigned int);
    8382
    84   void addFormula(const Formula&,unsigned int);
    85 
    86   enumeration<key_type> enumerateElements() const;
    87 
    8883  // only const versions, because someone might try to increment a previously
    8984  // not set element
    90   const unsigned int operator[](key_type) const;
     85  const unsigned int operator[](const element*) const;
    9186  const unsigned int operator[](atomicNumber_t) const;
    9287  const unsigned int operator[](std::string)    const;
     
    10398
    10499private:
    105   void parseFromString(std::string::const_iterator&,std::string::const_iterator&,char) throw(ParseError);
    106   int parseMaybeNumber(std::string::const_iterator &it,std::string::const_iterator &end) throw(ParseError);
    107100  // this contains all counts of elements in the formula
    108101  // the size of the actual structure might be used in comparisons
Note: See TracChangeset for help on using the changeset viewer.