Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Formula.hpp

    rd8a0ec r426f2a  
    1616
    1717#include "types.hpp"
     18#include "helpers.hpp"
    1819
    1920class element;
     
    2223{
    2324public:
    24   typedef element*                                      key_type;
     25  typedef const element*                                key_type;
    2526  typedef unsigned int                                  mapped_type;
    2627  typedef std::pair<key_type, mapped_type>              value_type;
     
    6566
    6667  unsigned int getElementCount() const;
    67   bool hasElement(const element*)       const;
     68  bool hasElement(key_type)             const;
    6869  bool hasElement(atomicNumber_t)       const;
    6970  bool hasElement(const std::string&)   const;
    7071
    71   void operator+=(const element*);
     72  void operator+=(key_type);
    7273  void operator+=(atomicNumber_t);
    7374  void operator+=(const std::string&);
    7475
    75   void operator-=(const element*);
     76  void operator-=(key_type);
    7677  void operator-=(atomicNumber_t);
    7778  void operator-=(const std::string&);
    7879
    79   void addElements(const element*,unsigned int);
     80  void addElements(key_type,unsigned int);
    8081  void addElements(atomicNumber_t,unsigned int);
    8182  void addElements(const std::string&,unsigned int);
    8283
     84  void addFormula(const Formula&,unsigned int);
     85
     86  enumeration<key_type> enumerateElements() const;
     87
    8388  // only const versions, because someone might try to increment a previously
    8489  // not set element
    85   const unsigned int operator[](const element*) const;
     90  const unsigned int operator[](key_type) const;
    8691  const unsigned int operator[](atomicNumber_t) const;
    8792  const unsigned int operator[](std::string)    const;
     
    98103
    99104private:
     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);
    100107  // this contains all counts of elements in the formula
    101108  // the size of the actual structure might be used in comparisons
Note: See TracChangeset for help on using the changeset viewer.