8 #ifndef IMPKERNEL_DECORATOR_H
9 #define IMPKERNEL_DECORATOR_H
11 #include <IMP/kernel_config.h>
19 #include "internal/utility.h"
24 IMPKERNEL_BEGIN_NAMESPACE
25 class ParticleAdaptor;
124 if (o < get_particle())
126 else if (o > get_particle())
134 : model_(m), pi_(pi), is_valid_(
true) {}
147 bool __eq__(
Object* o)
const {
return operator==(o); }
148 bool __ne__(
Object* o)
const {
return operator!=(o); }
149 bool __lt__(
Object* o)
const {
return operator<(o); }
150 bool __gt__(
Object* o)
const {
return operator>(o); }
151 bool __ge__(
Object* o)
const {
return operator>=(o); }
152 bool __le__(
Object* o)
const {
return operator<=(o); }
156 bool operator==(
Object* o)
const {
return (
compare(o) == 0); }
157 bool operator!=(
Object* o)
const {
return (
compare(o) != 0); }
160 bool operator>=(
Object* o)
const {
return !(
compare(o) < 0); }
161 bool operator<=(
Object* o)
const {
return !(
compare(o) > 0); }
178 "Particle " << pi_ <<
" is no longer part of the model.");
179 return model_->get_particle(pi_);
184 operator Particle*()
const {
return get_particle(); }
185 Particle* operator->()
const {
return get_particle(); }
186 operator ParticleIndex()
const {
return get_particle_index(); }
206 #if !defined(IMP_DOXYGEN) && !defined(SWIG)
207 typedef boost::false_type DecoratorHasTraits;
213 IMPKERNELEXPORT
void check_particle(Model *m,
ParticleIndex pi);
216 IMPKERNEL_END_NAMESPACE
ParticleIndex get_particle_index() const
Returns the particle index decorated by this decorator.
Smart pointer to Object-derived classes that does not refcount.
#define IMP_HASHABLE_INLINE(name, hashret)
Model * get_model() const
Returns the Model containing the particle.
Storage of a model, its restraints, constraints and particles.
Index< ParticleIndexTag > ParticleIndex
Class for storing model, its restraints, constraints, and particles.
Base class for a simple primitive-like type.
Common base class for heavy weight IMP objects.
int compare(const VectorD< D > &a, const VectorD< D > &b)
lexicographic comparison of two vectors
Various general useful macros for IMP.
A weak pointer to an Object or RefCountedObject.
A base class for constraints.
A class for storing lists of IMP items.
For backwards compatibility.
bool get_is_valid() const
Returns true if constructed with a non-default constructor.
Particle * get_particle() const
Returns the particle decorated by this decorator.
Interface to specialized Particle types (e.g. atoms)
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
A shared base class to help in debugging and things.
Base class for a simple primitive-like type.
Class to handle individual particles of a Model object.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.