Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

Molecule Class Reference
[Molecular Datastructures]

Molecule class. More...

#include <molecule.h>

Inheritance diagram for Molecule:

AtomContainer Composite PropertyManager PersistentObject Selectable Object AutoDeletable NucleicAcid Protein List of all members.

Public Types

Enums
enum  Property { IS_SOLVENT = AtomContainer::NUMBER_OF_PROPERTIES, NUMBER_OF_PROPERTIES }
 Properties.

Public Member Functions

bool operator== (const Molecule &molecule) const throw ()
 Equality operator.
bool operator!= (const Molecule &molecule) const throw ()
 Inequality operator.
Constructors and Destructors
 Molecule () throw ()
 Default constructor.
 Molecule (const Molecule &molecule, bool deep=true) throw ()
 Copy constructor.
 Molecule (const String &name) throw ()
 Detailled constructor.
virtual ~Molecule () throw ()
 Destructor.
Persistence
void persistentWrite (PersistenceManager &pm, const char *name=0) const throw (Exception::GeneralException)
 Writes a Molecule object to a persistent stream.
void persistentRead (PersistenceManager &pm) throw (Exception::GeneralException)
 Reads a Molecule object from a persistent stream.
Assignment
void set (const Molecule &molecule, bool deep=true) throw ()
 Assign from another Molecule.
Moleculeoperator= (const Molecule &molecule) throw ()
 Assignment operator.
void get (Molecule &molecule, bool deep=true) const throw ()
 Assign to another Molecule.
void swap (Molecule &molecule) throw ()
 Swap the contents of two molecules.
Accessors
SystemgetSystem () throw ()
 Access the parent System.
const SystemgetSystem () const throw ()
 Get a const pointer to the parent System.
void prepend (Atom &atom) throw ()
 Insert an atom as the first child.
void append (Atom &atom) throw ()
 Insert an atom as the last child.
void insert (Atom &atom) throw ()
 Insert an atom as the last child.
void insertBefore (Atom &atom, Composite &before) throw ()
 Insert an atom before a Composite object.
void insertAfter (Atom &atom, Composite &after) throw ()
 Insert an atom after a Composite object.
bool remove (Atom &atom) throw ()
 Remove an atom.
void prepend (AtomContainer &atom_container) throw ()
 Insert an AtomContainer as the first child.
void append (AtomContainer &atom_container) throw ()
 Append an AtomContainer as the last child.
void insert (AtomContainer &atom_container) throw ()
 Insert an AtomContainer as the last child.
void insertBefore (AtomContainer &atom_container, Composite &before) throw ()
 Insert an AtomContainer before a given Composite object.
void insertAfter (AtomContainer &atom_container, Composite &after) throw ()
 Insert an AtomContainer after a given Composite object.
void spliceBefore (AtomContainer &atom_container) throw ()
 Cut all children of atom_container and prepend them before the children of this molecule.
void spliceAfter (AtomContainer &atom_container) throw ()
 Cut all children of atom_container and append them after the children of this molecule.
void splice (AtomContainer &atom_container) throw ()
 Move the children of atom_container into this molecule.
bool remove (AtomContainer &atom_container) throw ()
 Remove an AtomContainer.
Debugging and Diagnostics
virtual void dump (std::ostream &s=std::cout, Size depth=0) const throw ()
 Internal state dump.

Protected Member Functions

MoleculegetMolecule () throw ()
const MoleculegetMolecule () const throw ()
AtomContainergetSuperAtomContainer () throw ()
 Get a mutable pointer to the parent AtomContainer.
const AtomContainergetSuperAtomContainer () const throw ()
 Get a constant pointer to the parent AtomContainer.
void prepend (Molecule &molecule) throw ()
void append (Molecule &molecule) throw ()
void insert (Molecule &molecule) throw ()
void insertBefore (Molecule &molecule, Composite &composite) throw ()
void insertAfter (Molecule &molecule, Composite &composite) throw ()
bool remove (Molecule &molecule) throw ()
bool isSubAtomContainerOf (const AtomContainer &atom_container) const throw ()
 Test if an AtomContainer is a child.

Detailed Description

Molecule class.

Used to represent general molecules without specific properties.


Constructor & Destructor Documentation

Molecule::Molecule  )  throw ()
 

Default constructor.

Molecule::Molecule const Molecule molecule,
bool  deep = true
throw ()
 

Copy constructor.

Molecule::Molecule const String name  )  throw ()
 

Detailled constructor.

virtual Molecule::~Molecule  )  throw () [virtual]
 

Destructor.


Member Function Documentation

void Molecule::append AtomContainer atom_container  )  throw ()
 

Append an AtomContainer as the last child.

Parameters:
atom_container the AtomContainer to add

Reimplemented from AtomContainer.

void Molecule::append Atom atom  )  throw ()
 

Insert an atom as the last child.

Parameters:
atom the atom to add

Reimplemented from AtomContainer.

virtual void Molecule::dump std::ostream &  s = std::cout,
Size  depth = 0
const throw () [virtual]
 

Internal state dump.

Dump the current internal state to the output ostream s with dumping depth depth .

Parameters:
s output stream where to output the internal state
depth the dumping depth

Reimplemented from AtomContainer.

Reimplemented in NucleicAcid, and Protein.

void Molecule::get Molecule molecule,
bool  deep = true
const throw ()
 

Assign to another Molecule.

Parameters:
molecule the Molecule to be assigned to
deep make a deep (=true) or shallow (=false) copy

const AtomContainer* Molecule::getSuperAtomContainer  )  const throw () [protected]
 

Get a constant pointer to the parent AtomContainer.

The pointer is 0 if this instance does not have a parent AtomContainer.

Returns:
AtomContainer* - constant pointer to the parent AtomContainer

Reimplemented from AtomContainer.

AtomContainer* Molecule::getSuperAtomContainer  )  throw () [protected]
 

Get a mutable pointer to the parent AtomContainer.

The pointer is 0 if this instance does not have a parent AtomContainer.

Returns:
AtomContainer* - mutable pointer to the parent AtomContainer

Reimplemented from AtomContainer.

const System* Molecule::getSystem  )  const throw ()
 

Get a const pointer to the parent System.

Returns:
System* pointer to the parent System

System* Molecule::getSystem  )  throw ()
 

Access the parent System.

Returns:
System* pointer to the parent System

void Molecule::insert AtomContainer atom_container  )  throw ()
 

Insert an AtomContainer as the last child.

Parameters:
atom_container the AtomContainer to add

Reimplemented from AtomContainer.

void Molecule::insert Atom atom  )  throw ()
 

Insert an atom as the last child.

Parameters:
atom the atom to add

Reimplemented from AtomContainer.

void Molecule::insertAfter AtomContainer atom_container,
Composite after
throw ()
 

Insert an AtomContainer after a given Composite object.

Parameters:
atom_container the AtomContainer to insert
after the Composite object to insert after

Reimplemented from AtomContainer.

void Molecule::insertAfter Atom atom,
Composite after
throw ()
 

Insert an atom after a Composite object.

Parameters:
atom the atom to insert
after the Composite object to insert after

Reimplemented from AtomContainer.

void Molecule::insertBefore AtomContainer atom_container,
Composite before
throw ()
 

Insert an AtomContainer before a given Composite object.

Parameters:
atom_container the AtomContainer to insert
before the Composite object to insert before

Reimplemented from AtomContainer.

void Molecule::insertBefore Atom atom,
Composite before
throw ()
 

Insert an atom before a Composite object.

Parameters:
atom the atom to insert
before the Composite object to insert before

Reimplemented from AtomContainer.

bool Molecule::isSubAtomContainerOf const AtomContainer atom_container  )  const throw () [protected]
 

Test if an AtomContainer is a child.

Parameters:
atom_container the AtomContainer to test

Reimplemented from AtomContainer.

bool Molecule::operator!= const Molecule molecule  )  const throw ()
 

Inequality operator.

See also:
operator ==

Molecule& Molecule::operator= const Molecule molecule  )  throw ()
 

Assignment operator.

Parameters:
molecule the Molecule to assign from

bool Molecule::operator== const Molecule molecule  )  const throw ()
 

Equality operator.

Two molecules are equal if they have the same handle.

See also:
Object::operator ==.

void Molecule::persistentRead PersistenceManager pm  )  throw (Exception::GeneralException) [virtual]
 

Reads a Molecule object from a persistent stream.

Parameters:
pm the persistence manager

Reimplemented from AtomContainer.

Reimplemented in NucleicAcid, and Protein.

void Molecule::persistentWrite PersistenceManager pm,
const char *  name = 0
const throw (Exception::GeneralException) [virtual]
 

Writes a Molecule object to a persistent stream.

Parameters:
pm the persistence manager

Reimplemented from AtomContainer.

Reimplemented in NucleicAcid, and Protein.

void Molecule::prepend AtomContainer atom_container  )  throw ()
 

Insert an AtomContainer as the first child.

Parameters:
atom_container the AtomContainer to add

Reimplemented from AtomContainer.

void Molecule::prepend Atom atom  )  throw ()
 

Insert an atom as the first child.

Parameters:
atom the atom to add

Reimplemented from AtomContainer.

bool Molecule::remove AtomContainer atom_container  )  throw ()
 

Remove an AtomContainer.

Parameters:
atom_container the AtomContainer to remove

Reimplemented from AtomContainer.

bool Molecule::remove Atom atom  )  throw ()
 

Remove an atom.

Parameters:
atom the atom to remove

Reimplemented from AtomContainer.

void Molecule::set const Molecule molecule,
bool  deep = true
throw ()
 

Assign from another Molecule.

Parameters:
molecule the Molecule object to assign from
deep make a deep (=true) or shallow (=false) copy

void Molecule::splice AtomContainer atom_container  )  throw ()
 

Move the children of atom_container into this molecule.

The children of atom_container are inserted at the position of atom_container if it is a child of this. Otherwise the children are inserted using spliceBefore .

Reimplemented from AtomContainer.

void Molecule::spliceAfter AtomContainer atom_container  )  throw ()
 

Cut all children of atom_container and append them after the children of this molecule.

Parameters:
atom_container the AtomContainer to access

Reimplemented from AtomContainer.

void Molecule::spliceBefore AtomContainer atom_container  )  throw ()
 

Cut all children of atom_container and prepend them before the children of this molecule.

Parameters:
atom_container the AtomContainer to access

Reimplemented from AtomContainer.

void Molecule::swap Molecule molecule  )  throw ()
 

Swap the contents of two molecules.

Parameters:
molecule the Molecule to swap contents with