Loading...
Searching...
No Matches
BALL::System Class Reference
Kernel Classes » Molecular Datastructures

`#include <BALL/KERNEL/system.h>`

Inheritance diagram for BALL::System:

## Public Member Functions

Constructors and Destructors
| System ()
| Default constructor.
| System (const System &system, bool deep=true)
| Copy constructor.
| System (const String &name)
| Detailled constructor.
virtual | ~System ()
| Destructor.
Persistence
void | persistentWrite (PersistenceManager &pm, const char *name=0) const
void | persistentRead (PersistenceManager &pm)
Assignment
void | set (const System &system, bool deep=true)
System & | operator= (const System &system)
void | get (System &system, bool deep=true) const
bool | operator== (const System &system) const
bool | operator!= (const System &system) const
Accessors
Molecule * | getMolecule (Position position)
const Molecule * | getMolecule (Position position) const
Protein * | getProtein (Position position)
const Protein * | getProtein (Position position) const
Size | countMolecules () const
Size | countFragments () const
Size | countAtoms () const
Size | countProteins () const
Size | countChains () const
Size | countSecondaryStructures () const
Size | countResidues () const
Size | countNucleicAcids () const
Size | countNucleotides () const
void | prepend (Molecule &molecule)
void | append (Molecule &molecule)
void | insert (Molecule &molecule)
void | insertBefore (Molecule &molecule, Composite &before)
void | insertAfter (Molecule &molecule, Composite &after)
bool | remove (Molecule &molecule)
void | spliceBefore (System &system)
void | spliceAfter (System &system)
void | splice (System &system)
Public Member Functions inherited from BALL::AtomContainer
| AtomContainer ()
| AtomContainer (const AtomContainer &atom_container, bool deep=true)
| AtomContainer (const String &name)
virtual | ~AtomContainer ()
virtual void | clear ()
virtual void | destroy ()
void | set (const AtomContainer &atom_container, bool deep=true)
AtomContainer & | operator= (const AtomContainer &atom_container)
void | get (AtomContainer &atom_container, bool deep=true) const
void | swap (AtomContainer &atom_container)
bool | operator== (const AtomContainer &atom_container) const
bool | operator!= (const AtomContainer &atom_container) const
bool | isSubAtomContainerOf (const AtomContainer &atom_container) const
bool | isSuperAtomContainerOf (const AtomContainer &atom_container) const
virtual bool | isValid () const
virtual void | dump (std::ostream &s=std::cout, Size depth=0) const
void | setName (const String &name)
const String & | getName () const
AtomContainer * | getSuperAtomContainer ()
const AtomContainer * | getSuperAtomContainer () const
AtomContainer * | getAtomContainer (Position position)
const AtomContainer * | getAtomContainer (Position position) const
Atom * | getAtom (Position position)
const Atom * | getAtom (Position position) const
Atom * | getAtom (const String &name)
const Atom * | getAtom (const String &name) const
Size | countAtomContainers () const
Size | countAtoms () const
Size | countBonds () const
Size | countInterBonds () const
Size | countIntraBonds () const
void | prepend (Atom &atom)
void | append (Atom &atom)
void | insert (Atom &atom)
void | insertBefore (Atom &atom, Composite &before)
void | insertAfter (Atom &atom, Composite &after)
bool | remove (Atom &atom)
Size | removeHavingProperty (BALL::Property p)
Size | removeNotHavingProperty (BALL::Property p)
Size | removeHavingProperty (const string &name)
Size | removeNotHavingProperty (const string &name)
void | prepend (AtomContainer &atom_container)
void | append (AtomContainer &atom_container)
void | insert (AtomContainer &atom_container)
void | insertBefore (AtomContainer &atom_container, Composite &before)
void | insertAfter (AtomContainer &atom_container, Composite &after)
void | spliceBefore (AtomContainer &atom_container)
void | spliceAfter (AtomContainer &atom_container)
void | splice (AtomContainer &atom_container)
bool | remove (AtomContainer &atom_container)
void | destroyBonds ()
bool | applyIntraBond (UnaryProcessor< Bond > &processor)
| Apply to all bonds connecting two atoms inside this AtomContainer.
bool | applyInterBond (UnaryProcessor< Bond > &processor)
| Apply to all bonds connected to atoms outside this AtomContainer.
Public Member Functions inherited from BALL::Composite
template<typename T>
BALL_INLINE bool | apply (UnaryProcessor< T > &processor)
template<typename T>
BALL_INLINE bool | apply (ConstUnaryProcessor< T > &processor) const
template<typename T>
BALL_INLINE T * | getAncestor (const T &)
template<typename T>
BALL_INLINE const T * | getAncestor (const T &) const
template<typename T>
BALL_INLINE T * | getPrevious (const T &)
template<typename T>
BALL_INLINE const T * | getPrevious (const T &dummy) const
template<typename T>
BALL_INLINE T * | getNext (const T &)
template<typename T>
BALL_INLINE const T * | getNext (const T &dummy) const
template<typename T>
BALL_INLINE bool | hasAncestor (const T &dummy) const
| Composite ()
| Composite (const Composite &composite, bool deep=true)
virtual | ~Composite ()
void | destroy (bool virtual_destroy)
void * | clone (Composite &root) const
bool | operator== (const Composite &composite) const
bool | operator!= (const Composite &composite) const
bool | isEmpty () const
bool | isRoot () const
bool | isRootOf (const Composite &composite) const
bool | isInterior () const
bool | hasChild () const
bool | isChildOf (const Composite &composite) const
bool | isFirstChild () const
bool | isFirstChildOf (const Composite &composite) const
bool | isLastChild () const
bool | isLastChildOf (const Composite &composite) const
bool | hasParent () const
bool | isParentOf (const Composite &composite) const
bool | hasSibling () const
bool | isSiblingOf (const Composite &composite) const
bool | hasPreviousSibling () const
bool | isPreviousSiblingOf (const Composite &composite) const
bool | hasNextSibling () const
bool | isNextSiblingOf (const Composite &composite) const
bool | isDescendantOf (const Composite &composite) const
template<typename T>
bool | hasAncestor (const T &dummy) const
bool | isAncestorOf (const Composite &composite) const
bool | isRelatedWith (const Composite &composite) const
bool | isHomomorph (const Composite &composite) const
bool | containsSelection () const
virtual bool | isAtom () const
virtual bool | isMolecule () const
virtual bool | isProtein () const
virtual bool | isFragment () const
virtual bool | isResidue () const
virtual bool | isChain () const
void | host (Visitor< Composite > &visitor)
template<typename T>
bool | applyAncestor (UnaryProcessor< T > &processor)
template<typename T>
bool | applyAncestor (ConstUnaryProcessor< T > &processor) const
template<typename T>
bool | applyChild (UnaryProcessor< T > &processor)
template<typename T>
bool | applyChild (ConstUnaryProcessor< T > &processor) const
template<typename T>
bool | applyDescendantPreorder (UnaryProcessor< T > &processor)
template<typename T>
bool | applyDescendantPreorder (ConstUnaryProcessor< T > &processor) const
template<typename T>
bool | applyDescendantPostorder (UnaryProcessor< T > &processor)
template<typename T>
bool | applyDescendantPostorder (ConstUnaryProcessor< T > &processor) const
template<typename T>
bool | applyDescendant (UnaryProcessor< T > &processor)
template<typename T>
bool | applyDescendant (ConstUnaryProcessor< T > &processor) const
template<typename T>
bool | applyPreorder (UnaryProcessor< T > &processor)
template<typename T>
bool | applyPreorder (ConstUnaryProcessor< T > &processor) const
template<typename T>
bool | applyPostorder (UnaryProcessor< T > &processor)
template<typename T>
bool | applyPostorder (ConstUnaryProcessor< T > &processor) const
template<typename T>
bool | apply (UnaryProcessor< T > &processor)
template<typename T>
bool | apply (ConstUnaryProcessor< T > &processor) const
template<typename T>
bool | applyLevel (UnaryProcessor< T > &processor, long level)
template<typename T>
bool | applyLevel (ConstUnaryProcessor< T > &processor, long level) const
AncestorIterator | beginAncestor ()
AncestorIterator | endAncestor ()
AncestorConstIterator | beginAncestor () const
AncestorConstIterator | endAncestor () const
ChildCompositeIterator | beginChildComposite ()
ChildCompositeIterator | endChildComposite ()
ChildCompositeConstIterator | beginChildComposite () const
ChildCompositeConstIterator | endChildComposite () const
ChildCompositeReverseIterator | rbeginChildComposite ()
ChildCompositeReverseIterator | rendChildComposite ()
ChildCompositeConstReverseIterator | rbeginChildComposite () const
ChildCompositeConstReverseIterator | rendChildComposite () const
CompositeIterator | beginComposite ()
CompositeIterator | endComposite ()
CompositeConstIterator | beginComposite () const
CompositeConstIterator | endComposite () const
CompositeReverseIterator | rbeginComposite ()
CompositeReverseIterator | rendComposite ()
CompositeConstReverseIterator | rbeginComposite () const
CompositeConstReverseIterator | rendComposite () const
void | deleteChildrenList_ (std::list< Composite * > &composites)
void | set (const Composite &composite, bool deep=true)
Composite & | operator= (const Composite &composite)
void | get (Composite &composite, bool deep=true) const
Size | getDegree () const
Size | count (const KernelPredicateType &predicate) const
Size | countDescendants () const
Size | getPathLength (const Composite &composite) const
Size | getDepth () const
Size | getHeight () const
Composite & | getRoot ()
const Composite & | getRoot () const
Composite * | getLowestCommonAncestor (const Composite &composite)
const Composite * | getLowestCommonAncestor (const Composite &composite) const
template<typename T>
T * | getAncestor (const T &)
template<typename T>
const T * | getAncestor (const T &) const
template<typename T>
T * | getPrevious (const T &)
template<typename T>
const T * | getPrevious (const T &dummy) const
template<typename T>
T * | getNext (const T &)
template<typename T>
const T * | getNext (const T &dummy) const
Composite * | getParent ()
const Composite * | getParent () const
Composite * | getChild (Index index)
const Composite * | getChild (Index index) const
Composite * | getSibling (Index index)
const Composite * | getSibling (Index index) const
Composite * | getFirstChild ()
const Composite * | getFirstChild () const
Composite * | getLastChild ()
const Composite * | getLastChild () const
const PreciseTime & | getModificationTime () const
const PreciseTime & | getSelectionTime () const
void | stamp (StampType stamp=BOTH)
void | prependChild (Composite &composite)
void | appendChild (Composite &composite)
void | insertBefore (Composite &composite)
void | insertAfter (Composite &composite)
void | spliceBefore (Composite &composite)
void | spliceAfter (Composite &composite)
void | splice (Composite &composite)
bool | removeChild (Composite &child)
Size | removeSelected ()
Size | removeUnselected ()
void | replace (Composite &composite)
void | swap (Composite &composite)
virtual void | select ()
virtual void | deselect ()
Public Member Functions inherited from BALL::PersistentObject
| PersistentObject ()
virtual | ~PersistentObject ()
PersistenceManager & | operator>> (PersistenceManager &pm) const
virtual void | finalize ()
Public Member Functions inherited from BALL::Object
| Object ()
| Default constructor.
| Object (const Object &object)
| Copy constructor.
virtual | ~Object ()
| Destructor.
const Object & | operator= (const Object &)
bool | operator== (const Object &object) const
bool | operator!= (const Object &object) const
bool | operator< (const Object &object) const
bool | operator<= (const Object &object) const
bool | operator>= (const Object &object) const
bool | operator> (const Object &object) const
int | compare (const Object &object) const
virtual void | dump (::std::ostream &s=std::cout, Size depth=0) const
Handle | getHandle () const
Public Member Functions inherited from BALL::AutoDeletable
virtual | ~AutoDeletable ()
void * | operator new (size_t size)
void | operator delete (void *ptr)
void * | operator new (size_t size, void *ptr)
void | operator delete (void *ptr, void *)
bool | isAutoDeletable () const
void | setAutoDeletable (bool enable)
Public Member Functions inherited from BALL::Selectable
| Selectable ()
| Selectable (const Selectable &selectable, bool deep=true)
virtual | ~Selectable ()
void | set (const Selectable &selectable, bool deep=true)
const Selectable & | operator= (const Selectable &selectable)
void | get (Selectable &selectable, bool deep=true) const
void | swap (Selectable &selectable)
virtual void | setSelected (bool selected)
bool | isSelected () const
bool | operator== (const Selectable &selectable) const
bool | operator!= (const Selectable &selectable) const
void | write (PersistenceManager &pm) const
bool | read (PersistenceManager &pm)
virtual void | dump (::std::ostream &s=std::cout, Size depth=0) const
Public Member Functions inherited from BALL::PropertyManager
BALL_INLINE | PropertyManager ()
| Default constructor.
BALL_INLINE | PropertyManager (const PropertyManager &property_manager)
| Copy constructor.
virtual | ~PropertyManager ()
| Destructor.
void | set (const PropertyManager &property_manager)
const PropertyManager & | operator= (const PropertyManager &property_manager)
void | get (PropertyManager &property_manager) const
void | swap (PropertyManager &property_manager)
BitVector & | getBitVector ()
const BitVector & | getBitVector () const
| operator BitVector & ()
void | setProperty (Property property)
void | clearProperty (Property property)
void | toggleProperty (Property property)
Size | countProperties () const
const NamedProperty & | getNamedProperty (Position index) const
NamedProperty & | getNamedProperty (Position index)
void | setProperty (const NamedProperty &property)
void | setProperty (const std::string &name)
void | setProperty (const std::string &name, bool value)
void | setProperty (const std::string &name, int value)
void | setProperty (const std::string &name, unsigned int value)
void | setProperty (const std::string &name, float value)
void | setProperty (const std::string &name, double value)
void | setProperty (const std::string &name, const std::string &value)
void | setProperty (const std::string &name, const PersistentObject &value)
const NamedProperty & | getProperty (const std::string &name) const
NamedPropertyIterator | beginNamedProperty ()
NamedPropertyIterator | endNamedProperty ()
void | clearProperty (const std::string &name)
Size | countNamedProperties () const
bool | hasProperty (Property property) const
| Query for an unnamed property.
bool | hasProperty (const std::string &name) const
| Query for a named property.
bool | operator== (const PropertyManager &pm) const
bool | operator!= (const PropertyManager &pm) const
| Inequality operator.
void | write (PersistenceManager &pm) const
| Persistent stream writing.
bool | read (PersistenceManager &pm)
| Persistent stream reading.
bool | isValid () const
void | dump (std::ostream &s=std::cout, Size depth=0) const

## Additional Inherited Members

Public Types inherited from BALL::AtomContainer
enum | Property { NUMBER_OF_PROPERTIES = 0 }
| The number of predefined properties for AtomContainer. More...
Public Types inherited from BALL::Composite
enum | StampType { MODIFICATION = 1 , SELECTION = 2 , BOTH = 3 }
typedef UnaryPredicate< Composite > | KernelPredicateType
typedef ForwardIterator< Composite, Composite, Composite *, AncestorIteratorTraits > | AncestorIterator
typedef ConstForwardIterator< Composite, Composite, Composite *, AncestorIteratorTraits > | AncestorConstIterator
typedef BidirectionalIterator< Composite, Composite, Composite *, ChildCompositeIteratorTraits > | ChildCompositeIterator
typedef ConstBidirectionalIterator< Composite, Composite, Composite *, ChildCompositeIteratorTraits > | ChildCompositeConstIterator
typedef std::reverse_iterator< ChildCompositeIterator > | ChildCompositeReverseIterator
typedef std::reverse_iterator< ChildCompositeConstIterator > | ChildCompositeConstReverseIterator
typedef BidirectionalIterator< Composite, Composite, Composite *, CompositeIteratorTraits > | CompositeIterator
typedef ConstBidirectionalIterator< Composite, Composite, Composite *, CompositeIteratorTraits > | CompositeConstIterator
typedef std::reverse_iterator< CompositeIterator > | CompositeReverseIterator
typedef std::reverse_iterator< CompositeConstIterator > | CompositeConstReverseIterator
static bool | insertParent (Composite &parent, Composite &first, Composite &last, bool destroy_parent=true)
static Handle | getNextHandle ()
static Handle | getNewHandle ()
static void | clearLastPtr ()
static UnaryProcessor< Composite > | DEFAULT_PROCESSOR
static KernelPredicateType | DEFAULT_UNARY_PREDICATE
| AutoDeletable ()
| AutoDeletable (const AutoDeletable &auto_deletable, bool deep=false)
bool | selected_

## Detailed Description

System class. This class is used to represent a system, i.e., a collection of molecules.

Definition at line 38 of file KERNEL/system.h.

## Constructor & Destructor Documentation

## System() [1/3]

BALL::System::System | ( |  | ) |

Default constructor.

## System() [2/3]

BALL::System::System | ( | const System & | system,
|  | bool | deep = true )

Copy constructor.

## System() [3/3]

BALL::System::System | ( | const String & | name | ) |

Detailled constructor.

## ~System()

virtual BALL::System::~System | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## append()

void BALL::System::append | ( | Molecule & | molecule | ) |

Append a molecule after the last position.

Parameters

  molecule | the molecule to append

## countAtoms()

Size BALL::System::countAtoms | ( |  | ) | const

Count the atoms in this system.

Returns
  Size the number of atoms

## countChains()

Size BALL::System::countChains | ( |  | ) | const

Count the chains in this system.

Returns
  Size the number of chains

## countFragments()

Size BALL::System::countFragments | ( |  | ) | const

Count the fragments in this system.

Returns
  Size the number of fragments

## countMolecules()

Size BALL::System::countMolecules | ( |  | ) | const

Count the molecules in this system.

Returns
  Size the number of molecules

## countNucleicAcids()

Size BALL::System::countNucleicAcids | ( |  | ) | const

Count the nucleic acids in this system.

Returns
  Size the number of nucleic acids

## countNucleotides()

Size BALL::System::countNucleotides | ( |  | ) | const

Count the nucleotides in this system.

Returns
  Size the number of nucleotides

## countProteins()

Size BALL::System::countProteins | ( |  | ) | const

Count the proteins in this system.

Returns
  Size the number of proteins

## countResidues()

Size BALL::System::countResidues | ( |  | ) | const

Count the residues in this system.

Returns
  Size the number of residues

## countSecondaryStructures()

Size BALL::System::countSecondaryStructures | ( |  | ) | const

Count the secondary structures in this system.

Returns
  Size the number of secondary structures

## get()

void BALL::System::get | ( | System & | system,
|  | bool | deep = true ) const

Copying with cloning facility. The assignment is either deep or shallow (default).

Parameters

  System | the System to be assigned to

## getMolecule() [1/2]

Molecule * BALL::System::getMolecule | ( | Position | position | ) |

Get a pointer to a child Molecule at a given position. The pointer is 0 if this instance does not have a Molecule at this position.

Note
  The current implementation of this function has linear complexity

Parameters

  position | the position of the child molecule

Returns
  Molecule* - mutable pointer to the child Molecule at position

## getMolecule() [2/2]

const Molecule * BALL::System::getMolecule | ( | Position | position | ) | const

Get a pointer to a child Molecule at a given position. The pointer is 0 if this instance does not have a Molecule at this position.

Note
  The current implementation of this function has linear complexity

Parameters

  position | the position of the child molecule

Returns
  Molecule* - constant pointer to the child Molecule at position

## getProtein() [1/2]

Protein * BALL::System::getProtein | ( | Position | position | ) |

Get a pointer to a child Protein a given position. The pointer is 0 if this instance does not have a Protein at this position.

Note
  The current implementation of this function has linear complexity

Parameters

  position | the position of the child Protein

Returns
  Protien* - mutable pointer to the child Protein at position

## getProtein() [2/2]

const Protein * BALL::System::getProtein | ( | Position | position | ) | const

Get a pointer to a child Protein a given position. The pointer is 0 if this instance does not have a Protein at this position.

Note
  The current implementation of this function has linear complexity

Parameters

  position | the position of the child Protein

Returns
  Protien* - mutable pointer to the child Protein at position

## insert()

void BALL::System::insert | ( | Molecule & | molecule | ) |

Insert a molecule after the last position.

Parameters

  molecule | the molecule to insert

## insertAfter()

void BALL::System::insertAfter | ( | Molecule & | molecule,
|  | Composite & | after )

Insert a molecule after a given Composite object.

Parameters

  molecule | the molecule to insert
  after | the Composite object to insert before

## insertBefore()

void BALL::System::insertBefore | ( | Molecule & | molecule,
|  | Composite & | before )

Insert a molecule before a given Composite object.

Parameters

  molecule | the molecule to insert
  before | the Composite object to insert before

## operator!=()

bool BALL::System::operator!= | ( | const System & | system | ) | const

Inequality operator

See also
  operator ==

## operator=()

System & BALL::System::operator= | ( | const System & | system | ) |

Assignment operator.

Parameters

  system | the System to be copied (cloned)

Returns
  System& - this instance

## operator==()

bool BALL::System::operator== | ( | const System & | system | ) | const

Equality operator. Two instance of System are equal if they have the same handle.

See also
  Object::operator ==

## persistentRead()

void BALL::System::persistentRead | ( | PersistenceManager & | pm | ) |

virtual

Reads a System object from a persistent stream.

Parameters

  pm | the persistence manager

Reimplemented from BALL::AtomContainer.

## persistentWrite()

void BALL::System::persistentWrite | ( | PersistenceManager & | pm,
|  | const char * | name = 0 ) const

virtual

Writes a System object to a persistent stream.

Parameters

  pm | the persistence manager

Reimplemented from BALL::AtomContainer.

## prepend()

void BALL::System::prepend | ( | Molecule & | molecule | ) |

Prepend a molecule at position 0.

Parameters

  molecule | the molecule to prepend

## remove()

bool BALL::System::remove | ( | Molecule & | molecule | ) |

Remove a molecule.

Parameters

  molecule | the molecule to remove

## set()

void BALL::System::set | ( | const System & | system,
|  | bool | deep = true )

Assignment with cloning facility. The assignment is either deep or shallow (default).

Parameters

  system | the System to be copied (cloned)
  deep | make a deep (=true) or shallow (=false) copy

## splice()

void BALL::System::splice | ( | System & | system | ) |

Move the children of system into this instance. The children are inserted using spliceBefore .

## spliceAfter()

void BALL::System::spliceAfter | ( | System & | system | ) |

Move the children of system into this instance. Cut all children of system and append them after the children of this instance.

Parameters

  system | the system to access

## spliceBefore()

void BALL::System::spliceBefore | ( | System & | system | ) |

Move the children of system into this instance. Cut all children of system and prepend them before the children of this instance.

Parameters

  system | the system to access