/* * MoleculeListClass.hpp * * Created on: Oct 20, 2011 * Author: heber */ #ifndef MOLECULELISTCLASS_HPP_ #define MOLECULELISTCLASS_HPP_ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "CodePatterns/Observer.hpp" #include "CodePatterns/ObservedIterator.hpp" #include "CodePatterns/Cacheable.hpp" #include "Parser/ParserTypes.hpp" class molecule; class periodentafel; class World; typedef std::list MoleculeList; typedef std::pair MoleculeListTest; /** A list of \a molecule classes. */ class MoleculeListClass : public Observable { public: MoleculeList ListOfMolecules; //!< List of the contained molecules int MaxIndex; MoleculeListClass(World *world); ~MoleculeListClass(); bool AddHydrogenCorrection(std::string &path); bool StoreForcesFile(std::string &path, int *SortIndex); void insert(molecule *mol); void erase(molecule *mol); molecule * ReturnIndex(int index); bool OutputConfigForListOfFragments(std::string &prefix, int *SortIndex, ParserTypes type); int NumberOfActiveMolecules(); void Enumerate(std::ostream *out); void Output(std::ostream *out); int CountAllAtoms() const; // Methods moved here from the menus // TODO: more refactoring needed on these methods void createNewMolecule(periodentafel *periode); void loadFromXYZ(periodentafel *periode); void setMoleculeFilename(); void parseXYZIntoMolecule(); void eraseMolecule(); private: World *world; //!< The world this List belongs to. Needed to avoid deadlocks in the destructor }; #endif /* MOLECULELISTCLASS_HPP_ */