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