IMP  2.1.1
The Integrative Modeling Platform
InContainerPairFilter.h
Go to the documentation of this file.
1 /**
2  * \file IMP/container/InContainerPairFilter.h
3  * \brief A filter for Pairs.
4  *
5  * This file is generated by a script (core/tools/make-containers).
6  * Do not edit directly.
7  *
8  * Copyright 2007-2013 IMP Inventors. All rights reserved.
9  */
10 
11 #ifndef IMPCONTAINER_IN_CONTAINER_PAIR_FILTER_H
12 #define IMPCONTAINER_IN_CONTAINER_PAIR_FILTER_H
13 
14 #include <IMP/container/container_config.h>
15 #include <IMP/PairPredicate.h>
16 #include <IMP/PairContainer.h>
17 #include <IMP/kernel/internal/container_helpers.h>
18 #include "internal/PairContainerIndex.h"
19 #include <IMP/pair_macros.h>
20 #include <IMP/base/object_macros.h>
22 
23 IMPCONTAINER_BEGIN_NAMESPACE
24 
25 //! A filter which returns true if a container containers the Pair
26 /** This predicate returns 1 if the passed tuple is in the container.
27  \note Use the handle_permutations parameter to the constructor to
28  determine whether only exact matchers, or matches under permutation
29  are considered matching. By default they are are.
30  */
31 class IMPCONTAINEREXPORT InContainerPairFilter
32  : public PairPredicate {
34 
35  public:
37  std::string name = "PairFilter %1%");
38  InContainerPairFilter(PairContainer *c, bool handle_permutations,
39  std::string name = "PairFilter %1%");
40 
41  virtual int get_value_index(kernel::Model *, const ParticleIndexPair& vt) const IMP_OVERRIDE {
42  return c_->get_contains(vt);
43  }
45  const IMP_OVERRIDE {
47  ret.push_back(c_);
48  return ret;
49  }
52 };
53 
55 
56 IMPCONTAINER_END_NAMESPACE
57 
58 #endif /* IMPCONTAINER_IN_CONTAINER_PAIR_FILTER_H */
A filter which returns true if a container containers the Pair.
Import IMP/kernel/pair_macros.h in the namespace.
ParticlesTemp get_particles(kernel::Model *m, const ParticleIndexes &ps)
A shared container for Pairs.
virtual kernel::ModelObjectsTemp do_get_inputs(kernel::Model *m, const kernel::ParticleIndexes &pi) const
Import IMP/kernel/PairContainer.h in the namespace.
Import IMP/kernel/PairPredicate.h in the namespace.
Various general useful macros for IMP.
#define IMP_PAIR_PREDICATE_METHODS(Name)
Define extra the functions needed for a PairPredicate.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Abstract predicate function.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing sets of objects.
Various general useful macros for IMP.
virtual int get_value_index(kernel::Model *m, const ParticleIndexPair &vt) const
Compute the predicate and the derivative if needed.
Class for storing model, its restraints, constraints, and particles.