Loading...
Searching...
No Matches
KERNEL/forEach.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
// $Id: forEach.h,v 1.16 2004/02/18 23:24:04 oliver Exp $
//
#ifndef BALL_KERNEL_FOREACH_H
#define BALL_KERNEL_FOREACH_H
// This is mostly to allow Doxygen to put the macros to where they belong
namespace BALL
{
#define BALL_FOREACH_MOLECULE(molecule_container, molecule_iterator) \
for (molecule_iterator = (molecule_container).beginMolecule(); \
!molecule_iterator.isEnd(); ++molecule_iterator)
#define BALL_FOREACH_FRAGMENT(fragment_container, fragment_iterator) \
for (fragment_iterator = (fragment_container).beginFragment(); \
!fragment_iterator.isEnd(); ++fragment_iterator)
#define BALL_FOREACH_ATOMCONTAINER(atom_containers, atom_container_iterator) \
for (atom_container_iterator = (atom_containers).beginAtomContainer(); \
!atom_container_iterator.isEnd(); ++atom_container_iterator)
#define BALL_FOREACH_ATOM(atom_container, atom_iterator) \
for (atom_iterator = (atom_container).beginAtom(); \
!atom_iterator.isEnd(); ++atom_iterator)
#define BALL_FOREACH_ATOM_BOND(bond_container, bond_iterator) \
for (bond_iterator = (bond_container).beginBond(); \
!bond_iterator.isEnd(); ++bond_iterator)
#define BALL_FOREACH_ATOM_PAIR(atom_container, first_atom_iterator, second_atom_iterator) \
for (first_atom_iterator = (atom_container).beginAtom(); \
!first_atom_iterator.isEnd(); ++first_atom_iterator) \
for (second_atom_iterator = (atom_container).beginAtom(); \
!second_atom_iterator.isEnd(); ++second_atom_iterator) \
if ((*first_atom_iterator) < (*second_atom_iterator))
#define BALL_FOREACH_BOND(atom_container, atom_iterator, bond_iterator) \
for (atom_iterator = (atom_container).beginAtom(); \
!atom_iterator.isEnd(); ++atom_iterator) \
for (bond_iterator = (*atom_iterator).beginBond(); \
!bond_iterator.isEnd(); ++bond_iterator) \
if ((*bond_iterator).getFirstAtom() == &(*atom_iterator) \
|| !(atom_container).isAncestorOf(*(*bond_iterator).getFirstAtom()))
#define BALL_FOREACH_INTERBOND(atom_container, atom_iterator, bond_iterator) \
for (atom_iterator = (atom_container).beginAtom(); \
!atom_iterator.isEnd(); ++atom_iterator) \
for (bond_iterator = (*atom_iterator).beginBond(); \
!bond_iterator.isEnd(); ++bond_iterator) \
if (((*bond_iterator).getFirstAtom() == &(*atom_iterator) \
&& !(atom_container).isAncestorOf(*(*bond_iterator).getSecondAtom())) \
|| !(atom_container).isAncestorOf(*(*bond_iterator).getFirstAtom()))
#define BALL_FOREACH_INTRABOND(atom_container, atom_iterator, bond_iterator) \
for (atom_iterator = (atom_container).beginAtom(); \
!atom_iterator.isEnd(); ++atom_iterator) \
for (bond_iterator = (*atom_iterator).beginBond(); \
!bond_iterator.isEnd(); ++bond_iterator) \
if ((*bond_iterator).getFirstAtom() == &(*atom_iterator) \
&& (atom_container).isAncestorOf(*(*bond_iterator).getSecondAtom()))
#define BALL_FOREACH_PROTEIN(protein_container, protein_iterator) \
for (protein_iterator = (protein_container).beginProtein(); \
!protein_iterator.isEnd(); ++protein_iterator)
#define BALL_FOREACH_CHAIN(chain_container, chain_iterator) \
for (chain_iterator = (chain_container).beginChain(); \
!chain_iterator.isEnd(); ++chain_iterator)
#define BALL_FOREACH_SECONDARYSTRUCTURE(secondary_structure_container, secondary_structure_iterator) \
for (secondary_structure_iterator = (secondary_structure_container).beginSecondaryStructure(); \
!secondary_structure_iterator.isEnd(); ++secondary_structure_iterator)
#define BALL_FOREACH_RESIDUE(residue_container, residue_iterator) \
for (residue_iterator = (residue_container).beginResidue(); \
!residue_iterator.isEnd(); \
++residue_iterator)
#define BALL_FOREACH_PDBATOM(pdb_atom_container, pdb_atom_iterator) \
for (pdb_atom_iterator = (pdb_atom_container).beginPDBAtom(); \
!pdb_atom_iterator.isEnd(); ++pdb_atom_iterator)
} // namespace BALL
#endif // BALL_KERNEL_FOREACH_H
BALL
Definition constants.h:13