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

/**
 *  \file IMP/container/TripletContainerSet.h
 *  \brief Store a set of TripletContainers
 *
 *  Copyright 2007-2021 IMP Inventors. All rights reserved.
 */

#ifndef IMPCONTAINER_TRIPLET_CONTAINER_SET_H
#define IMPCONTAINER_TRIPLET_CONTAINER_SET_H

#include <IMP/container/container_config.h>
#include <IMP/TripletContainer.h>
#include <IMP/container_macros.h>
#include <IMP/internal/container_helpers.h>
#include <IMP/scoped.h>

IMPCONTAINER_BEGIN_NAMESPACE

//! Stores a set of TripletContainers
/** The input sets must be disjoint. This can change if there is
    demand for it.

    \usesconstraint
*/
class IMPCONTAINEREXPORT TripletContainerSet : public TripletContainer {
  Ints versions_;
  static TripletContainerSet *get_set(TripletContainer *c) {
    return dynamic_cast<TripletContainerSet *>(c);
  }
  virtual std::size_t do_get_contents_hash() const IMP_OVERRIDE;

 public:
  //! Construct and empty set
  TripletContainerSet(Model *m,
                        std::string name = "TripletContainerSet %1%");

  TripletContainerSet(const TripletContainersTemp &pc,
                        std::string name = "TripletContainerSet %1%");

  /** \brief apply modifier sm to all triplet containers */
  IMP_IMPLEMENT(void do_apply(const TripletModifier *sm) const);

  template <class M>
  void apply_generic(const M *m) const {
    apply(m);
  }

  ParticleIndexes get_all_possible_indexes() const;
  IMP_OBJECT_METHODS(TripletContainerSet);

  /** @name Methods to control the nested container

      This container merges a set of nested containers. To add
      or remove nested containers, use the methods below.
  */
  /**@{*/
  IMP_LIST_ACTION(public, TripletContainer, TripletContainers,
                  triplet_container, triplet_containers,
                  TripletContainer *, TripletContainers,
  {
    obj->set_was_used(true);
    versions_.clear();
  },
                  {}, );
/**@}*/

#ifndef IMP_DOXYGEN
  ParticleIndexTriplets get_indexes() const;
  ParticleIndexTriplets get_range_indexes() const;
  ModelObjectsTemp do_get_inputs() const;
#endif

 protected:
  //! Insert the contents of the container into output
  //! instead of output's current content
  virtual void get_indexes_in_place(ParticleIndexTriplets& output)
    const IMP_OVERRIDE;
};

IMPCONTAINER_END_NAMESPACE

#endif /* IMPCONTAINER_TRIPLET_CONTAINER_SET_H */
