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

/**
 *  \file IMP/core/TripletConstraint.h
 *  \brief Use a TripletModifier applied to a ParticleTripletsTemp to
 *  maintain an invariant
 *
 *  Copyright 2007-2021 IMP Inventors. All rights reserved.
 */

#ifndef IMPCORE_TRIPLET_CONSTRAINT_H
#define IMPCORE_TRIPLET_CONSTRAINT_H

#include <IMP/core/core_config.h>
#include <IMP/internal/TupleConstraint.h>
#include <IMP/TripletModifier.h>
#include <IMP/TripletDerivativeModifier.h>

IMPCORE_BEGIN_NAMESPACE
//! Apply a TripletFunction to a Triplet
/** The score state is passed up to two TripletModifiers, one to
    apply before evaluation and the other after. The one after
    should take a DerivativeAccumulator as its last argument for
    TripletModifier::apply() and will only be called if
    the score was computed with derivatives.

    \see container::TripletsConstraint
 */
class TripletConstraint :
#if defined(IMP_DOXYGEN) || defined(SWIG)
    public Constraint
#else
    public IMP::internal::TupleConstraint<TripletModifier,
                                                  TripletDerivativeModifier>
#endif
    {
 public:
  /** \deprecated_at{2.1} Use the model/index constructor.
   */
  IMPCORE_DEPRECATED_METHOD_DECL(2.1)
  TripletConstraint(TripletModifier *before,
                      TripletDerivativeModifier *after, const ParticleTriplet& vt,
                      std::string name = "TripletConstraint %1%")
      : IMP::internal::TupleConstraint<
            TripletModifier, TripletDerivativeModifier>(before, after, vt,
                                                            name) {
    IMPCORE_DEPRECATED_METHOD_DEF(2.1, "Use the model/index constructor.");
  }

  TripletConstraint(TripletModifier *before,
                      TripletDerivativeModifier *after, Model *m,
                      const ParticleIndexTriplet& vt,
                      std::string name = "TripletConstraint %1%")
      : IMP::internal::TupleConstraint<
            TripletModifier, TripletDerivativeModifier>(before, after, m,
                                                            vt, 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(TripletConstraint);
#endif
};

IMPCORE_END_NAMESPACE

#endif /* IMPCORE_TRIPLET_CONSTRAINT_H */
