// Autogenerated by tools\build\make_containers.py
// from tools\build\container_templates\container\ClassnamesConstraint.h
// Do not edit - any changes will be lost!

/**
 *  \file IMP/container/QuadsConstraint.h
 *  \brief Use a QuadModifier applied to a ParticleQuadsTemp to
 *  maintain an invariant
 *
 *  Copyright 2007-2021 IMP Inventors. All rights reserved.
 */

#ifndef IMPCONTAINER_QUADS_CONSTRAINT_H
#define IMPCONTAINER_QUADS_CONSTRAINT_H

#include <IMP/container/container_config.h>
#include <IMP/QuadContainer.h>
#include <IMP/QuadModifier.h>
#include <IMP/Constraint.h>
#include <IMP/object_macros.h>
#include <IMP/internal/ContainerConstraint.h>

IMPKERNEL_BEGIN_NAMESPACE
// for swig
class QuadContainer;
class QuadModifier;
IMPKERNEL_END_NAMESPACE

IMPCONTAINER_BEGIN_NAMESPACE
//! Apply a QuadFunction to a QuadContainer to maintain an invariant
/** The score state is passed up to two QuadModifiers, one to
    apply before evaluation and the other after. The one after
    should take a DerivativeAccumulator as its last argument for
    QuadModifier::apply() and will only be called if
    the score was computed with derivatives.

    \see core::QuadConstraint
 */
class QuadsConstraint :
#if defined(SWIG) || defined(IMP_DOXYGEN)
    public Constraint
#else
    public IMP::internal::ContainerConstraint<
        QuadModifier, QuadModifier, QuadContainer>
#endif
    {
  typedef IMP::internal::ContainerConstraint<
      QuadModifier, QuadModifier, QuadContainer> P;

 public:
  /** \param[in] c The Container to hold the elements to process
      \param[in] before The QuadModifier to apply to all elements
      before evaluate.
      \param[in] after The QuadModifier to apply to all elements
      after evaluate.
      \param[in] name The object name
   */
  QuadsConstraint(QuadModifier *before, QuadModifier *after,
                       QuadContainerAdaptor c,
                       std::string name = "QuadsConstraint %1%")
      : P(before, after, c, name) {}
#if defined(IMP_DOXYGEN) || defined(SWIG)
 protected:
  void do_update_attributes();
  void do_update_derivatives(DerivativeAccumulator *da);
  virtual ModelObjectsTemp do_get_inputs() const;
  virtual ModelObjectsTemp do_get_outputs() const;
  IMP_OBJECT_METHODS(QuadsConstraint);
#endif
};

IMP_OBJECTS(QuadsConstraint, QuadsConstraints);

IMPCONTAINER_END_NAMESPACE

#endif /* IMPCONTAINER_QUADS_CONSTRAINT_H */
