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