IMP  2.1.0
The Integrative Modeling Platform
container/generic.h
Go to the documentation of this file.
1 /**
2  * \file IMP/container/generic.h \brief Various important functionality
3  * for implementing decorators.
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPCONTAINER_GENERIC_H
10 #define IMPCONTAINER_GENERIC_H
11 
12 #include <IMP/container/container_config.h>
13 #include <IMP/kernel/internal/ContainerRestraint.h>
14 #include <IMP/kernel/internal/ContainerConstraint.h>
15 #include "InContainerPairFilter.h"
16 
17 IMPCONTAINER_BEGIN_NAMESPACE
18 
19 /** Create a restraint from a score and a container. The resulting restraint
20  is, in general, more efficient than creating an, eg, PairsRestraint.
21 */
22 template <class Score, class Container>
24  std::string name = std::string()) {
25  return IMP::internal::create_container_restraint(s, c, name);
26 }
27 
28 /** Helper to create a ContainerConstraint.
29  */
30 template <class Container, class Before, class After>
31 inline Constraint *create_constraint(Before *b, After *a, Container *c,
32  std::string name = std::string()) {
33  return IMP::internal::create_container_constraint(c, b, a, name);
34 }
35 
36 /** Create a filter that returns whether the pair, or its flip is
37  contained in the passed container.
38 
39  \note This is different than the InContainerPairFilter.*/
40 template <class Container>
42  std::string name =
43  std::string()) {
44  return new InContainerPairFilter(c, name);
45 }
46 
47 IMPCONTAINER_END_NAMESPACE
48 
49 #endif /* IMPCONTAINER_GENERIC_H */
A filter which returns true if a container containers the Pair.
A filter for Pairs.
Abstract class for containers of particles.
A restraint is a term in an IMP ScoringFunction.
Abstract predicate function.
PairPredicate * create_in_container_filter(Container *c, std::string name=std::string())
Implement a constraint on the Model.
Constraint * create_constraint(Before *b, After *a, Container *c, std::string name=std::string())
kernel::Restraint * create_restraint(Score *s, Container *c, std::string name=std::string())