12 #ifndef IMPKERNEL_DECLARE_SINGLETON_CONTAINER_H
13 #define IMPKERNEL_DECLARE_SINGLETON_CONTAINER_H
15 #include <IMP/kernel/kernel_config.h>
16 #include "internal/IndexingIterator.h"
19 #include "internal/container_helpers.h"
30 IMPKERNEL_BEGIN_NAMESPACE
40 std::string name =
"SingletonContainer %1%");
66 return IMP::kernel::internal::get_particle(get_model(),
get_indexes());
69 Particle*
get(
unsigned int i)
const {
70 return IMP::kernel::internal::get_particle(get_model(),
get_indexes()[i]);
72 unsigned int get_number()
const {
return get_indexes().size(); }
74 bool get_provides_access()
const;
79 template <
class Functor> Functor for_each(Functor f) {
82 return std::for_each(vs.begin(), vs.end(), f);
99 IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
100 bool get_contains_particle(
Particle* v)
const;
104 IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
105 unsigned int get_number_of_particles()
const;
109 IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
110 Particle* get_particle(
unsigned int i)
const;
114 virtual bool do_get_provides_access()
const {
return false; }
123 #if !defined(SWIG) && !defined(IMP_DOXYGEN)
155 std::string name =
"SingletonContainerAdaptor%1%");
158 IMPKERNEL_END_NAMESPACE
An exception for a request for an invalid member of a container.
Class for adding derivatives from restraints to the model.
ParticleIndexes get_indexes(const ParticlesTemp &ps)
Abstract base class for containers of particles.
Classes to handle individual model particles.
A nullptr-initialized pointer to an IMP Object.
IMP::kernel::SingletonContainer SingletonContainer
SingletonContainerAdaptor(base::internal::PointerBase< C > c)
ParticlesTemp get_particles(kernel::Model *m, const ParticleIndexes &ps)
A smart pointer to a reference counted object.
Control display of deprecation information.
A base class for modifiers of ParticlesTemp.
IMP::kernel::SingletonModifier SingletonModifier
Abstract class for containers of particles.
Various general useful macros for IMP.
#define IMP_REF_COUNTED_NONTRIVIAL_DESTRUCTOR(Name)
Various general useful macros for IMP.
Class to handle individual model particles.
Classes to handle individual model particles.
#define IMP_THROW(message, exception_name)
Throw an exception with a message.
Exception definitions and assertions.
IMP::kernel::SingletonScore SingletonScore
A shared container for Singletons.
Class for storing model, its restraints, constraints, and particles.