Changeset ab4b55 for src


Ignore:
Timestamp:
Mar 5, 2010, 12:53:13 PM (15 years ago)
Author:
Saskia Metzler <metzler@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
7dc102
Parents:
57f5cf
Message:

the XYZ parser

Location:
src
Files:
5 added
7 deleted
2 edited
5 moved

Legend:

Unmodified
Added
Removed
  • src/Makefile.am

    r57f5cf rab4b55  
    1010ACTIONSSOURCE = Actions/Action.cpp Actions/Process.cpp Actions/MethodAction.cpp Actions/ActionSequence.cpp Actions/MakroAction.cpp Actions/ErrorAction.cpp Actions/small_actions.cpp Actions/ManipulateAtomsProcess.cpp Actions/ActionRegistry.cpp
    1111ACTIONSHEADER = Actions/Action.hpp Actions/Process.hpp Actions/Calculation.hpp Actions/Calculation_impl.hpp Actions/MethodAction.hpp Actions/ActionSequence.hpp Actions/MakroAction.hpp Actions/ErrorAction.hpp Actions/small_actions.hpp Actions/ManipulateAtomsProcess.hpp Actions/ActionRegistry.hpp
     12
     13PARSERSOURCE = Parser/ChangeTracker.cpp Parser/FormatParser.cpp Parser/XyzParser.cpp
     14PARSERHEADER = Parser/ChangeTracker.hpp Parser/FormatParser.hpp Parser/XyzParser.hpp
    1215
    1316PATTERNSOURCE = Patterns/Observer.cpp
     
    3235DESCRIPTORHEADER = Descriptors/AtomDescriptor.hpp Descriptors/AtomIdDescriptor.hpp Descriptors/AtomTypeDescriptor.hpp Descriptors/MoleculeDescriptor.hpp
    3336
    34 SOURCE = ${ANALYSISSOURCE} ${ATOMSOURCE} ${PATTERNSOURCE} ${UISOURCE} ${DESCRIPTORSOURCE} ${LEGACYSOURCE} bond.cpp bondgraph.cpp boundary.cpp ChangeTracker.cpp config.cpp element.cpp ellipsoid.cpp errorlogger.cpp FormatParser.cpp graph.cpp helpers.cpp info.cpp leastsquaremin.cpp linkedcell.cpp lists.cpp log.cpp logger.cpp memoryusageobserver.cpp moleculelist.cpp molecule.cpp molecule_dynamics.cpp molecule_fragmentation.cpp molecule_geometry.cpp molecule_graph.cpp molecule_pointcloud.cpp parser.cpp periodentafel.cpp tesselation.cpp tesselationhelpers.cpp vector.cpp verbose.cpp World.cpp WorldIterators.cpp
    35 HEADER = ${ANALYSISHEADER} ${ATOMHEADER} ${PATTERNHEADER} ${UIHEADER} ${DESCRIPTORHEADER} ${LEGACYHEADER} bond.hpp bondgraph.hpp boundary.hpp ChangeTracker.hpp config.hpp defs.hpp element.hpp ellipsoid.hpp errorlogger.hpp FormatParser.hpp graph.hpp helpers.hpp info.hpp leastsquaremin.hpp linkedcell.hpp lists.hpp log.hpp logger.hpp memoryallocator.hpp memoryusageobserver.hpp molecule.hpp molecule_template.hpp parser.hpp periodentafel.hpp stackclass.hpp tesselation.hpp tesselationhelpers.hpp vector.hpp verbose.hpp World.hpp
     37SOURCE = ${ANALYSISSOURCE} ${ATOMSOURCE} ${PARSERSOURCE} ${PATTERNSOURCE} ${UISOURCE} ${DESCRIPTORSOURCE} ${LEGACYSOURCE} bond.cpp bondgraph.cpp boundary.cpp config.cpp element.cpp ellipsoid.cpp errorlogger.cpp graph.cpp helpers.cpp info.cpp leastsquaremin.cpp linkedcell.cpp lists.cpp log.cpp logger.cpp memoryusageobserver.cpp moleculelist.cpp molecule.cpp molecule_dynamics.cpp molecule_fragmentation.cpp molecule_geometry.cpp molecule_graph.cpp molecule_pointcloud.cpp parser.cpp periodentafel.cpp tesselation.cpp tesselationhelpers.cpp vector.cpp verbose.cpp World.cpp WorldIterators.cpp
     38HEADER = ${ANALYSISHEADER} ${ATOMHEADER} ${PARSERHEADER} ${PATTERNHEADER} ${UIHEADER} ${DESCRIPTORHEADER} ${LEGACYHEADER} bond.hpp bondgraph.hpp boundary.hpp config.hpp defs.hpp element.hpp ellipsoid.hpp errorlogger.hpp graph.hpp helpers.hpp info.hpp leastsquaremin.hpp linkedcell.hpp lists.hpp log.hpp logger.hpp memoryallocator.hpp memoryusageobserver.hpp molecule.hpp molecule_template.hpp parser.hpp periodentafel.hpp stackclass.hpp tesselation.hpp tesselationhelpers.hpp vector.hpp verbose.hpp World.hpp
    3639
    3740BOOST_LIB = $(BOOST_LDFLAGS) $(BOOST_MPL_LIB)
  • src/Parser/ChangeTracker.cpp

    r57f5cf rab4b55  
    1010ChangeTracker* ChangeTracker::instance = NULL;
    1111
     12/**
     13 * Constructor. Signs on as an observer for the World.
     14 */
    1215ChangeTracker::ChangeTracker() {
    1316  isConsistent = true;
     
    1518}
    1619
     20/**
     21 * Destructor. Signs off from the World.
     22 */
    1723ChangeTracker::~ChangeTracker() {
    1824  World::get()->signOff(this);
    1925}
    2026
     27/**
     28 * Returns the change tracker instance.
     29 *
     30 * \return this
     31 */
    2132ChangeTracker* ChangeTracker::get() {
    2233  if (instance == NULL) {
     
    2738}
    2839
     40/**
     41 * Destroys the change tracker instance. Be careful, the change tracker is a
     42 * singleton and destruction might lead to a loss of consistency.
     43 */
    2944void ChangeTracker::destroy() {
    3045  delete instance;
     
    3247}
    3348
     49/**
     50 * With this, the World can update the change tracker's state.
     51 */
    3452void ChangeTracker::update(Observable *publisher) {
    3553  isConsistent = false;
    3654}
    3755
     56/**
     57 * Gets whether there are non-saved changes.
     58 *
     59 * \param true if there are any changes, false otherwise
     60 */
    3861bool ChangeTracker::hasChanged() {
    3962  return !isConsistent;
    4063}
    4164
     65/**
     66 * Tells all observers (which are the different parsers) that they are supposed
     67 * to save the current state.
     68 */
    4269void ChangeTracker::saveStatus() {
    4370  if (hasChanged()) {
  • src/Parser/FormatParser.hpp

    r57f5cf rab4b55  
    1313#include "parser.hpp"
    1414
    15 using namespace std;
    16 
     15/**
     16 * General parser which observes the change tracker.
     17 */
    1718class FormatParser : public Observer {
    1819public:
    1920  FormatParser();
    20   ~FormatParser();
    21   virtual void save(char* fileName);
    22   virtual void load(char* fileName);
     21  virtual ~FormatParser();
     22  virtual void save(std::ostream* file)=0;
     23  virtual void load(std::istream* file)=0;
     24  void setOstream(std::ostream* file);
     25  void update(Observable *publisher);
     26  void subjectKilled(Observable *publisher);
    2327
    2428private:
    25   MatrixContainer* readData(char* fileName, int skiplines, int skipcolumns);
    26   virtual int getHeaderSize(char identifier);
     29  std::ostream* saveStream;
    2730};
    2831
  • src/unittests/Makefile.am

    r57f5cf rab4b55  
    3030  CacheableTest \
    3131  DescriptorUnittest \
    32   MatrixUnitTest \
     32  ParserUnitTest \
    3333  manipulateAtomsTest \
    3434  atomsCalculationTest \
     
    6666  CacheableTest.cpp \
    6767  DescriptorUnittest.cpp \
    68   MatrixUnitTest.cpp \
     68  ParserUnitTest.cpp \
    6969  manipulateAtomsTest.cpp \
    7070  atomsCalculationTest.cpp \
     
    146146DescriptorUnittest_LDADD = ${ALLLIBS}
    147147
    148 MatrixUnitTest_SOURCES = UnitTestMain.cpp MatrixUnitTest.cpp MatrixUnitTest.hpp
    149 MatrixUnitTest_LDADD = ${ALLLIBS}
     148ParserUnitTest_SOURCES = UnitTestMain.cpp ParserUnitTest.cpp ParserUnitTest.hpp
     149ParserUnitTest_LDADD = ${ALLLIBS}
    150150
    151151manipulateAtomsTest_SOURCES = UnitTestMain.cpp manipulateAtomsTest.cpp manipulateAtomsTest.hpp
Note: See TracChangeset for help on using the changeset viewer.