Changeset 8ffe32 for molecuilder/src/molecule.hpp
- Timestamp:
- Oct 6, 2009, 5:57:01 PM (16 years ago)
- Children:
- 567b7f
- Parents:
- a4644b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/molecule.hpp
ra4644b r8ffe32 134 134 // templates for allowing global manipulation of all vectors 135 135 template <typename res> void ActOnAllVectors( res (Vector::*f)() ); 136 template <typename res> void ActOnAllVectors( res (Vector::*f)() const); 137 template <typename res> void ActOnAllVectors( res (Vector::*f)() ) const; 136 138 template <typename res, typename T> void ActOnAllVectors( res (Vector::*f)(T), T t ); 139 template <typename res, typename T> void ActOnAllVectors( res (Vector::*f)(T) const, T t ); 140 template <typename res, typename T> void ActOnAllVectors( res (Vector::*f)(T), T t ) const; 137 141 template <typename res, typename T, typename U> void ActOnAllVectors( res (Vector::*f)(T, U), T t, U u ); 142 template <typename res, typename T, typename U> void ActOnAllVectors( res (Vector::*f)(T, U) const, T t, U u ); 143 template <typename res, typename T, typename U> void ActOnAllVectors( res (Vector::*f)(T, U), T t, U u ) const; 138 144 template <typename res, typename T, typename U, typename V> void ActOnAllVectors( res (Vector::*f)(T, U, V), T t, U u, V v); 145 template <typename res, typename T, typename U, typename V> void ActOnAllVectors( res (Vector::*f)(T, U, V) const, T t, U u, V v); 146 template <typename res, typename T, typename U, typename V> void ActOnAllVectors( res (Vector::*f)(T, U, V), T t, U u, V v) const; 147 148 // templates for allowing global manipulation of molecule with each atom as single argument 149 template <typename res> void ActWithEachAtom( res (molecule::*f)(atom *) ); 150 template <typename res> void ActWithEachAtom( res (molecule::*f)(atom *) const); 151 template <typename res> void ActWithEachAtom( res (molecule::*f)(atom *) ) const; 152 153 // templates for allowing global copying of molecule with each atom as single argument 154 template <typename res> void ActOnCopyWithEachAtom( res (molecule::*f)(atom *) , molecule *copy); 155 template <typename res> void ActOnCopyWithEachAtom( res (molecule::*f)(atom *) const , molecule *copy); 156 template <typename res> void ActOnCopyWithEachAtom( res (molecule::*f)(atom *) , molecule *copy) const; 139 157 140 158 // templates for allowing global manipulation of all atoms 141 template <typename res> void ActOnAllAtoms( res (molecule::*f)(atom *) );142 159 template <typename res> void ActOnAllAtoms( res (atom::*f)() ); 160 template <typename res> void ActOnAllAtoms( res (atom::*f)() const ); 161 template <typename res> void ActOnAllAtoms( res (atom::*f)() ) const; 143 162 template <typename res, typename T> void ActOnAllAtoms( res (atom::*f)(T), T t ); 163 template <typename res, typename T> void ActOnAllAtoms( res (atom::*f)(T) const, T t ); 164 template <typename res, typename T> void ActOnAllAtoms( res (atom::*f)(T) const, T t ) const; 144 165 template <typename res, typename T, typename U> void ActOnAllAtoms( res (atom::*f)(T, U), T t, U u ); 166 template <typename res, typename T, typename U> void ActOnAllAtoms( res (atom::*f)(T, U) const, T t, U u ); 167 template <typename res, typename T, typename U> void ActOnAllAtoms( res (atom::*f)(T, U), T t, U u ) const; 145 168 template <typename res, typename T, typename U, typename V> void ActOnAllAtoms( res (atom::*f)(T, U, V), T t, U u, V v); 169 template <typename res, typename T, typename U, typename V> void ActOnAllAtoms( res (atom::*f)(T, U, V) const, T t, U u, V v); 170 template <typename res, typename T, typename U, typename V> void ActOnAllAtoms( res (atom::*f)(T, U, V), T t, U u, V v) const; 171 template <typename res, typename T, typename U, typename V, typename W> void ActOnAllAtoms( res (atom::*f)(T, U, V, W), T t, U u, V v, W w); 172 template <typename res, typename T, typename U, typename V, typename W> void ActOnAllAtoms( res (atom::*f)(T, U, V, W) const, T t, U u, V v, W w); 173 template <typename res, typename T, typename U, typename V, typename W> void ActOnAllAtoms( res (atom::*f)(T, U, V, W), T t, U u, V v, W w) const; 174 175 // templates for allowing conditional global copying of molecule with each atom as single argument 176 template <typename res> void ActOnCopyWithEachAtomIfTrue( res (molecule::*f)(atom *) , molecule *copy, bool (atom::*condition) () ); 177 template <typename res, typename T> void ActOnCopyWithEachAtomIfTrue( res (molecule::*f)(atom *) , molecule *copy, bool (atom::*condition) (T), T t ); 178 template <typename res, typename T, typename U> void ActOnCopyWithEachAtomIfTrue( res (molecule::*f)(atom *) , molecule *copy, bool (atom::*condition) (T, U), T t, U u ); 179 template <typename res, typename T, typename U, typename V> void ActOnCopyWithEachAtomIfTrue( res (molecule::*f)(atom *) , molecule *copy, bool (atom::*condition) (T, U, V), T t, U u, V v ); 180 181 // templates for allowing global manipulation of an array with one entry per atom 182 template <typename T> void SetIndexedArrayForEachAtomTo ( T *array, int atom::* index, void (*Setor)(T *, T)); 183 template <typename T> void SetIndexedArrayForEachAtomTo ( T *array, int atom::* index, void (*Setor)(T *, T), T); 184 template <typename T> void SetIndexedArrayForEachAtomTo ( T *array, int element::*index, void (*Setor)(T *, T)); 185 template <typename T> void SetIndexedArrayForEachAtomTo ( T *array, int element::*index, void (*Setor)(T *, T), T); 146 186 147 187 /// remove atoms from molecule. … … 262 302 }; 263 303 264 265 template <typename res> void molecule::ActOnAllVectors( res (Vector::*f)() ) { 266 atom *Walker = start; 267 while (Walker->next != end) { 268 Walker = Walker->next; 269 ((Walker->node)->*f)(); 270 } 271 }; 272 template <typename res, typename T> void molecule::ActOnAllVectors( res (Vector::*f)(T), T t ) 273 { 274 atom *Walker = start; 275 while (Walker->next != end) { 276 Walker = Walker->next; 277 ((Walker->node)->*f)(t); 278 } 279 }; 280 template <typename res, typename T, typename U> void molecule::ActOnAllVectors( res (Vector::*f)(T, U), T t, U u ) 281 { 282 atom *Walker = start; 283 while (Walker->next != end) { 284 Walker = Walker->next; 285 ((Walker->node)->*f)(t, u); 286 } 287 }; 288 template <typename res, typename T, typename U, typename V> void molecule::ActOnAllVectors( res (Vector::*f)(T, U, V), T t, U u, V v) 289 { 290 atom *Walker = start; 291 while (Walker->next != end) { 292 Walker = Walker->next; 293 ((Walker->node)->*f)(t, u, v); 294 } 295 }; 296 297 template <typename res> void molecule::ActOnAllAtoms( res (molecule::*f)(atom *)) { 298 atom *Walker = start; 299 while (Walker->next != end) { 300 Walker = Walker->next; 301 (*f)(Walker); 302 } 303 }; 304 305 template <typename res> void molecule::ActOnAllAtoms( res (atom::*f)()) { 306 atom *Walker = start; 307 while (Walker->next != end) { 308 Walker = Walker->next; 309 (Walker->*f)(); 310 } 311 }; 312 template <typename res, typename T> void molecule::ActOnAllAtoms( res (atom::*f)(T), T t ) 313 { 314 atom *Walker = start; 315 while (Walker->next != end) { 316 Walker = Walker->next; 317 (Walker->*f)(t); 318 } 319 }; 320 template <typename res, typename T, typename U> void molecule::ActOnAllAtoms( res (atom::*f)(T, U), T t, U u ) 321 { 322 atom *Walker = start; 323 while (Walker->next != end) { 324 Walker = Walker->next; 325 (Walker->*f)(t, u); 326 } 327 }; 328 template <typename res, typename T, typename U, typename V> void molecule::ActOnAllAtoms( res (atom::*f)(T, U, V), T t, U u, V v) 329 { 330 atom *Walker = start; 331 while (Walker->next != end) { 332 Walker = Walker->next; 333 (Walker->*f)(t, u, v); 334 } 335 }; 304 #include "molecule_template.hpp" 336 305 337 306 /** A list of \a molecule classes.
Note:
See TracChangeset
for help on using the changeset viewer.