IMP logo
IMP Reference Guide  2.5.0
The Integrative Modeling Platform
InContainerSingletonFilter.h
Go to the documentation of this file.
1 // Autogenerated by ../../../../tmp/nightly-build-6636/imp-2.5.0/tools/build/make_containers.py
2 // from ../../../../tmp/nightly-build-6636/imp-2.5.0/tools/build/container_templates/container/InContainerClassnameFilter.h
3 // Do not edit - any changes will be lost!
4 
5 /**
6  * \file IMP/container/InContainerSingletonFilter.h
7  * \brief A filter for Singletons.
8  *
9  * Copyright 2007-2015 IMP Inventors. All rights reserved.
10  */
11 
12 #ifndef IMPCONTAINER_IN_CONTAINER_SINGLETON_FILTER_H
13 #define IMPCONTAINER_IN_CONTAINER_SINGLETON_FILTER_H
14 
15 #include <IMP/container/container_config.h>
16 #include <IMP/SingletonPredicate.h>
17 #include <IMP/SingletonContainer.h>
18 #include <IMP/internal/container_helpers.h>
19 #include "internal/SingletonContainerIndex.h"
20 #include <IMP/singleton_macros.h>
21 #include <IMP/object_macros.h>
22 #include <IMP/warning_macros.h>
23 
24 IMPCONTAINER_BEGIN_NAMESPACE
25 
26 //! A filter which returns true if a container containers the Singleton
27 /** This predicate returns 1 if the passed tuple is in the container.
28  \note Use the handle_permutations parameter to the constructor to
29  determine whether only exact matchers, or matches under permutation
30  are considered matching. By default they are are.
31  */
32 class IMPCONTAINEREXPORT InContainerSingletonFilter
33  : public SingletonPredicate {
35 
36  public:
38  std::string name = "SingletonFilter %1%");
39  InContainerSingletonFilter(SingletonContainer *c, bool handle_permutations,
40  std::string name = "SingletonFilter %1%");
41 
42  virtual int get_value_index(Model *, ParticleIndex vt) const
43  IMP_OVERRIDE {
44  return c_->get_contains(vt);
45  }
47  Model *m, const ParticleIndexes &pi) const IMP_OVERRIDE {
49  ret.push_back(c_);
50  return ret;
51  }
54 };
55 
57 
58 IMPCONTAINER_END_NAMESPACE
59 
60 #endif /* IMPCONTAINER_IN_CONTAINER_SINGLETON_FILTER_H */
Various general useful macros for IMP.
A container for Singletons.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Macros for various classes.
ParticlesTemp get_particles(Model *m, const ParticleIndexes &ps)
Define SingletonPredicate.
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:72
A filter which returns true if a container containers the Singleton.
virtual int get_value_index(Model *, ParticleIndex vt) const
Compute the predicate and the derivative if needed.
Various general useful macros for IMP.
A shared container for Singletons.
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pi) const
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing sets of objects.
Definition: object_macros.h:42
#define IMP_SINGLETON_PREDICATE_METHODS(Name)
Define extra the functions needed for a SingletonPredicate.
Abstract predicate function.
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.