IMP  2.2.1
The Integrative Modeling Platform
kernel/functor.h
Go to the documentation of this file.
1 /**
2  * \file IMP/kernel/functor.h \brief Various important functionality
3  * for implementing decorators.
4  *
5  * Copyright 2007-2014 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPKERNEL_FUNCTOR_H
10 #define IMPKERNEL_FUNCTOR_H
11 
12 #include <IMP/kernel/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
18  value.*/
19 template <class Pred>
20 inline internal::PredicateEquals<Pred, true> make_predicate_equal(const Pred *p,
21  Model *m,
22  int value) {
23  return internal::PredicateEquals<Pred, true>(p, m, value);
24 }
25 
26 /** Return a functor that returns true when the predicate doesn't have a certain
27  value.*/
28 template <class Pred>
29 inline internal::PredicateEquals<Pred, false> make_predicate_not_equal(
30  const Pred *p, Model *m, int value) {
31  return internal::PredicateEquals<Pred, false>(p, m, value);
32 }
33 
34 IMPKERNEL_END_NAMESPACE
35 
36 #endif /* IMPKERNEL_FUNCTOR_H */
internal::PredicateEquals< Pred, true > make_predicate_equal(const Pred *p, Model *m, int value)
internal::PredicateEquals< Pred, false > make_predicate_not_equal(const Pred *p, Model *m, int value)
Class for storing model, its restraints, constraints, and particles.
Definition: kernel/Model.h:72