12 #ifndef IMPKERNEL_TRIPLET_CONTAINER_H
13 #define IMPKERNEL_TRIPLET_CONTAINER_H
15 #include <IMP/kernel_config.h>
16 #include "internal/IndexingIterator.h"
19 #include "internal/container_helpers.h"
30 IMPKERNEL_BEGIN_NAMESPACE
31 class TripletModifier;
71 if (get_provides_access())
75 if (contents_hash_ != nhash || !cache_initialized_) {
76 contents_hash_ = nhash;
77 cache_initialized_ =
true;
78 get_indexes_in_place(contents_cache_);
80 return contents_cache_;
96 return IMP::internal::get_particle(get_model(),
get_indexes());
100 return IMP::internal::get_particle(get_model(),
get_indexes()[i]);
106 unsigned int get_number()
const {
return get_indexes().size(); }
108 bool get_provides_access()
const;
113 template <
class Functor>
114 Functor for_each(Functor f) {
117 return std::for_each(vs.begin(), vs.end(), f);
125 std::string name =
"TripletContainer %1%");
135 virtual bool do_get_provides_access()
const {
return false; }
137 #if !defined(SWIG) && !defined(IMP_DOXYGEN)
149 mutable std::size_t contents_hash_;
151 mutable bool cache_initialized_;
158 #if !defined(SWIG) && !defined(IMP_DOXYGEN)
159 public Pointer<TripletContainer>
192 void set_name_if_default(std::string name);
195 IMPKERNEL_END_NAMESPACE
Control display of deprecation information.
Macros to help with reference counting.
A class to store an fixed array of same-typed values.
Class for adding derivatives from restraints to the model.
std::size_t get_contents_hash() const
A more IMP-like version of the std::vector.
A smart pointer to a reference counted object.
Class for storing model, its restraints, constraints, and particles.
#define IMP_UNUSED(variable)
Various general useful macros for IMP.
An exception for a request for an invalid member of a container.
TripletContainerAdaptor(IMP::internal::PointerBase< C > c)
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
Abstract base class for containers of particles.
#define IMP_THROW(message, exception_name)
Throw an exception with a message.
A nullptr-initialized pointer to an IMP Object.
Helper macros for throwing and handling exceptions.
A base class for modifiers of ParticleTripletsTemp.
#define IMP_REF_COUNTED_NONTRIVIAL_DESTRUCTOR(Name)
A shared container for Triplets.
ParticleIndexes get_indexes(const ParticlesTemp &ps)
Get the indexes from a list of particles.
Abstract class for containers of particles.