Changeset 78b9d9 for molecuilder/src/Descriptors/AtomDescriptor.hpp
- Timestamp:
- Mar 3, 2010, 1:57:41 PM (16 years ago)
- Children:
- 14d898
- Parents:
- dc5413
- File:
-
- 1 edited
-
molecuilder/src/Descriptors/AtomDescriptor.hpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/Descriptors/AtomDescriptor.hpp
rdc5413 r78b9d9 21 21 class AtomDescripter_impl; 22 22 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 */ 23 34 class AtomDescriptor { 24 35 // close coupling to the world to allow access … … 32 43 33 44 public: 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 35 46 36 47 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 */ 37 54 AtomDescriptor(const AtomDescriptor&); 38 55 ~AtomDescriptor(); 39 56 57 /** 58 * Assignment Operator. 59 * 60 * Implemented by setting the pointer to the new Implementation. 61 */ 40 62 AtomDescriptor &operator=(AtomDescriptor &); 41 63 42 64 protected: 65 /** 66 * forward Method to implementation 67 */ 43 68 atom* find(); 69 70 /** 71 * forward Method to implementation 72 */ 44 73 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 */ 45 79 impl_ptr get_impl() const; 46 80 … … 49 83 }; 50 84 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 */ 52 88 AtomDescriptor AllAtoms(); 89 90 /** 91 * produce an Atomdescriptor that at the point of construction contains an implementation that matches no Atoms 92 */ 53 93 AtomDescriptor NoAtoms(); 54 94 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 */ 56 100 AtomDescriptor 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 */ 57 107 AtomDescriptor 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 */ 58 112 AtomDescriptor operator!(const AtomDescriptor &arg); 59 113
Note:
See TracChangeset
for help on using the changeset viewer.
