IMP logo
IMP Reference Guide  2.20.2
The Integrative Modeling Platform
functor.h
Go to the documentation of this file.
1 /**
2  * \file IMP/functor.h
3  * \brief Helper functionality for functors.
4  *
5  * Copyright 2007-2022 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPKERNEL_FUNCTOR_H
10 #define IMPKERNEL_FUNCTOR_H
11 
12 #include <IMP/kernel_config.h>
13 #include "internal/functors.h"
14 
15 IMPKERNEL_BEGIN_NAMESPACE
16 
17 //! Return a functor that returns true when the predicate has a certain value.
18 template <class Pred>
19 inline internal::PredicateEquals<Pred, true> make_predicate_equal(const Pred *p,
20  Model *m,
21  int value) {
22  return internal::PredicateEquals<Pred, true>(p, m, value);
23 }
24 
25 //! Return a functor that returns true when the predicate doesn't have
26 //! a certain value.
27 template <class Pred>
28 inline internal::PredicateEquals<Pred, false> make_predicate_not_equal(
29  const Pred *p, Model *m, int value) {
30  return internal::PredicateEquals<Pred, false>(p, m, value);
31 }
32 
33 IMPKERNEL_END_NAMESPACE
34 
35 #endif /* IMPKERNEL_FUNCTOR_H */
internal::PredicateEquals< Pred, false > make_predicate_not_equal(const Pred *p, Model *m, int value)
Definition: functor.h:28
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:86
internal::PredicateEquals< Pred, true > make_predicate_equal(const Pred *p, Model *m, int value)
Return a functor that returns true when the predicate has a certain value.
Definition: functor.h:19