12 #ifndef IMPKERNEL_PAIR_CONTAINER_H
13 #define IMPKERNEL_PAIR_CONTAINER_H
15 #include <IMP/kernel/kernel_config.h>
16 #include "internal/IndexingIterator.h"
19 #include "internal/container_helpers.h"
30 IMPKERNEL_BEGIN_NAMESPACE
61 if (get_provides_access())
65 if (contents_hash_ != nhash || !cache_initialized_) {
66 contents_hash_ = nhash;
67 cache_initialized_ =
true;
70 return contents_cache_;
85 return IMP::kernel::internal::get_particle(get_model(),
get_indexes());
89 return IMP::kernel::internal::get_particle(get_model(),
get_indexes()[i]);
91 unsigned int get_number()
const {
return get_indexes().size(); }
93 bool get_provides_access()
const;
98 template <
class Functor>
99 Functor for_each(Functor f) {
102 return std::for_each(vs.begin(), vs.end(), f);
114 IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
115 unsigned int get_number_of_particle_pairs()
const;
119 IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
124 std::string name =
"PairContainer %1%");
126 virtual void do_apply(
const PairModifier *sm)
const = 0;
127 virtual bool do_get_provides_access()
const {
return false; }
132 mutable std::size_t contents_hash_;
134 mutable bool cache_initialized_;
141 #if !defined(SWIG) && !defined(IMP_DOXYGEN)
175 void set_name_if_default(std::string name);
178 IMPKERNEL_END_NAMESPACE
std::size_t get_contents_hash() const
An exception for a request for an invalid member of a container.
IMP::kernel::PairModifier PairModifier
Class for adding derivatives from restraints to the model.
Control display of deprecation information.
ParticleIndexes get_indexes(const ParticlesTemp &ps)
Various general useful macros for IMP.
Abstract base class for containers of particles.
PairContainerAdaptor(base::internal::PointerBase< C > c)
IMP::kernel::PairScore PairScore
A shared container for Pairs.
A smart pointer to a reference counted object.
A class to store an fixed array of same-typed values.
Abstract class for containers of particles.
Various general useful macros for IMP.
Classes to handle individual model particles. (Note that implementation of inline functions in in int...
Classes to handle individual model particles.
#define IMP_THROW(message, exception_name)
Throw an exception with a message.
A nullptr-initialized pointer to an IMP Object.
Exception definitions and assertions.
IMP::kernel::PairContainer PairContainer
#define IMP_REF_COUNTED_NONTRIVIAL_DESTRUCTOR(Name)
A base class for modifiers of kernel::ParticlePairsTemp.
Class for storing model, its restraints, constraints, and particles.