IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
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
15IMPKERNEL_BEGIN_NAMESPACE
16
17//! Return a functor that returns true when the predicate has a certain value.
18template <class Pred>
19inline 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.
27template <class Pred>
28inline 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
33IMPKERNEL_END_NAMESPACE
34
35#endif /* IMPKERNEL_FUNCTOR_H */
Class for storing model, its restraints, constraints, and particles.
Definition Model.h:111
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
internal::PredicateEquals< Pred, false > make_predicate_not_equal(const Pred *p, Model *m, int value)
Definition functor.h:28