#include <bond.h>
Inheritance diagram for Bond:
Constructors and Destructors | |
Bond () throw () | |
Default constructor. | |
Bond (const Bond &bond, bool deep=true) throw () | |
Copy constructor. | |
Bond (const String &name, Atom &first, Atom &second, Order order=BALL_BOND_DEFAULT_ORDER, Type type=BALL_BOND_DEFAULT_TYPE) throw (Exception::TooManyBonds) | |
Detailed constructor. | |
virtual | ~Bond () throw () |
Destructor. | |
virtual void | clear () throw () |
Disconnect and reset to default state. | |
virtual void | destroy () throw () |
Explicit destructor. | |
Bond * | createBond (Bond &bond, Atom &first, Atom &second) throw (Exception::TooManyBonds) |
Create a bond. | |
Public Types | |
Type definitions | |
typedef short | Order |
Bond type. | |
typedef short | Type |
Enumerations | |
enum | BondOrder { ORDER__UNKNOWN = 0, ORDER__SINGLE = 1, ORDER__DOUBLE = 2, ORDER__TRIPLE = 3, ORDER__QUADRUPLE = 4, ORDER__AROMATIC = 5, ORDER__ANY = 6, NUMBER_OF_BOND_ORDERS } |
Predefined constants for the bond order. More... | |
enum | BondType { TYPE__UNKNOWN = 0, TYPE__COVALENT = 1, TYPE__HYDROGEN = 2, TYPE__DISULPHIDE_BRIDGE = 3, TYPE__SALT_BRIDGE = 4, TYPE__PEPTIDE = 5, NUMBER_OF_BOND_TYPES } |
Predefined constants for the bond type. More... | |
enum | Property { NUMBER_OF_PROPERTIES = 0 } |
Predefined properties. More... | |
Public Member Functions | |
Persistence | |
void | persistentWrite (PersistenceManager &pm, const char *name=0) const throw (Exception::GeneralException) |
Write a bond to a persistent stream. | |
void | persistentRead (PersistenceManager &pm) throw (Exception::GeneralException) |
Read a bond from a persistent stream. | |
void | finalize () throw (Exception::GeneralException) |
Finalize the deserialization. | |
Predicates | |
bool | operator== (const Bond &bond) const throw () |
Equality operator. Two bonds are equal, if they are identical instances. | |
bool | operator!= (const Bond &bond) const throw () |
Inequality operator. Two bonds are not equal, if they are different instances. | |
Assignment methods | |
Bond & | operator= (const Bond &bond) throw () |
Assignment operator. | |
void | swap (Bond &bond) throw () |
Swap the contents of two bonds. | |
Accessors | |
void | setFirstAtom (Atom *atom) throw () |
Set the first atom. | |
void | setSecondAtom (Atom *atom) throw () |
Set the second atom. | |
const Atom * | getFirstAtom () const throw () |
Return a pointer to the first atom. | |
const Atom * | getSecondAtom () const throw () |
Return a pointer to the second atom. | |
Atom * | getPartner (const Atom &atom) const throw () |
Return the partner atom of an atom. | |
void | setName (const String &name) throw () |
Assign the atom name. | |
const String & | getName () const throw () |
Return the atom name. | |
void | setOrder (Order bond_order) throw () |
Assign the bond order. | |
Order | getOrder () const throw () |
Return the bond order. | |
void | setType (Type bond_type) throw () |
Set the bond type. | |
Type | getType () const throw () |
Return the bond type. | |
float | getLength () const throw (NotBound) |
Return the bond length. | |
const Atom * | getBoundAtom (const Atom &atom) const throw () |
Return the partner of the atom in this bond. | |
Predicates | |
bool | isBondOf (const Atom &atom) const throw () |
Determine whether the bond belongs to an atom. | |
bool | isBound () const throw () |
Determine whether this bond contains any atom. | |
bool | isInterBond () const throw () |
Determine whether the bond connects two fragments. | |
bool | isInterBondOf (const AtomContainer &atom_container) const throw () |
Request for the intermolecular bonding of this bond within {atom_container}. | |
bool | isIntraBond () const throw () |
Request for the intramolecular bonding of this bond. | |
bool | isIntraBondOf (const AtomContainer &atom_container) const throw () |
Request for the intramolecular bonding of this bond within {atom_container}. | |
Debugging and diagnostics | |
virtual bool | isValid () const throw () |
Internal state and consistency self-validation. | |
virtual void | dump (std::ostream &s=std::cout, Size depth=0) const throw () |
Internal state dump. | |
Protected Attributes | |
Atributes | |
Atom * | first_ |
Atom * | second_ |
String | name_ |
Order | bond_order_ |
Type | bond_type_ |
Friends | |
class | Atom |
An instance of Bond represents a bond between two atoms. There can be only one bond between two atoms (double, triple, etc. bonds are represented using just one bond and an appropriate value for the bond order attribute, see setBondOrder ).
Bond equality is defined as bond identity. A linear ordering of bonds is defined as the linear order of the Object::Handle s.
|
Bond type.
|
|
Predefined constants for the bond order.
|
|
Predefined constants for the bond type. Those are just defined for convenience but they are not used right now. |
|
Predefined properties. Enumeration of all properties that are used by Bond. |
|
Default constructor. The state of this bond is:
|
|
Copy constructor. Calls Bond::createBond . The state of this bond is initialized to the state of bond.
|
|
Detailed constructor. Calls createBond to create a new bond between the two atoms
|
|
Destructor. If the bond is connecting two atoms, they are disconnected. |
|
Disconnect and reset to default state. Reset the bond attributes to their default values. The state of this bond is:
Reimplemented from Composite. |
|
Create a bond.
Connect the two atoms
|
|
Explicit destructor. Destroy this bond explicitly without releasing its heap memory thus this bond may exist further. Calls Bond::clear . Set the state of this bond to the default values. Note: Destroy is equivalent to Bond::clear .
Reimplemented from Composite. |
|
Internal state dump. Dump the current internal state of this bond to the output ostream s with dumping depth depth .
Reimplemented from Composite. |
|
Finalize the deserialization.
Bond might have to swap Reimplemented from PersistentObject. |
|
Return the partner of the atom in this bond.
|
|
Return the bond length.
|
|
Return the partner atom of an atom.
If the given
|
|
Determine whether the bond belongs to an atom. Calls Atom::hasBond .
|
|
Determine whether this bond contains any atom.
|
|
Determine whether the bond connects two fragments. If both atoms have no roots, the result is false. Calls Composite::getRoot .
|
|
Request for the intermolecular bonding of this bond within {atom_container}. Query, if this bond connects a atom within {atom_container} instance with an atom outside. Calls Composite::isDescendantOf .
|
|
Request for the intramolecular bonding of this bond. Query, if this bond connects its two atoms within a common parent Composite instance. If both atoms have no roots, the result is true. Calls Composite::getRoot .
|
|
Request for the intramolecular bonding of this bond within {atom_container}. Query, if this bond connects its two atoms within the common parent {atom_container} instance. Calls Composite::isDescendantOf .
|
|
Internal state and consistency self-validation.
Reimplemented from Composite. |
|
Assignment operator. Assign a deep copy (on the level of Composite ). Note: The use of this method is not recommended because it may result in inconcistencies of the whole system. This is for internal use only.
|
|
Read a bond from a persistent stream.
Reimplemented from Composite. |
|
Write a bond to a persistent stream.
Reimplemented from Composite. |
|
Set the first atom. This method does not ensure the correct order of atoms (see Bond ), so its use is recommended for internal purposes only. |
|
Set the second atom. This method does not ensure the correct order of atoms (see Bond ), so its use is recommended for internal purposes only. |
|
Swap the contents of two bonds.
|