IMP
2.0.0
The Integrative Modeling Platform
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
InContainerSingletonFilter.h
Go to the documentation of this file.
1
/**
2
* \file IMP/container/InContainerSingletonFilter.h
3
* \brief A filter for Singletons.
4
*
5
* This file is generated by a script (core/tools/make-containers).
6
* Do not edit directly.
7
*
8
* Copyright 2007-2013 IMP Inventors. All rights reserved.
9
*/
10
11
#ifndef IMPCONTAINER_IN_CONTAINER_SINGLETON_FILTER_H
12
#define IMPCONTAINER_IN_CONTAINER_SINGLETON_FILTER_H
13
14
#include <IMP/container/container_config.h>
15
#include <
IMP/SingletonPredicate.h
>
16
#include <
IMP/SingletonContainer.h
>
17
#include <IMP/internal/container_helpers.h>
18
#include "internal/SingletonContainerIndex.h"
19
#include <
IMP/singleton_macros.h
>
20
#include <
IMP/base/warning_macros.h
>
21
22
IMPCONTAINER_BEGIN_NAMESPACE
23
24
25
//! A filter which returns true if a container containers the Singleton
26
/** This predicate returns 1 if the passed tuple is in the container.
27
\note Use the handle_permutations parameter to the constructor to
28
determine whether only exact matchers, or matches under permutation
29
are considered matching. By default they are are.
30
*/
31
class
IMPCONTAINEREXPORT
InContainerSingletonFilter
:
32
public
SingletonPredicate
33
{
34
IMP::base::OwnerPointer<internal::SingletonContainerIndex>
c_;
35
public
:
36
InContainerSingletonFilter
(
SingletonContainer
*c,
37
std::string name=
"SingletonFilter %1%"
);
38
InContainerSingletonFilter
(
SingletonContainer
*c,
39
bool
handle_permutations,
40
std::string name=
"SingletonFilter %1%"
);
41
42
IMP_INDEX_SINGLETON_PREDICATE
(
InContainerSingletonFilter
,{
43
IMP_UNUSED
(m);
44
return
c_->get_contains(pi);
45
},{
46
ModelObjectsTemp ret;
47
ret+=
IMP::get_particles
(m, pi);
48
ret.push_back(c_);
49
return
ret;
50
});
51
};
52
53
54
IMP_OBJECTS
(
InContainerSingletonFilter
,
InContainerSingletonFilters
);
55
56
IMPCONTAINER_END_NAMESPACE
57
58
#endif
/* IMPCONTAINER_IN_CONTAINER_SINGLETON_FILTER_H */