13 #ifndef IMPCONTAINER_PREDICATE_SINGLETONS_RESTRAINT_H
14 #define IMPCONTAINER_PREDICATE_SINGLETONS_RESTRAINT_H
16 #include <IMP/container/container_config.h>
18 #include <IMP/internal/InternalDynamicListSingletonContainer.h>
19 #include <IMP/compatibility/map.h>
26 IMPCONTAINER_BEGIN_NAMESPACE
42 typedef IMP::kernel::internal::InternalDynamicListSingletonContainer List;
43 typedef compatibility::map<unsigned int, base::Pointer<List> >
48 mutable bool updated_;
49 bool error_on_unknown_;
50 void update_lists_if_necessary()
const;
54 SingletonContainerAdaptor input,
55 std::string name=
"PredicateSingletonsRestraint %1%");
62 template <
class Score>
65 "You must add this restraint to the model"
66 <<
" first, sorry, this can be fixed.");
68 score->get_name()+
" input"));
70 restraints_.back()->set_model(get_model());
71 restraints_.back()->set_was_used(
true);
72 containers_[predicate_value]=c;
77 template <
class Score>
82 "You must add this restraint to the model"
83 <<
" first, sorry, this can be fixed.");
85 score->get_name()+
" input"));
87 restraints_.back()->set_model(get_model());
92 set_score<SingletonScore>(predicate_value, score);
95 set_unknown_score<SingletonScore>(score);
102 error_on_unknown_=tf;
109 return containers_.find(predicate_value)->second
119 Restraints do_create_current_decomposition() const;
122 IMPCONTAINER_END_NAMESPACE