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
A nullptr-initialized pointer to an IMP Object.
A smart pointer to a reference counted object.
Control display of deprecation information.
Various general useful macros for IMP.
Control display of deprecation information.
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.
#define IMP_RAII(Name, args, Initialize, Set, Reset, Show)
Declares RAII-style methods in a class.
Exception definitions and assertions.