IMP logo
IMP Reference Guide  2.6.0
The Integrative Modeling Platform
model_object_helpers.h
Go to the documentation of this file.
1 /**
2  * \file IMP/model_object_helpers.h \brief Single variable function.
3  *
4  * Copyright 2007-2016 IMP Inventors. All rights reserved.
5  */
6 
7 #ifndef IMPKERNEL_MODEL_OBJECT_HELPERS_H
8 #define IMPKERNEL_MODEL_OBJECT_HELPERS_H
9 
10 #include <IMP/kernel_config.h>
11 #include "ModelObject.h"
12 #include "particle_index.h"
13 #include "ScoreState.h"
14 IMPKERNEL_BEGIN_NAMESPACE
15 
16 /** Inherit from this for objects that take particle arguments and read from
17  them. */
18 class IMPKERNELEXPORT ParticleInputs {
19  public:
20  /** Get the list of ModelObjects read when passed the given list of particles
21  is used.*/
22  ModelObjectsTemp get_inputs(Model *m,
23  const ParticleIndexes &pis) const;
24 
25  protected:
26  /** Overload this method to specify the inputs.*/
27  virtual ModelObjectsTemp do_get_inputs(Model *m,
28  const ParticleIndexes &pis) const = 0;
29  virtual ~ParticleInputs() {}
30 };
31 
32 /** Inherit from this for objects that take particle arguments and modify
33  them. */
34 class IMPKERNELEXPORT ParticleOutputs {
35  public:
36  /** Get the list of ModelObjects changed when passed the given list of
37  particles is used.*/
38  ModelObjectsTemp get_outputs(Model *m,
39  const ParticleIndexes &pis) const;
40 
41  protected:
42  /** Overload this method to specify the outputs.*/
43  virtual ModelObjectsTemp do_get_outputs(Model *m,
44  const ParticleIndexes &pis) const = 0;
45  virtual ~ParticleOutputs() {}
46 };
47 
48 /** Compute the set of score states required by the passed list of
49  ModelObjects. This will compute dependencies if needed.*/
50 IMPKERNELEXPORT ScoreStatesTemp
52  ScoreStatesTemp exclude = ScoreStatesTemp());
53 
54 IMPKERNEL_END_NAMESPACE
55 
56 #endif /* IMPKERNEL_MODEL_OBJECT_HELPERS_H */
Various general useful functions for IMP.
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:72
ScoreStatesTemp get_required_score_states(const ModelObjectsTemp &mos, ScoreStatesTemp exclude=ScoreStatesTemp())
Shared score state.
Single variable function.
IMP::Vector< IMP::WeakPointer< ScoreState > > ScoreStatesTemp
Definition: base_types.h:90