8 #ifndef IMPKERNEL_REFINER_H
9 #define IMPKERNEL_REFINER_H
11 #include <IMP/kernel_config.h>
12 #include "base_types.h"
14 #include "internal/IndexingIterator.h"
19 IMPKERNEL_BEGIN_NAMESPACE
22 class DerivativeAccumulator;
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 {
131 typedef Particle *result_type;
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 Particle * get_refined(Particle *a, unsigned int i) const
Get the ith refined particle.
Class for storing model, its restraints, constraints, and particles.
virtual bool get_can_refine(Particle *) const
Return true if this refiner can refine that particle.
Common base class for heavy weight IMP objects.
#define IMP_UNUSED(variable)
Single variable function.
virtual unsigned int get_number_of_refined(Particle *a) const
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing sets of objects.
Exception definitions and assertions.
Abstract class to implement hierarchical methods.
Class to handle individual model particles.
bool get_is_by_ref_supported()
#define IMP_ALWAYS_CHECK(condition, message, exception_name)
Throw an exception if a check fails.
An exception for an invalid value being passed to IMP.