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

AtomContainer Class Reference
[Molecular Datastructures]

Atom Container Base Class. More...

#include <atomContainer.h>

Inheritance diagram for AtomContainer:

Composite PropertyManager PersistentObject Selectable Object AutoDeletable Chain Fragment Molecule SecondaryStructure System Nucleotide Residue NucleicAcid Protein List of all members.

Public Types

Enums
enum  Property { NUMBER_OF_PROPERTIES = 0 }
 The number of predefined properties for AtomContainer.

Public Member Functions

Constructors and Destructors
 AtomContainer () throw ()
 Default constructor.
 AtomContainer (const AtomContainer &atom_container, bool deep=true) throw ()
 Copy constructor.
 AtomContainer (const String &name) throw ()
 Detailed Constructor.
virtual ~AtomContainer () throw ()
 Destructor.
virtual void clear () throw ()
 Clear the contents of this instance of AtomContainer.
virtual void destroy () throw ()
 Clear the contents of this instance of AtomContainer and removes it from parent composite structures.
Persistence
virtual void persistentWrite (PersistenceManager &pm, const char *name=0) const throw (Exception::GeneralException)
 Write an AtomContainer object to a persistent stream.
virtual void persistentRead (PersistenceManager &pm) throw (Exception::GeneralException)
 Read an AtomContainer object from a persistent stream.
Assignment
void set (const AtomContainer &atom_container, bool deep=true) throw ()
 Assign the contents of an AtomContainer The assignment is either deep or shallow (default is deep).
AtomContaineroperator= (const AtomContainer &atom_container) throw ()
 Assignment operator.
void get (AtomContainer &atom_container, bool deep=true) const throw ()
 Copy to another instance of AtomContainer.
void swap (AtomContainer &atom_container) throw ()
 Swap the contents of two AtomContainers.
Predicates
bool operator== (const AtomContainer &atom_container) const throw ()
 Equality operator.
bool operator!= (const AtomContainer &atom_container) const throw ()
 Inequality operator.
Accessors
void setName (const String &name) throw ()
 Set the name.
const StringgetName () const throw ()
 Return the name.
AtomContainergetSuperAtomContainer () throw ()
 Get a mutable pointer to the parent AtomContainer.
const AtomContainergetSuperAtomContainer () const throw ()
 Get a constant pointer to the parent AtomContainer.
AtomContainergetAtomContainer (Position position) throw ()
 Get a pointer to a child AtomContainer at a given position.
const AtomContainergetAtomContainer (Position position) const throw ()
 Get a constant pointer to a child AtomContainer at a given position.
AtomgetAtom (Position position) throw ()
 Get a pointer to a child atom at a given position.
const AtomgetAtom (Position position) const throw ()
 Get a pointer to a child atom at a given position.
AtomgetAtom (const String &name) throw ()
 Get a pointer to a child atom with the name name .
const AtomgetAtom (const String &name) const throw ()
 Get a pointer to a child atom with the name name .
Size countAtomContainers () const throw ()
 Count the child AtomContainers.
Size countAtoms () const throw ()
 Count the child atoms.
Size countBonds () const throw ()
 Count the child bonds.
Size countInterBonds () const throw ()
 Count all bonds which connect atoms in this instance with atoms outside.
Size countIntraBonds () const throw ()
 Count all bonds which connect 2 atoms in this instance.
void prepend (Atom &atom) throw ()
 Prepend an atom at position 0.
void append (Atom &atom) throw ()
 Append an atom to the last position.
void insert (Atom &atom) throw ()
 Insert an atom to the last position.
void insertBefore (Atom &atom, Composite &before) throw ()
 Insert an atom before a given Composite object.
void insertAfter (Atom &atom, Composite &after) throw ()
 Insert an atom after a given Composite object.
bool remove (Atom &atom) throw ()
 Remove an atom.
void prepend (AtomContainer &atom_container) throw ()
 Prepend an AtomContainer at position 0.
void append (AtomContainer &atom_container) throw ()
 Append an AtomContainer at the last position.
void insert (AtomContainer &atom_container) throw ()
 Insert an AtomContainer at the last position.
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 instance.
void spliceAfter (AtomContainer &atom_container) throw ()
 Cut all children of atom_container and append them after the children of this instance.
void splice (AtomContainer &atom_container) throw ()
 Move the children of {atom_container} into this instance.
bool remove (AtomContainer &atom_container) throw ()
 Remove an AtomContainer.
Miscellaneous
void destroyBonds () throw ()
 Destroy all bonds in this instance.
Predicates
bool isSubAtomContainerOf (const AtomContainer &atom_container) const throw ()
 Test if an AtomContainer is a child.
bool isSuperAtomContainerOf (const AtomContainer &atom_container) const throw ()
 Test if an AtomContainer is the parent.
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.
Internal Iteration
bool applyIntraBond (UnaryProcessor< Bond > &processor) throw ()
 Apply to all bonds connecting two atoms inside this AtomContainer.
bool applyInterBond (UnaryProcessor< Bond > &processor) throw ()
 Apply to all bonds connected to atoms outside this AtomContainer.

Detailed Description

Atom Container Base Class.

The AtomContainer class is the base class of all kernel classes containing atoms.


Constructor & Destructor Documentation

AtomContainer::AtomContainer const AtomContainer atom_container,
bool  deep = true
throw ()
 

Copy constructor.

Parameters:
atom_container the AtomContainer to construct from
deep a flag indicating cloning

AtomContainer::AtomContainer const String name  )  throw ()
 

Detailed Constructor.

Parameters:
name the name of the AtomContainer


Member Function Documentation

void AtomContainer::append AtomContainer atom_container  )  throw ()
 

Append an AtomContainer at the last position.

Parameters:
atom_container the AtomContainer to prepend

Reimplemented in Molecule.

void AtomContainer::append Atom atom  )  throw ()
 

Append an atom to the last position.

Parameters:
atom the atom to append

Reimplemented in Molecule, and Nucleotide.

virtual void AtomContainer::clear  )  throw () [virtual]
 

Clear the contents of this instance of AtomContainer.

This methods clears the base fragment's name, destroys all its children (as in Composite::clear ), but does not remove it from its parent composite structures.

Reimplemented from Composite.

Reimplemented in NucleicAcid, Nucleotide, Protein, Residue, and SecondaryStructure.

Size AtomContainer::countAtomContainers  )  const throw ()
 

Count the child AtomContainers.

Returns:
Size the number of AtomContainers

Size AtomContainer::countAtoms  )  const throw ()
 

Count the child atoms.

Returns:
Size the number of atoms

Reimplemented in System.

Size AtomContainer::countBonds  )  const throw ()
 

Count the child bonds.

Returns:
Size the number of bonds

Size AtomContainer::countInterBonds  )  const throw ()
 

Count all bonds which connect atoms in this instance with atoms outside.

Returns:
Size the number of inter bonds

Size AtomContainer::countIntraBonds  )  const throw ()
 

Count all bonds which connect 2 atoms in this instance.

Returns:
Size the number of intra bonds

virtual void AtomContainer::destroy  )  throw () [virtual]
 

Clear the contents of this instance of AtomContainer and removes it from parent composite structures.

This methods clears the base fragment's name, destroys all its children (as in Composite::destroy ), and removes it from its parent composite structures.

Reimplemented from Composite.

Reimplemented in NucleicAcid, Nucleotide, Protein, Residue, and SecondaryStructure.

void AtomContainer::destroyBonds  )  throw ()
 

Destroy all bonds in this instance.

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

Internal state dump.

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

Parameters:
s - output stream where to output the internal state of this instance
depth - the dumping depth

Reimplemented from Composite.

Reimplemented in Chain, Fragment, Molecule, NucleicAcid, Nucleotide, Protein, Residue, and SecondaryStructure.

void AtomContainer::get AtomContainer atom_container,
bool  deep = true
const throw ()
 

Copy to another instance of AtomContainer.

The assignment is either deep or shallow (default is deep).

Parameters:
atom_container the AtomContainer to be assigned to
See also:
Composite::get

const Atom* AtomContainer::getAtom const String name  )  const throw ()
 

Get a pointer to a child atom with the name name .

The pointer is 0 if this instance AtomContainer does not have an atom with this name.

Parameters:
name the name of the child atom
Returns:
Atom* - constant pointer to the child

Atom* AtomContainer::getAtom const String name  )  throw ()
 

Get a pointer to a child atom with the name name .

The pointer is 0 if this instance does not have an atom with this name.

Parameters:
name the name of the child atom
Returns:
Atom* - mutable pointer to the child

const Atom* AtomContainer::getAtom Position  position  )  const throw ()
 

Get a pointer to a child atom at a given position.

The pointer is 0 if this instance does not have an atom at the given position.

Parameters:
position the position of the child atom
Returns:
Atom* - constant pointer to the child

Atom* AtomContainer::getAtom Position  position  )  throw ()
 

Get a pointer to a child atom at a given position.

The pointer is 0 if this instance does not have an atom at the given position.

Parameters:
position the position of the child atom
Returns:
Atom* - mutable pointer to the child

const AtomContainer* AtomContainer::getAtomContainer Position  position  )  const throw ()
 

Get a constant pointer to a child AtomContainer at a given position.

The pointer is 0 if this instance does not have an AtomContainer at the given position.

Parameters:
position of the child AtomContainer
Returns:
AtomContainer* - constant pointer to the child

AtomContainer* AtomContainer::getAtomContainer Position  position  )  throw ()
 

Get a pointer to a child AtomContainer at a given position.

The pointer is 0 if this instance does not have an AtomContainer at the given position.

Parameters:
position of the child AtomContainer
Returns:
AtomContainer* - mutable pointer to the child

const String& AtomContainer::getName  )  const throw ()
 

Return the name.

Returns:
String& - constant reference to the name of this instance

const AtomContainer* AtomContainer::getSuperAtomContainer  )  const throw ()
 

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 in Molecule.

AtomContainer* AtomContainer::getSuperAtomContainer  )  throw ()
 

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 in Molecule.

void AtomContainer::insert AtomContainer atom_container  )  throw ()
 

Insert an AtomContainer at the last position.

Parameters:
atom_container the AtomContainer to insert

Reimplemented in Molecule.

void AtomContainer::insert Atom atom  )  throw ()
 

Insert an atom to the last position.

Parameters:
atom the atom to insert

Reimplemented in Molecule, and Nucleotide.

void AtomContainer::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 in Molecule.

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

Insert an atom after a given Composite object.

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

Reimplemented in Molecule, and Nucleotide.

void AtomContainer::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 in Molecule.

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

Insert an atom before a given Composite object.

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

Reimplemented in Molecule, and Nucleotide.

bool AtomContainer::isSubAtomContainerOf const AtomContainer atom_container  )  const throw ()
 

Test if an AtomContainer is a child.

Parameters:
atom_container the AtomContainer to test

Reimplemented in Molecule.

bool AtomContainer::isSuperAtomContainerOf const AtomContainer atom_container  )  const throw ()
 

Test if an AtomContainer is the parent.

Parameters:
atom_container the AtomContainer to test

virtual bool AtomContainer::isValid  )  const throw () [virtual]
 

Internal state and consistency self-validation.

If the internal state of this instance is correct (self-validated) and consistent true is returned, false otherwise.

Returns:
bool

Reimplemented from Composite.

Reimplemented in NucleicAcid, Nucleotide, Protein, Residue, and SecondaryStructure.

bool AtomContainer::operator!= const AtomContainer atom_container  )  const throw ()
 

Inequality operator.

See also:
operator ==

AtomContainer& AtomContainer::operator= const AtomContainer atom_container  )  throw ()
 

Assignment operator.

The assignment is deep.

Parameters:
atom_container the AtomContainer to be copied (cloned)
Returns:
AtomContainer& - this instance AtomContainer
See also:
AtomContainer::set

bool AtomContainer::operator== const AtomContainer atom_container  )  const throw ()
 

Equality operator.

Two instances of AtomContainer are equal if they have the same handle.

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

Read an AtomContainer object from a persistent stream.

Parameters:
pm the persistence manager

Reimplemented from Composite.

Reimplemented in Chain, Fragment, Molecule, NucleicAcid, Nucleotide, Protein, Residue, SecondaryStructure, and System.

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

Write an AtomContainer object to a persistent stream.

Parameters:
pm the persistence manager

Reimplemented from Composite.

Reimplemented in Chain, Fragment, Molecule, NucleicAcid, Nucleotide, Protein, Residue, SecondaryStructure, and System.

void AtomContainer::prepend AtomContainer atom_container  )  throw ()
 

Prepend an AtomContainer at position 0.

Parameters:
atom_container the AtomContainer to prepend

Reimplemented in Molecule.

void AtomContainer::prepend Atom atom  )  throw ()
 

Prepend an atom at position 0.

Parameters:
atom the atom to prepend

Reimplemented in Molecule, and Nucleotide.

bool AtomContainer::remove AtomContainer atom_container  )  throw ()
 

Remove an AtomContainer.

Parameters:
atom_container the AtomContainer to remove
Returns:
false if {atom_container} could not be removed

Reimplemented in Molecule.

bool AtomContainer::remove Atom atom  )  throw ()
 

Remove an atom.

Parameters:
atom the atom to remove

Reimplemented in Molecule, and Nucleotide.

void AtomContainer::set const AtomContainer atom_container,
bool  deep = true
throw ()
 

Assign the contents of an AtomContainer The assignment is either deep or shallow (default is deep).

Parameters:
atom_container the atom_container to be copied (cloned)
deep make a deep (=true) or shallow (=false) copy
See also:
Composite::set

void AtomContainer::setName const String name  )  throw ()
 

Set the name.

Parameters:
name the new name

void AtomContainer::splice AtomContainer atom_container  )  throw ()
 

Move the children of {atom_container} into this instance.

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

Reimplemented in Molecule.

void AtomContainer::spliceAfter AtomContainer atom_container  )  throw ()
 

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

Parameters:
atom_container the AtomContainer to access

Reimplemented in Molecule.

void AtomContainer::spliceBefore AtomContainer atom_container  )  throw ()
 

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

Parameters:
atom_container the AtomContainer to access

Reimplemented in Molecule.

void AtomContainer::swap AtomContainer atom_container  )  throw ()
 

Swap the contents of two AtomContainers.

Parameters:
atom_container the AtomContainer this instance is being swapped with.