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

/**
 *  \file IMP/container/EventSingletonsOptimizerState.h
 *  \brief Define some predicates.
 *
 *  Copyright 2007-2021 IMP Inventors. All rights reserved.
 */

#ifndef IMPCONTAINER_EVENT_SINGLETONS_OPTIMIZER_STATE_H
#define IMPCONTAINER_EVENT_SINGLETONS_OPTIMIZER_STATE_H

#include <IMP/container/container_config.h>
#include <IMP/SingletonPredicate.h>
#include <IMP/OptimizerState.h>
#include <IMP/SingletonContainer.h>

IMPCONTAINER_BEGIN_NAMESPACE

/** Raise an IMP::EventException when a certain condition is met.
    Currently the supported logic is when the number of items in the
    container for which the predicate returns a certain value is in the
    range [min_count, max_count).
 */
class IMPCONTAINEREXPORT EventSingletonsOptimizerState : public OptimizerState {
  IMP::PointerMember<SingletonPredicate> pred_;
  IMP::PointerMember<SingletonContainer> container_;
  int v_;
  int min_, max_;

 public:
  EventSingletonsOptimizerState(SingletonPredicate *pred,
                                SingletonContainerAdaptor container, int value,
                                int min_count, int max_count,
                                std::string name =
                                    "ConstSingletonPredicate%1%");
  virtual void update() IMP_OVERRIDE;
  IMP_OBJECT_METHODS(EventSingletonsOptimizerState);
};

IMPCONTAINER_END_NAMESPACE

#endif /* IMPCONTAINER_EVENT_SINGLETONS_OPTIMIZER_STATE_H */
