| 1 | /* | 
|---|
| 2 | * atom_bondedparticleinfo.hpp | 
|---|
| 3 | * | 
|---|
| 4 | *  Created on: Oct 19, 2009 | 
|---|
| 5 | *      Author: heber | 
|---|
| 6 | */ | 
|---|
| 7 |  | 
|---|
| 8 | #ifndef ATOM_BONDEDPARTICLEINFO_HPP_ | 
|---|
| 9 | #define ATOM_BONDEDPARTICLEINFO_HPP_ | 
|---|
| 10 |  | 
|---|
| 11 |  | 
|---|
| 12 | using namespace std; | 
|---|
| 13 |  | 
|---|
| 14 | /*********************************************** includes ***********************************/ | 
|---|
| 15 |  | 
|---|
| 16 | // include config.h | 
|---|
| 17 | #ifdef HAVE_CONFIG_H | 
|---|
| 18 | #include <config.h> | 
|---|
| 19 | #endif | 
|---|
| 20 |  | 
|---|
| 21 | //#include "atom_observable.hpp" | 
|---|
| 22 | #include "Bond/bond.hpp" | 
|---|
| 23 |  | 
|---|
| 24 | #include <list> | 
|---|
| 25 | #include <vector> | 
|---|
| 26 |  | 
|---|
| 27 | /****************************************** forward declarations *****************************/ | 
|---|
| 28 |  | 
|---|
| 29 | class BondedParticle; | 
|---|
| 30 |  | 
|---|
| 31 | typedef std::list<bond::ptr > BondList; | 
|---|
| 32 |  | 
|---|
| 33 | /********************************************** declarations *******************************/ | 
|---|
| 34 |  | 
|---|
| 35 | class BondedParticleInfo // : public virtual AtomObservable // must be virtual(!) | 
|---|
| 36 | { | 
|---|
| 37 | friend class BondedParticle; | 
|---|
| 38 | public: | 
|---|
| 39 |  | 
|---|
| 40 | virtual ~BondedParticleInfo() {} | 
|---|
| 41 |  | 
|---|
| 42 | /** Pushes back another step in all trajectory vectors. | 
|---|
| 43 | * | 
|---|
| 44 | * This allows to extend all trajectories contained in different classes | 
|---|
| 45 | * consistently. This is implemented by the topmost class which calls the | 
|---|
| 46 | * real functions, \sa AppendTrajectoryStep(), by all necessary subclasses. | 
|---|
| 47 | */ | 
|---|
| 48 | virtual void UpdateStep(const unsigned int _step)=0; | 
|---|
| 49 |  | 
|---|
| 50 | /** Pops the last step in all trajectory vectors. | 
|---|
| 51 | * | 
|---|
| 52 | * This allows to decrease all trajectories contained in different classes | 
|---|
| 53 | * by one consistently. This is implemented by the topmost class which calls | 
|---|
| 54 | * the real functions, \sa removeTrajectorySteps(), by all necessary subclasses. | 
|---|
| 55 | * | 
|---|
| 56 | * \param _firststep first step in interval to be removed | 
|---|
| 57 | * \param _laststep last step in interval to be removed | 
|---|
| 58 | */ | 
|---|
| 59 | virtual void removeSteps(const unsigned int _firststep, const unsigned int _laststep)=0; | 
|---|
| 60 |  | 
|---|
| 61 | /** Const accessor to ListOfBonds of WorldTime::CurrentTime. | 
|---|
| 62 | * | 
|---|
| 63 | * @return ListOfBonds[WorldTime::CurrentTime] | 
|---|
| 64 | */ | 
|---|
| 65 | const BondList& getListOfBonds() const; | 
|---|
| 66 |  | 
|---|
| 67 | /** Const Accessor ListOfBonds of any present time step. | 
|---|
| 68 | * | 
|---|
| 69 | * @param _step time step to access | 
|---|
| 70 | * @return ListOfBonds[_step]. | 
|---|
| 71 | */ | 
|---|
| 72 | const BondList& getListOfBondsAtStep(unsigned int _step) const; | 
|---|
| 73 |  | 
|---|
| 74 | /** Const getter for the MaxOrder property at current time step. | 
|---|
| 75 | * | 
|---|
| 76 | * @return MaxOrder[Current world time step]. | 
|---|
| 77 | */ | 
|---|
| 78 | const unsigned char& getMaxOrder() const; | 
|---|
| 79 |  | 
|---|
| 80 | /** Const getter for the MaxOrder property at given \a _step. | 
|---|
| 81 | * | 
|---|
| 82 | * @param _step time step to access | 
|---|
| 83 | * @return MaxOrder[_step]. | 
|---|
| 84 | */ | 
|---|
| 85 | const unsigned char& getMaxOrder(const unsigned int _step) const; | 
|---|
| 86 |  | 
|---|
| 87 | /** Setter for the MaxOrder property at current time step. | 
|---|
| 88 | * | 
|---|
| 89 | * @param _value value to set for MaxOrder at current time step | 
|---|
| 90 | */ | 
|---|
| 91 | void setMaxOrder(const unsigned char _value); | 
|---|
| 92 |  | 
|---|
| 93 | /**Setter for the MaxOrder property at given \a _step. | 
|---|
| 94 | * | 
|---|
| 95 | * @param _step time step to access | 
|---|
| 96 | * @param _value value to set for MaxOrder at the desired time step | 
|---|
| 97 | * @return MaxOrder[_step]. | 
|---|
| 98 | */ | 
|---|
| 99 | void setMaxOrder(const unsigned int _step, const unsigned char _value); | 
|---|
| 100 |  | 
|---|
| 101 | /** Const getter for the AdaptiveOrder property at current time step. | 
|---|
| 102 | * | 
|---|
| 103 | * @return AdaptiveOrder[Current world time step]. | 
|---|
| 104 | */ | 
|---|
| 105 | const unsigned char& getAdaptiveOrder() const; | 
|---|
| 106 |  | 
|---|
| 107 | /** Const getter for the AdaptiveOrder property at given \a _step. | 
|---|
| 108 | * | 
|---|
| 109 | * @param _step time step to access | 
|---|
| 110 | * @return AdaptiveOrder[_step]. | 
|---|
| 111 | */ | 
|---|
| 112 | const unsigned char& getAdaptiveOrder(const unsigned int _step) const; | 
|---|
| 113 |  | 
|---|
| 114 | /** Setter for the AdaptiveOrder property at current time step. | 
|---|
| 115 | * | 
|---|
| 116 | * @param _value value to set for AdaptiveOrder at current time step | 
|---|
| 117 | */ | 
|---|
| 118 | void setAdaptiveOrder(const unsigned char _value); | 
|---|
| 119 |  | 
|---|
| 120 | /** Setter for the AdaptiveOrder property at given \a _step. | 
|---|
| 121 | * | 
|---|
| 122 | * @param _step time step to access | 
|---|
| 123 | * @param _value value to set for AdaptiveOrder at the desired time step | 
|---|
| 124 | * @return AdaptiveOrder[_step]. | 
|---|
| 125 | */ | 
|---|
| 126 | void setAdaptiveOrder(const unsigned int _step, const unsigned char _value); | 
|---|
| 127 |  | 
|---|
| 128 | protected: | 
|---|
| 129 | /** Function used by this and inheriting classes to extend the ListOfBonds | 
|---|
| 130 | * vector. | 
|---|
| 131 | */ | 
|---|
| 132 | void AppendTrajectoryStep(const unsigned int _step); | 
|---|
| 133 |  | 
|---|
| 134 | /** Function used by this and inheriting classes to reduce the ListOfBonds | 
|---|
| 135 | * vector by one. | 
|---|
| 136 | * | 
|---|
| 137 | * \param _firststep first step in interval to be removed | 
|---|
| 138 | * \param _laststep last step in interval to be removed | 
|---|
| 139 | */ | 
|---|
| 140 | void removeTrajectorySteps(const unsigned int _firststep, const unsigned int _laststep); | 
|---|
| 141 |  | 
|---|
| 142 | typedef std::map<unsigned int, BondList> BondTrajectory_t; | 
|---|
| 143 | BondTrajectory_t ListOfBonds; //!< list of all bonds | 
|---|
| 144 | static BondList emptyList;  //!< empty list to return when step is not present | 
|---|
| 145 |  | 
|---|
| 146 | typedef std::map<unsigned int, unsigned char> OrderTrajectory_t; | 
|---|
| 147 | OrderTrajectory_t AdaptiveOrder;  //!< current present bond order at site (0 means "not set") | 
|---|
| 148 | OrderTrajectory_t MaxOrder;  //!< desired maximum order of this atom (0 means "not set") | 
|---|
| 149 | }; | 
|---|
| 150 |  | 
|---|
| 151 |  | 
|---|
| 152 | #endif /* ATOM_BONDEDPARTICLEINFO_HPP_ */ | 
|---|