/** * \file CLASSNAMEsConstraint.h * \brief Use a CLASSNAMEModifier applied to a PLURALVARIABLETYPE to * maintain an invariant * * This file is generated by a script (core/tools/make-container). * Do not edit directly. * * Copyright 2007-2010 IMP Inventors. All rights reserved. */ #ifndef IMPCONTAINER_HEADERNAMES_CONSTRAINT_H #define IMPCONTAINER_HEADERNAMES_CONSTRAINT_H #include "container_config.h" #include #include #include IMP_BEGIN_NAMESPACE // for swig class CLASSNAMEContainer; class CLASSNAMEModifier; IMP_END_NAMESPACE IMPCONTAINER_BEGIN_NAMESPACE //! Apply a CLASSNAMEFunction to a CLASSNAMEContainer to maintain an invariant /** The score state is passed up to two CLASSNAMEModifiers, one to apply before evaluation and the other after. The one after should take a DerivativeAccumulator as its last argument for CLASSNAMEModifier::apply() and will only be called if the score was computed with derivatives. An example showing a how to use such a score state to maintain a cover of the atoms of a protein by a sphere per residue. \verbinclude cover_particles.py \see CLASSNAMEConstraint */ class IMPCONTAINEREXPORT CLASSNAMEsConstraint : public Constraint { IMP::internal::OwnerPointer f_; IMP::internal::OwnerPointer af_; IMP::internal::OwnerPointer c_; public: /** \param[in] c The Container to hold the elements to process \param[in] before The CLASSNAMEModifier to apply to all elements before evaluate. \param[in] after The CLASSNAMEModifier to apply to all elements after evaluate. \param[in] name The object name */ CLASSNAMEsConstraint(CLASSNAMEContainer *c, CLASSNAMEModifier *before, CLASSNAMEModifier *after, std::string name="CLASSNAMEConstraint %1%"); //! Apply this modifier to all the elements after an evaluate void set_after_evaluate_modifier(CLASSNAMEModifier* f) { af_=f; } //! Apply this modifier to all the elements before an evaluate void set_before_evaluate_modifier(CLASSNAMEModifier* f) { f_=f; } IMP_CONSTRAINT(CLASSNAMEsConstraint); }; IMP_OBJECTS(CLASSNAMEsConstraint,CLASSNAMEsConstraints); IMPCONTAINER_END_NAMESPACE #endif /* IMPCONTAINER_HEADERNAMES_CONSTRAINT_H */