Changeset dbb474


Ignore:
Timestamp:
Mar 3, 2010, 1:57:41 PM (15 years ago)
Author:
Tillmann Crueger <crueger@…>
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:
1c51c8
Parents:
a1510d
Message:

Improved Doxygen documentation

Location:
src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/Calculation.hpp

    ra1510d rdbb474  
    1111#include "Actions/Process.hpp"
    1212
     13/**
     14 * A calculation is a Process that has some kind of result.
     15 *
     16 * This class can be used in the same way as any other Action or Process, but has some special methods
     17 * for inspecting the result of the calculation.
     18 */
    1319template<typename T>
    1420class Calculation : public Process
     
    1824  virtual ~Calculation();
    1925
     26  /**
     27   * Reimplemented call method for Action Base class.
     28   * Resets the result and then redoes the calculation. Can be used to retrigger calculations
     29   * from menu Items or other places.
     30   */
    2031  virtual void call();
    2132  virtual void undo();
    2233  virtual bool canUndo();
    2334
     35  /**
     36   * Does the actual calculation and returns the result.
     37   * When the calculation has been done before it is not redone, but the previous cached result is returned.
     38   * Call reset to delete the cached value.
     39   */
    2440  virtual T operator()();
     41
     42  /**
     43   * Check if a cached result is available.
     44   */
    2545  virtual bool hasResult();
     46
     47  /**
     48   * Get the cached result.
     49   * Fails if there is no cached result.
     50   */
    2651  virtual T getResult();
     52
     53  /**
     54   * Delete a previously calculated result from the cache.
     55   */
    2756  virtual void reset();
    2857
    2958protected:
    3059  T* result;
     60
     61  /**
     62   * Pure virtual method for implementation of the actual calculation procedure.
     63   */
    3164  virtual T* doCalc()=0;
    3265private:
  • src/Actions/Process.cpp

    ra1510d rdbb474  
    7373  {
    7474    OBSERVE;
    75     active = true;
    7675    currStep=0;
    7776  }
    7877  starts = false;
     78  active = true;
    7979}
    8080
     
    8585
    8686void Process::stop(){
     87  active=false;
    8788  stops = true;
    8889  {
    8990    OBSERVE;
    9091    currStep=0;
    91     active=false;
    9292  }
    9393  {
  • src/Actions/Process.hpp

    ra1510d rdbb474  
    1919#include "Actions/Action.hpp"
    2020
     21/**
     22 * A Process is an Action that might take some time and therefore has special
     23 * methods to allow communication with progress indicators. Indicators
     24 * can sign on at a global place and will be notified when any process is doing
     25 * a calculation.
     26 *
     27 * A Process has four states:
     28 *  - starting: It is in the process of setting itself up, and wants everybody to know that it will start
     29 *              the calculation soon. Indicators should set up anything they need for displaying the progress
     30 *              when they are notified by a process in this state.
     31 *  - active:   The process is currently doing it's thing and wants any indicator to know it's status, i.e.
     32 *              the percentage done.
     33 *  - stopping: The process has fullfilled it's purpose and is shutting down. Indicators recieving this status
     34 *              should also use it to shut down their indication mechanism and delete any objects allocated for
     35 *              this Process
     36 *  - inactive: This Process is currently sleeping. If a Process is sending out any signals in this state, there
     37 *              is something seriously wrong.
     38 */
    2139class Process : public Action, public Observable
    2240{
  • src/Descriptors/AtomDescriptor.hpp

    ra1510d rdbb474  
    2121class AtomDescripter_impl;
    2222
     23/**
     24 * An AtomDescriptor describes a Set of Atoms from the World. Can be used for any method that needs to work on
     25 * a specific set of Atoms.
     26 *
     27 * This Class is implemented using the PIMPL-Idion, i.e. this class only contains an abstract structure
     28 * that forwards any request to a wrapped pointer-to-implementation. This way operators and calculations
     29 * on Descriptors are possible.
     30 *
     31 * Concrete Implementation Objects can be shared between multiple Wrappers, so make sure that
     32 * any Implementation remainst constant during lifetime.
     33 */
    2334class AtomDescriptor {
    2435  // close coupling to the world to allow access
     
    3243
    3344public:
    34   typedef boost::shared_ptr<AtomDescriptor_impl> impl_ptr;
     45  typedef boost::shared_ptr<AtomDescriptor_impl> impl_ptr; //!< Allow easy changes of the pointer-to-implementation type
    3546
    3647  AtomDescriptor(impl_ptr);
     48
     49  /**
     50   * Copy constructor.
     51   * Takes the Implementation from the copied object and sets it's own pointer to link there.
     52   * This way the actuall implementation object is shared between copy and original
     53   */
    3754  AtomDescriptor(const AtomDescriptor&);
    3855  ~AtomDescriptor();
    3956
     57  /**
     58   * Assignment Operator.
     59   *
     60   * Implemented by setting the pointer to the new Implementation.
     61   */
    4062  AtomDescriptor &operator=(AtomDescriptor &);
    4163
    4264protected:
     65  /**
     66   * forward Method to implementation
     67   */
    4368  atom* find();
     69
     70  /**
     71   * forward Method to implementation
     72   */
    4473  std::vector<atom*> findAll();
     74
     75  /**
     76   * Return the implementation this Wrapper currently points to.
     77   * Used for copying, assignment and in Iterators over subsets of the World.
     78   */
    4579  impl_ptr get_impl() const;
    4680
     
    4983};
    5084
    51 // Functions to construct actual descriptors
     85/**
     86 * produce an Atomdescriptor that at the point of construction contains an implementation that matches all Atoms
     87 */
    5288AtomDescriptor AllAtoms();
     89
     90/**
     91 * produce an Atomdescriptor that at the point of construction contains an implementation that matches no Atoms
     92 */
    5393AtomDescriptor NoAtoms();
    5494
    55 // no true short circuit, but the test of the second descriptor wont be done
     95/**
     96 * Set Intersection for two Atomdescriptors. The resulting Atomdescriptor will only match an Atom if both
     97 * given Atomdescriptors also match. Uses short circuit inside, so the second predicate wont be called
     98 * when the first one failed.
     99 */
    56100AtomDescriptor operator&&(const AtomDescriptor &lhs, const AtomDescriptor &rhs);
     101
     102/**
     103 * Set Union for two AtomDescriptors. The resulting AtomDescriptor will match an Atom if at least one of
     104 * the two given AtomDescriptors does match. Used short circuit inside, so the second predicate wont
     105 * be called when the first one failed.
     106 */
    57107AtomDescriptor operator||(const AtomDescriptor &lhs, const AtomDescriptor &rhs);
     108
     109/**
     110 * Set inversion for an AtomDescriptor. Matches an Atom if the given AtomDescriptor did not match.
     111 */
    58112AtomDescriptor operator!(const AtomDescriptor &arg);
    59113
  • src/Descriptors/AtomDescriptor_impl.hpp

    ra1510d rdbb474  
    55
    66/************************ Declarations of implementation Objects ************************/
     7
     8/**
     9 * This class implements a general Base class for AtomDescriptors using the PIMPL-Idiom
     10 *
     11 * The predicate for this class is empty and should be implemented by derived classes.
     12 * By the predicate it is described which atoms should be picked for a given descriptor.
     13 */
    714
    815class AtomDescriptor_impl
     
    1421  virtual ~AtomDescriptor_impl();
    1522
     23  /**
     24   * Implement this abstract Method to make a concrete AtomDescriptor pick certain Atoms
     25   */
    1626  virtual bool predicate(std::pair<atomId_t,atom*>)=0;
    1727
    1828protected:
     29
     30  /**
     31   * This method is called when the Descriptor is used to find the first matching
     32   * Atom. Walks through all Atoms and stops on the first match. Can be implemented
     33   * when the searched Atom can be found in a more efficient way. Calculated
     34   * Atomdescriptors will always use this method, so no improvement there.
     35   */
    1936  virtual atom* find();
     37
     38  /**
     39   * This method is called when the Descriptor is used to find all matching Atoms.
     40   * Walks through all Atoms and tests the predicate on each one. A vector of all
     41   * matching Atoms is returned.
     42   */
    2043  virtual std::vector<atom*> findAll();
     44
     45  /**
     46   * This method is used internally to query the Set of Atoms from the world.
     47   * By using this method derived classes can also access the Internal World Datastructre.
     48   * Implemented in full in the Base Descriptor Implementation, so only this one method
     49   * needs to be friend with the World class.
     50   */
    2151  World::AtomSet& getAtoms();
    2252};
     
    2454/************************** Universe and Emptyset *****************/
    2555
     56/**
     57 * A simple AtomDescriptor that will always match all Atoms present in the World.
     58 */
    2659class AtomAllDescriptor_impl : public AtomDescriptor_impl {
    2760public:
    2861  AtomAllDescriptor_impl();
    2962  virtual ~AtomAllDescriptor_impl();
     63
     64  /**
     65   * Always returns true for any Atom
     66   */
    3067  virtual bool predicate(std::pair<atomId_t,atom*>);
    3168};
    3269
     70
     71/**
     72 * An AtomDescriptor that never matches any Atom in the World.
     73 */
    3374class AtomNoneDescriptor_impl : public AtomDescriptor_impl {
    3475public:
    3576  AtomNoneDescriptor_impl();
    3677  virtual ~AtomNoneDescriptor_impl();
     78
     79  /**
     80   * Always returns false for any Atom
     81   */
    3782  virtual bool predicate(std::pair<atomId_t,atom*>);
    3883};
     
    4085/************************** Operator stuff ************************/
    4186
     87/**
     88 * Intersection of two AtomDescriptors
     89 */
    4290class AtomAndDescriptor_impl : public AtomDescriptor_impl
    4391{
     
    4593  AtomAndDescriptor_impl(AtomDescriptor::impl_ptr _lhs, AtomDescriptor::impl_ptr _rhs);
    4694  ~AtomAndDescriptor_impl();
     95
     96  /**
     97   * This predicate uses the predicate from the first && the predicate from the
     98   * second Descriptor to decide if an Atom should be selected.
     99   */
    47100  virtual bool predicate(std::pair<atomId_t,atom*>);
    48101
     
    52105};
    53106
     107/**
     108 * Union of two AtomDescriptors
     109 */
    54110class AtomOrDescriptor_impl : public AtomDescriptor_impl
    55111{
     
    57113  AtomOrDescriptor_impl(AtomDescriptor::impl_ptr _lhs, AtomDescriptor::impl_ptr _rhs);
    58114  virtual ~AtomOrDescriptor_impl();
     115
     116  /**
     117   * This predicate uses the predicate form the first || the predicate from the
     118   * second Descriptor to decide if an Atom should be selected.
     119   */
    59120  virtual bool predicate(std::pair<atomId_t,atom*>);
    60121
     
    64125};
    65126
     127/**
     128 * Set Inversion of a Descriptor
     129 */
    66130class AtomNotDescriptor_impl : public AtomDescriptor_impl
    67131{
     
    70134  virtual ~AtomNotDescriptor_impl();
    71135
     136  /**
     137   * Opposite of the given descriptor predicate.
     138   */
    72139  virtual bool predicate(std::pair<atomId_t,atom*>);
    73140
  • src/Patterns/Observer.hpp

    ra1510d rdbb474  
    3030class Observable;
    3131
     32/**
     33 * An Observer is notified by all Observed objects, when anything changes.
     34 *
     35 * If a simple change is done to an Object the Obervable will call the update() method
     36 * of all signed on observers, passing itself as a parameter for identification. The
     37 * Observers should then react to the changes and update themselves accordingly.
     38 *
     39 * If an observed Object is destroyed it will call the subjectKilled() method
     40 * of all signed on Observers, again passing itself as a parameter for identification.
     41 * The Observers should handle the destruction of an observed Object gracefully, i.e.
     42 * set themselves inactive, display something else, etc. There is no need
     43 * to sign of from the dying object, since this will be handled by the Observable destructor.
     44 */
    3245class Observer
    3346{
     
    3851
    3952protected:
     53  /**
     54   * This method is called upon changes of the Observable
     55   */
    4056  virtual void update(Observable *publisher)=0;
     57
     58  /**
     59   * This method is called when the observed object is destroyed.
     60   */
    4161  virtual void subjectKilled(Observable *publisher)=0;
    4262};
    4363
     64/**
     65 * An Observable implements all neccessary method for being observed.
     66 *
     67 * That is, it provides methods for signing on and of from an
     68 * Observable that can be used by any observer. The actual
     69 * observer-mechanism is handled at a central static place
     70 * to avoid memory issues when many observable are around but only few
     71 * are actually observed.
     72 */
    4473class Observable : public Observer {
    4574public:
     
    4776  virtual ~Observable();
    4877
     78  /**
     79   * Sign an Observer on to this Observable. The Observer will be notified
     80   * whenever something inside the Observable changes. The Observer can
     81   * assign itself a priority for the changes in the range of -20:+20.
     82   * The Observer with lower priority will be called before the others,
     83   * same as with Unix nice-levels. This can be used when an Object
     84   * contains other objects that observe it (derived values), and these objects have
     85   * to recalculate their states before the changes should be propageted to the
     86   * UI. A default priority of 0 should be fine in most cases, since there is
     87   * ussually no need to order the update sequence.
     88   */
    4989  virtual void signOn(Observer *target, int priority=0);
     90
     91  /**
     92   * Sign of a previously signed on Observer. After this no more
     93   * updates will be recieved from that observer.
     94   */
    5095  virtual void signOff(Observer *target);
    5196
     
    76121  // Structure for RAII-Style notification
    77122protected:
     123  /**
     124   * This structure implements the Observer-mechanism RAII-Idiom.
     125   * It triggers certain functions on creation and destruction so that
     126   * Observer mechanisms can be linked to scope block.
     127   */
    78128  class _Observable_protector {
    79129  public:
  • src/UIElements/MainWindow.hpp

    ra1510d rdbb474  
    2525};
    2626
     27/**
     28 * The type of menuPopulators
     29 */
    2730typedef void (*MenuMaker)(Menu*,MoleculeListClass*, config*, periodentafel*);
    2831
     32/**
     33 * This contains all Functions that are used to create the menus.
     34 * Needs a specific funtion for each menu. All populators will be called
     35 * by the UIFactory upon creation of the main menu. Thus the actuall construction
     36 * of the Menus can be kept independent of the concrete type of UI that is being
     37 * built.
     38 */
    2939struct menuPopulaters{
    3040  MenuMaker MakeEditMoleculesMenu;
  • src/UIElements/UIFactory.hpp

    ra1510d rdbb474  
    1717
    1818struct menuPopulaters;
    19 
     19/**
     20 * Abstract Factory to create any kind of User interface object needed by the programm.
     21 *
     22 * The factory can be created and has to be set to a certain type upon creation. It will then
     23 * only create UIelements of that certain type, so that all UIElements match. This way different
     24 * UIs can be handled in a concise abstract way.
     25 */
    2026class UIFactory
    2127{
     
    2531  virtual ~UIFactory();
    2632
    27   // methods for creating UIElements
     33  /**
     34   * Produce some kind of main window, of whichever type was chosen when the factory was created
     35   */
    2836  virtual MainWindow* makeMainWindow(menuPopulaters,MoleculeListClass *, config *, periodentafel *, char *)=0;
     37
     38  /**
     39   * Produce a User Interaction Dialog, that can query values from the User.
     40   * Again the type is determined upon factory creation.
     41   */
    2942  virtual Dialog* makeDialog()=0;
    3043
     
    3750
    3851public:
     52  /**
     53   * create a Factory of a certain type. From that moment on only those UIElements can be produced by the factory
     54   */
    3955  static void makeUserInterface(InterfaceTypes type);
     56
     57  /**
     58   * get the previously created factory
     59   */
    4060  static UIFactory* get();
     61
     62  /**
     63   * Destroy the created factory.
     64   *
     65   * Make sure that all UIElements that were created by the factory are destroyed before calling this method.
     66   */
    4167  static void purgeInstance();
    4268};
Note: See TracChangeset for help on using the changeset viewer.