8 #ifndef IMPKERNEL_REFINER_H
9 #define IMPKERNEL_REFINER_H
11 #include <IMP/kernel_config.h>
14 #include "internal/IndexingIterator.h"
18 #include <cereal/access.hpp>
19 #include <cereal/types/base_class.hpp>
21 IMPKERNEL_BEGIN_NAMESPACE
24 class DerivativeAccumulator;
40 friend class cereal::access;
41 template<
class Archive>
void serialize(Archive &ar) {
43 ar(cereal::base_class<Object>(
this), is_by_ref_);
55 Refiner(std::string name =
"Refiner %1%",
bool is_by_ref =
false);
93 "This refiner does not support"
94 " get_refined_indexes_by_ref()",
108 return get_refined(a)[i];
114 return get_refined(a).size();
124 typedef internal::IndexingIterator<Accessor> RefinedIterator;
125 RefinedIterator refined_begin(
Particle *a)
const;
126 RefinedIterator refined_end(
Particle *a)
const;
133 #if !defined(SWIG) && !defined(IMP_DOXYGEN)
134 struct Refiner::Accessor {
140 typedef Particle *result_type;
141 Particle *operator()(
unsigned int i)
const {
return r_->get_refined(p_, i); }
142 bool operator==(
const Accessor &o)
const {
return p_ == o.p_ && r_ == o.r_; }
146 inline Refiner::RefinedIterator Refiner::refined_begin(Particle *a)
const {
147 return RefinedIterator(Accessor(a,
this), 0);
149 inline Refiner::RefinedIterator Refiner::refined_end(Particle *a)
const {
150 return RefinedIterator(Accessor(a,
this), get_number_of_refined(a));
153 IMPKERNEL_END_NAMESPACE
Control display of deprecation information.
virtual Particle * get_refined(Particle *a, unsigned int i) const
Get the ith refined particle.
Base class for objects that take particle arguments and read from them.
A more IMP-like version of the std::vector.
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)
Classes used in the construction of ModelObjects.
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 lists of object pointers.
Helper macros for throwing and handling exceptions.
Abstract class to implement hierarchical methods.
Class to handle individual particles of a Model object.
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.