IMP  2.0.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-2013 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>
21 make_predicate_equal(const Pred *p,
22  Model *m,
23  int value) {
24  return internal::PredicateEquals<Pred, true>(p, m, value);
25 }
26 
27 /** Return a functor that returns true when the predicate doesn't have a certain
28  value.*/
29 template <class Pred>
30 inline internal::PredicateEquals<Pred, false>
32  Model *m,
33  int value) {
34  return internal::PredicateEquals<Pred, false>(p, m, value);
35 }
36 
37 IMPKERNEL_END_NAMESPACE
38 
39 #endif /* IMPKERNEL_FUNCTOR_H */