IMP  2.1.1
The Integrative Modeling Platform
SingletonsConstraint.h
Go to the documentation of this file.
1 /**
2  * \file IMP/container/SingletonsConstraint.h
3  * \brief Use a SingletonModifier applied to a ParticlesTemp to
4  * maintain an invariant
5  *
6  * WARNING This file was generated from SingletonsConstraint.h
7  * in /tmp/nightly-build-61576/imp-2.1.1/tools/build/container_templates/container
8  * by tools/maintenance/setup_containers.py.
9  *
10  * Copyright 2007-2013 IMP Inventors. All rights reserved.
11  */
12 
13 #ifndef IMPCONTAINER_SINGLETONS_CONSTRAINT_H
14 #define IMPCONTAINER_SINGLETONS_CONSTRAINT_H
15 
16 #include <IMP/container/container_config.h>
17 #include <IMP/SingletonContainer.h>
18 #include <IMP/SingletonModifier.h>
19 #include <IMP/Constraint.h>
20 #include <IMP/base/object_macros.h>
21 #include <IMP/score_state_macros.h>
22 #include <IMP/kernel/internal/ContainerConstraint.h>
23 
24 IMPKERNEL_BEGIN_NAMESPACE
25 // for swig
26 class SingletonContainer;
27 class SingletonModifier;
28 IMPKERNEL_END_NAMESPACE
29 
30 IMPCONTAINER_BEGIN_NAMESPACE
31 //! Apply a SingletonFunction to a SingletonContainer to maintain an invariant
32 /** The score state is passed up to two SingletonModifiers, one to
33  apply before evaluation and the other after. The one after
34  should take a DerivativeAccumulator as its last argument for
35  SingletonModifier::apply() and will only be called if
36  the score was computed with derivatives.
37 
38  \see core::SingletonConstraint
39  */
41 #if defined(SWIG) || defined(IMP_DOXYGEN)
42  public Constraint
43 #else
44  public IMP::kernel::internal::ContainerConstraint<
45  SingletonModifier, SingletonModifier, SingletonContainer>
46 #endif
47  {
48  typedef IMP::kernel::internal::ContainerConstraint<
50 
51  public:
52  /** \param[in] c The Container to hold the elements to process
53  \param[in] before The SingletonModifier to apply to all elements
54  before evaluate.
55  \param[in] after The SingletonModifier to apply to all elements
56  after evaluate.
57  \param[in] name The object name
58  */
60  SingletonModifier *after,
61  SingletonContainerAdaptor c,
62  std::string name = "SingletonConstraint %1%")
63  : P(before, after, c, name) {}
64 #if defined(IMP_DOXYGEN) || defined(SWIG)
65  protected:
66  void do_update_attributes();
67  void do_update_derivatives(DerivativeAccumulator *da);
68  virtual kernel::ModelObjectsTemp do_get_inputs() const;
69  virtual kernel::ModelObjectsTemp do_get_outputs() const;
71 #endif
72 };
73 
75 
76 IMPCONTAINER_END_NAMESPACE
77 
78 #endif /* IMPCONTAINER_SINGLETONS_CONSTRAINT_H */
Import IMP/kernel/SingletonModifier.h in the namespace.
Class for adding derivatives from restraints to the model.
Apply a SingletonFunction to a SingletonContainer to maintain an invariant.
SingletonsConstraint(SingletonModifier *before, SingletonModifier *after, SingletonContainerAdaptor c, std::string name="SingletonConstraint %1%")
Import IMP/kernel/SingletonContainer.h in the namespace.
IMP::kernel::SingletonContainer SingletonContainer
A base class for modifiers of ParticlesTemp.
IMP::kernel::SingletonModifier SingletonModifier
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Import IMP/kernel/Constraint.h in the namespace.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing sets of objects.
Import IMP/kernel/score_state_macros.h in the namespace.
Various general useful macros for IMP.
Implement a constraint on the Model.
A shared container for Singletons.