9 #ifndef IMPKERNEL_SCOPED_H
10 #define IMPKERNEL_SCOPED_H
12 #include <IMP/kernel_config.h>
24 IMPKERNEL_BEGIN_NAMESPACE
29 template <
class Key,
class Value>
37 { pi_ = get_invalid_index<ParticleIndexTag>(); },
42 m_->add_cache_attribute(key_, pi_, value);
45 if (pi_ != get_invalid_index<ParticleIndexTag>()) {
46 m_->remove_attribute(key_, pi_);
54 template <
class Key,
class Value>
63 { pi_ = get_invalid_index<ParticleIndexTag>(); },
68 old_ = m_->get_attribute(key_, pi_);
69 m_->set_attribute(key_, pi_, value);
72 if (pi_ != get_invalid_index<ParticleIndexTag>()) {
73 m_->set_attribute(key_, pi_, old_);
78 typedef ScopedSetAttribute<FloatKey, Float> ScopedSetFloatAttribute;
80 IMPKERNEL_END_NAMESPACE
Control display of deprecation information.
Control display of deprecation information.
Used to hold a set of related restraints.
Temporarily change something; undo the change when this object is destroyed.
Storage of a model, its restraints, constraints and particles.
#define IMP_RAII(Name, args, Initialize, Set, Reset, Show)
Declares RAII-style methods in a class.
A smart pointer to a reference counted object.
Base for a simple primitive-like type.
Logging and error reporting support.
A nullptr-initialized pointer to an IMP Object.
Exception definitions and assertions.
Class to handle individual model particles.
ParticleIndex get_index() const
returns the particle index of this particle in its model
Various general useful macros for IMP.