8 #ifndef IMPKERNEL_DECORATOR_H
9 #define IMPKERNEL_DECORATOR_H
11 #include <IMP/kernel/kernel_config.h>
19 #include "internal/utility.h"
24 IMPKERNEL_BEGIN_NAMESPACE
25 class ParticleAdaptor;
122 if (o < get_particle())
124 else if (o > get_particle())
132 : model_(m), pi_(pi), is_valid_(
true) {}
145 bool __eq__(
base::Object* o)
const {
return operator==(o); }
146 bool __ne__(
base::Object* o)
const {
return operator!=(o); }
147 bool __lt__(
base::Object* o)
const {
return operator<(o); }
148 bool __gt__(
base::Object* o)
const {
return operator>(o); }
149 bool __ge__(
base::Object* o)
const {
return operator>=(o); }
150 bool __le__(
base::Object* o)
const {
return operator<=(o); }
174 "Particle " << pi_ <<
" is no longer part of the model.");
175 return model_->get_particle(pi_);
180 operator Particle*()
const {
return get_particle(); }
181 Particle* operator->()
const {
return get_particle(); }
182 operator ParticleIndex()
const {
return get_particle_index(); }
203 #if !defined(IMP_DOXYGEN) && !defined(SWIG)
204 typedef boost::false_type DecoratorHasTraits;
211 IMPKERNELEXPORT
void check_particle(
Particle* p);
214 IMPKERNEL_END_NAMESPACE
ParticleIndex get_particle_index() const
Returns the particle index decorated by this decorator.
Particle * get_particle() const
Returns the particle decorated by this decorator.
#define IMP_HASHABLE_INLINE(name, hashret)
Model * get_model() const
Returns the Model containing the particle.
Base for a simple primitive-like type.
bool get_is_valid() const
int compare(const VectorD< D > &a, const VectorD< D > &b)
lexicographic comparison of two vectors
Various general useful macros for IMP.
A nullptr-initialized pointer to an Object.
Class to handle individual model particles.
A class for storing lists of IMP items.
Storage of a model, its restraints, constraints and particles.
Common base class for heavy weight IMP objects.
A base class for constraints.
Classes to handle individual model particles. (Note that implementation of inline functions in in int...
A shared base class to help in debugging and things.
For backwards compatibility.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
IMP::kernel::Decorator Decorator
IMP::kernel::ParticleIndex ParticleIndex
Class for storing model, its restraints, constraints, and particles.