8 #ifndef IMPKERNEL_REFINER_H
9 #define IMPKERNEL_REFINER_H
11 #include <IMP/kernel/kernel_config.h>
14 #include "internal/IndexingIterator.h"
19 IMPKERNEL_BEGIN_NAMESPACE
47 Refiner(std::string name =
"Refiner %1%",
bool is_by_ref =
false);
84 "This refiner does not support"
85 " get_refined_indexes_by_ref()",
99 return get_refined(a)[i];
105 return get_refined(a).size();
115 typedef internal::IndexingIterator<Accessor> RefinedIterator;
116 RefinedIterator refined_begin(
Particle *a)
const;
117 RefinedIterator refined_end(
Particle *a)
const;
124 #if !defined(SWIG) && !defined(IMP_DOXYGEN)
125 struct Refiner::Accessor {
132 Particle *operator()(
unsigned int i)
const {
return r_->get_refined(p_, i); }
133 bool operator==(
const Accessor &o)
const {
return p_ == o.p_ && r_ == o.r_; }
137 inline Refiner::RefinedIterator Refiner::refined_begin(
Particle *a)
const {
138 return RefinedIterator(Accessor(a,
this), 0);
140 inline Refiner::RefinedIterator Refiner::refined_end(
Particle *a)
const {
141 return RefinedIterator(Accessor(a,
this), get_number_of_refined(a));
144 IMPKERNEL_END_NAMESPACE
Control display of deprecation information.
virtual unsigned int get_number_of_refined(Particle *a) const
IMP::kernel::DerivativeAccumulator DerivativeAccumulator
virtual Particle * get_refined(Particle *a, unsigned int i) const
Get the ith refined particle.
bool get_is_by_ref_supported()
virtual bool get_can_refine(Particle *) const
Return true if this refiner can refine that particle.
Single variable function.
#define IMP_UNUSED(variable)
IMP::kernel::Refiner Refiner
Class to handle individual model particles.
Common base class for heavy weight IMP objects.
Classes to handle individual model particles. (Note that implementation of inline functions in in int...
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing sets of objects.
Exception definitions and assertions.
IMP::kernel::Particle Particle
#define IMP_ALWAYS_CHECK(condition, message, exception_name)
Throw an exception if a check fails.
Abstract class to implement hierarchical methods.
An exception for an invalid value being passed to IMP.
Class for storing model, its restraints, constraints, and particles.