8 #ifndef IMPKERNEL_REFINER_H
9 #define IMPKERNEL_REFINER_H
11 #include <IMP/kernel/kernel_config.h>
16 #include "internal/IndexingIterator.h"
20 IMPKERNEL_BEGIN_NAMESPACE
38 Refiner(std::string name=
"Refiner %1%");
55 virtual unsigned int get_number_of_refined(
Particle *a)
const =0;
64 typedef internal::IndexingIterator<Accessor> RefinedIterator;
65 RefinedIterator refined_begin(
Particle *a)
const;
66 RefinedIterator refined_end(
Particle *a)
const;
75 #if !defined(SWIG) && !defined(IMP_DOXYGEN)
76 struct Refiner::Accessor {
83 Particle *operator()(
unsigned int i)
const {
84 return r_->get_refined(p_, i);
86 bool operator==(
const Accessor &o)
const {
87 return p_==o.p_ && r_==o.r_;
92 inline Refiner::RefinedIterator Refiner::refined_begin(
Particle *a)
const {
93 return RefinedIterator(Accessor(a,
this), 0);
95 inline Refiner::RefinedIterator Refiner::refined_end(
Particle *a)
const {
96 return RefinedIterator(Accessor(a,
this), get_number_of_refined(a));
99 IMPKERNEL_END_NAMESPACE