Loading...
Searching...
No Matches
KERNEL/predicate.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
// $Id: predicate.h,v 1.24 2005/10/23 12:02:19 oliver Exp $
//
#ifndef BALL_KERNEL_PREDICATE_H
#define BALL_KERNEL_PREDICATE_H
#ifndef BALL_COMMON_RTTI_H
# include <BALL/COMMON/rtti.h>
#endif
#ifndef BALL_CONCEPT_PREDICATE_H
# include <BALL/CONCEPT/predicate.h>
#endif
#ifndef BALL_CONCEPT_COMPOSITE_H
# include <BALL/CONCEPT/composite.h>
#endif
namespace BALL
{
class Atom;
class Molecule;
class Protein;
class Fragment;
class Residue;
class Chain;
#ifndef BALL_KERNEL_PREDICATE_TYPE
#define BALL_KERNEL_PREDICATE_TYPE
typedef UnaryPredicate<Composite> KernelPredicateType;
#endif
template <class T>
class KernelPredicate
: public UnaryPredicate<Composite>
{
public:
virtual bool operator () (const Composite& composite) const;
virtual ~KernelPredicate() {}
};
template <>
class KernelPredicate<Atom>
: public UnaryPredicate<Composite>
{
public:
virtual bool operator () (const Composite& composite) const;
virtual ~KernelPredicate() {}
};
template <>
class KernelPredicate<Molecule>
: public UnaryPredicate<Composite>
{
public:
virtual bool operator () (const Composite& composite) const;
virtual ~KernelPredicate() {}
};
template <>
class KernelPredicate<Protein>
: public UnaryPredicate<Composite>
{
public:
virtual bool operator () (const Composite& composite) const;
virtual ~KernelPredicate() {}
};
template <>
class KernelPredicate<Fragment>
: public UnaryPredicate<Composite>
{
public:
virtual bool operator () (const Composite& composite) const;
virtual ~KernelPredicate() {}
};
template <>
class KernelPredicate<Residue>
: public UnaryPredicate<Composite>
{
public:
virtual bool operator () (const Composite& composite) const;
virtual ~KernelPredicate() {}
};
template <>
class KernelPredicate<Chain>
: public UnaryPredicate<Composite>
{
public:
virtual bool operator () (const Composite& composite) const;
virtual ~KernelPredicate() {}
};
inline bool KernelPredicate<Atom>::operator () (const Composite& composite) const
{
return composite.isAtom();
}
inline bool KernelPredicate<Molecule>::operator () (const Composite& composite) const
{
return composite.isMolecule();
}
inline bool KernelPredicate<Protein>::operator () (const Composite& composite) const
{
return composite.isProtein();
}
inline bool KernelPredicate<Fragment>::operator () (const Composite& composite) const
{
return composite.isFragment();
}
inline bool KernelPredicate<Residue>::operator () (const Composite& composite) const
{
return composite.isResidue();
}
inline bool KernelPredicate<Chain>::operator () (const Composite& composite) const
{
return composite.isChain();
}
template <class T>
bool KernelPredicate<T>::operator () (const Composite& composite) const
{
return RTTI::isKindOf<T>(&composite);
}
} // namespace BALL
#endif // BALL_KERNEL_PREDICATE_H
predicate.h
BALL::Atom
Definition atom.h:90
BALL::Chain
Definition chain.h:32
BALL::Composite
Definition composite.h:74
BALL::Composite::isChain
virtual bool isChain() const
Definition composite.h:782
BALL::Composite::isResidue
virtual bool isResidue() const
Definition composite.h:777
BALL::Composite::isAtom
virtual bool isAtom() const
Definition composite.h:757
BALL::Composite::isProtein
virtual bool isProtein() const
Definition composite.h:767
BALL::Composite::isFragment
virtual bool isFragment() const
Definition composite.h:772
BALL::Composite::isMolecule
virtual bool isMolecule() const
Definition composite.h:762
BALL::Fragment
Definition fragment.h:22
BALL::KernelPredicate< Atom >::~KernelPredicate
virtual ~KernelPredicate()
Definition KERNEL/predicate.h:82
BALL::KernelPredicate< Chain >::~KernelPredicate
virtual ~KernelPredicate()
Definition KERNEL/predicate.h:137
BALL::KernelPredicate< Fragment >::~KernelPredicate
virtual ~KernelPredicate()
Definition KERNEL/predicate.h:115
BALL::KernelPredicate< Molecule >::~KernelPredicate
virtual ~KernelPredicate()
Definition KERNEL/predicate.h:93
BALL::KernelPredicate< Protein >::~KernelPredicate
virtual ~KernelPredicate()
Definition KERNEL/predicate.h:104
BALL::KernelPredicate< Residue >::~KernelPredicate
virtual ~KernelPredicate()
Definition KERNEL/predicate.h:126
BALL::KernelPredicate
Kernel predicate class.
Definition KERNEL/predicate.h:66
BALL::KernelPredicate::~KernelPredicate
virtual ~KernelPredicate()
Definition KERNEL/predicate.h:71
BALL::KernelPredicate::operator()
virtual bool operator()(const Composite &composite) const
Constant virtual RTTI evaluation operator.
Definition KERNEL/predicate.h:171
BALL::Molecule
Definition molecule.h:31
BALL::Protein
Definition protein.h:30
BALL::Residue
Definition residue.h:38
BALL::UnaryPredicate
Definition CONCEPT/predicate.h:30
composite.h
BALL::RTTI::isKindOf
bool isKindOf(const U *u)
Definition rtti.h:192
BALL
Definition constants.h:13
BALL::KernelPredicateType
UnaryPredicate< Composite > KernelPredicateType
Definition KERNEL/predicate.h:59
rtti.h