IMP logo
IMP Reference Guide  develop.d97d4ead1f,2024/11/21
The Integrative Modeling Platform
TripletContainerSet.h
Go to the documentation of this file.
1 // Autogenerated by ../../../../tmp/nightly-build-472/imp-20241121.develop.d97d4ead1f/tools/build/make_containers.py
2 // from ../../../../tmp/nightly-build-472/imp-20241121.develop.d97d4ead1f/tools/build/container_templates/container/ClassnameContainerSet.h
3 // Do not edit - any changes will be lost!
4 
5 /**
6  * \file IMP/container/TripletContainerSet.h
7  * \brief Store a set of TripletContainers
8  *
9  * Copyright 2007-2022 IMP Inventors. All rights reserved.
10  */
11 
12 #ifndef IMPCONTAINER_TRIPLET_CONTAINER_SET_H
13 #define IMPCONTAINER_TRIPLET_CONTAINER_SET_H
14 
15 #include <IMP/container/container_config.h>
16 #include <IMP/TripletContainer.h>
17 #include <IMP/container_macros.h>
18 #include <IMP/internal/container_helpers.h>
19 #include <IMP/scoped.h>
20 
21 IMPCONTAINER_BEGIN_NAMESPACE
22 
23 //! Stores a set of TripletContainers
24 /** The input sets must be disjoint. This can change if there is
25  demand for it.
26 
27  \usesconstraint
28 */
29 class IMPCONTAINEREXPORT TripletContainerSet : public TripletContainer {
30  Ints versions_;
31  static TripletContainerSet *get_set(TripletContainer *c) {
32  return dynamic_cast<TripletContainerSet *>(c);
33  }
34  virtual std::size_t do_get_contents_hash() const override;
35 
36  public:
37  //! Construct an empty set
39  std::string name = "TripletContainerSet %1%");
40 
42  std::string name = "TripletContainerSet %1%");
43 
44  /** \brief apply modifier sm to all triplet containers */
45  IMP_IMPLEMENT(void do_apply(const TripletModifier *sm) const override);
46 
47  IMP_IMPLEMENT(void do_apply_moved(const TripletModifier *sm,
48  const ParticleIndexes &moved_pis,
49  const ParticleIndexes &reset_pis) const override);
50 
51  template <class M>
52  void apply_generic(const M *m) const {
53  apply(m);
54  }
55 
56  template <class M>
57  void apply_generic_moved(const M *m, const ParticleIndexes &moved_pis,
58  const ParticleIndexes &reset_pis) const {
59  apply_moved(m, moved_pis, reset_pis);
60  }
61 
64 
65  /** @name Methods to control the nested container
66 
67  This container merges a set of nested containers. To add
68  or remove nested containers, use the methods below.
69  */
70  /**@{*/
71  IMP_LIST_ACTION(public, TripletContainer, TripletContainers,
72  triplet_container, triplet_containers,
74  {
75  obj->set_was_used(true);
76  versions_.clear();
77  },
78  {}, );
79 /**@}*/
80 
81 #ifndef IMP_DOXYGEN
82  ParticleIndexTriplets get_indexes() const override;
84  ModelObjectsTemp do_get_inputs() const override;
85 #endif
86 
87  protected:
88  //! Insert the contents of the container into output
89  //! instead of output's current content
90  virtual void get_indexes_in_place(ParticleIndexTriplets& output)
91  const override;
92 };
93 
94 IMPCONTAINER_END_NAMESPACE
95 
96 #endif /* IMPCONTAINER_TRIPLET_CONTAINER_SET_H */
void apply_generic(const M *m) const
apply modifier sm to all triplet containers
void apply(const TripletModifier *sm) const
Apply a TripletModifier to the contents.
void apply_moved(const TripletModifier *sm, const ParticleIndexes &moved_pis, const ParticleIndexes &reset_pis) const
Apply a TripletModifier to the contents.
Temporarily set particle attributes.
A container for Triplets.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
#define IMP_IMPLEMENT(signature)
virtual ParticleIndexTriplets get_range_indexes() const =0
Macros to define containers of objects.
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:86
Stores a set of TripletContainers.
virtual ParticleIndexTriplets get_indexes() const =0
virtual ParticleIndexes get_all_possible_indexes() const =0
Get contained particles.
A base class for modifiers of ParticleTripletsTemp.
void apply_generic_moved(const TripletModifier *m, const ParticleIndexes &moved_pis, const ParticleIndexes &reset_pis) const
Just use apply_moved() in the base class.
A shared container for Triplets.
virtual ModelObjectsTemp do_get_inputs() const =0