IMP
2.0.0
The Integrative Modeling Platform
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
kernel/SingletonModifier.h
Go to the documentation of this file.
1
/**
2
* \file IMP/kernel/SingletonModifier.h
3
* \brief A Modifier on ParticlesTemp
4
*
5
* WARNING This file was generated from SingletonModifier.h
6
* in /tmp/nightly-build-5687/imp-2.0.0/tools/build/container_templates/kernel
7
* by tools/maintenance/setup_containers.py.
8
*
9
* Copyright 2007-2013 IMP Inventors. All rights reserved.
10
*/
11
12
#ifndef IMPKERNEL_SINGLETON_MODIFIER_H
13
#define IMPKERNEL_SINGLETON_MODIFIER_H
14
15
#include <IMP/kernel/kernel_config.h>
16
#include "
DerivativeAccumulator.h
"
17
#include "
base_types.h
"
18
#include "
ParticleTuple.h
"
19
#include "internal/container_helpers.h"
20
#include "
input_output_macros.h
"
21
22
IMPKERNEL_BEGIN_NAMESPACE
23
24
//! A base class for modifiers of ParticlesTemp
25
/** The primary function of such a class is to change
26
the passed particles.
27
28
\see IMP::SingletonFunctor
29
30
Implementors should see IMP_SINGLETON_MODIFIER(). Also see
31
SingletonDerivativeModifier.
32
*/
33
class
IMPKERNELEXPORT
SingletonModifier
:
public
base::Object
34
{
35
public
:
36
typedef
Particle
*
Argument
;
37
typedef
ParticleIndex
IndexArgument
;
38
SingletonModifier
(std::string name=
"SingletonModifier %1%"
);
39
40
/** Apply the function to a single value*/
41
virtual
void
apply(
Particle
*)
const
=0;
42
43
/** Apply the function to a single value*/
44
virtual
void
apply_index
(
Model
*m,
ParticleIndex
v)
const
{
45
apply(internal::get_particle(m, v));
46
}
47
48
/** Apply the function to a collection of ParticlesTemp */
49
/** If bounds are passed, only apply to ones between the upper and
50
lower bounds.*/
51
virtual
void
apply_indexes(
Model
*m,
const
ParticleIndexes
&o,
52
unsigned
int
lower_bound,
53
unsigned
int
upper_bound)
const
{
54
for
(
unsigned
int
i=lower_bound; i < upper_bound; ++i) {
55
apply_index(m, o[i]);
56
}
57
}
58
IMP_INPUTS_DECL
(
SingletonModifier
);
59
IMP_OUTPUTS_DECL
(
SingletonModifier
);
60
};
61
62
63
64
IMPKERNEL_END_NAMESPACE
65
66
#endif
/* IMPKERNEL_SINGLETON_MODIFIER_H */