IMP  2.2.1
The Integrative Modeling Platform
SingletonContainerSet.h
Go to the documentation of this file.
1 /**
2  * \file IMP/container/SingletonContainerSet.h
3  * \brief Store a set of SingletonContainers
4  *
5  * This file is generated by a script (tools/maintenance/make-container).
6  * Do not edit directly.
7  *
8  * Copyright 2007-2014 IMP Inventors. All rights reserved.
9  */
10 
11 #ifndef IMPCONTAINER_SINGLETON_CONTAINER_SET_H
12 #define IMPCONTAINER_SINGLETON_CONTAINER_SET_H
13 
14 #include <IMP/container/container_config.h>
15 #include <IMP/SingletonContainer.h>
16 #include <IMP/container_macros.h>
17 #include <IMP/kernel/internal/container_helpers.h>
18 #include <IMP/scoped.h>
19 
20 IMPCONTAINER_BEGIN_NAMESPACE
21 
22 //! Stores a set of SingletonContainers
23 /** The input sets must be disjoint. This can change if there is
24  demand for it.
25 
26  \usesconstraint
27 */
28 class IMPCONTAINEREXPORT SingletonContainerSet : public SingletonContainer {
29  Ints versions_;
30  static SingletonContainerSet *get_set(SingletonContainer *c) {
31  return dynamic_cast<SingletonContainerSet *>(c);
32  }
33  virtual std::size_t do_get_contents_hash() const IMP_OVERRIDE;
34 
35  public:
36  //! Construct and empty set
38  std::string name = "SingletonContainerSet %1%");
39 
41  std::string name = "SingletonContainerSet %1%");
42 
43  /** \brief apply modifer sm to all singleton containers */
44  IMP_IMPLEMENT(void do_apply(const SingletonModifier *sm) const);
45 
46  template <class M>
47  void apply_generic(const M *m) const {
48  apply(m);
49  }
50 
53 
54  /** @name Methods to control the nested container
55 
56  This container merges a set of nested containers. To add
57  or remove nested containers, use the methods below.
58  */
59  /**@{*/
60  IMP_LIST_ACTION(public, SingletonContainer, SingletonContainers,
61  singleton_container, singleton_containers,
63  {
64  obj->set_was_used(true);
65  versions_.clear();
66  },
67  {}, );
68 /**@}*/
69 
70 #ifndef IMP_DOXYGEN
74 #endif
75 };
76 
77 IMPCONTAINER_END_NAMESPACE
78 
79 #endif /* IMPCONTAINER_SINGLETON_CONTAINER_SET_H */
void apply_generic(const M *m) const
apply modifer sm to all singleton containers
Import IMP/kernel/scoped.h in the namespace.
virtual ParticleIndexes get_all_possible_indexes() const =0
Get contained particles.
Import IMP/kernel/SingletonContainer.h in the namespace.
Stores a set of SingletonContainers.
Import IMP/kernel/container_macros.h in the namespace.
A base class for modifiers of kernel::ParticlesTemp.
#define IMP_IMPLEMENT(signature)
virtual kernel::ParticleIndexes get_range_indexes() const =0
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
virtual kernel::ParticleIndexes get_indexes() const =0
virtual ModelObjectsTemp do_get_inputs() const =0
IMP::base::Vector< IMP::base::WeakPointer< SingletonContainer > > SingletonContainersTemp
void apply(const SingletonModifier *sm) const
Apply a SingletonModifier to the contents.
IMP::base::Vector< IMP::base::Pointer< SingletonContainer > > SingletonContainers
A shared container for Singletons.
Class for storing model, its restraints, constraints, and particles.
Definition: kernel/Model.h:72