IMP  2.3.0
The Integrative Modeling Platform
kernel/model_object_helpers.h
Go to the documentation of this file.
1 /**
2  * \file IMP/kernel/model_object_helpers.h \brief Single variable function.
3  *
4  * Copyright 2007-2014 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/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(kernel::Model *m,
23  const ParticleIndexes &pis) const;
24 
25  /** \deprecated_at{2.1} Use get_inputs instead. */
26  IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
28  /** \deprecated_at{2.1} Use get_inputs instead. */
29  IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
30  virtual ParticlesTemp get_input_particles(Particle *p) const;
31 
32  protected:
33  /** Overload this method to specify the inputs.*/
34  virtual ModelObjectsTemp do_get_inputs(kernel::Model *m,
35  const ParticleIndexes &pis) const;
36  virtual ~ParticleInputs() {}
37 };
38 
39 /** Inherit from this for objects that take particle arguments and modify
40  them. */
41 class IMPKERNELEXPORT ParticleOutputs {
42  public:
43  /** Get the list of ModelObjects changed when passed the given list of
44  particles is used.*/
45  ModelObjectsTemp get_outputs(kernel::Model *m,
46  const ParticleIndexes &pis) const;
47 
48  /** \deprecated_at{2.1} Use get_inputs instead. */
49  IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
51  /** \deprecated_at{2.1} Use get_inputs instead. */
52  IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
54 
55  protected:
56  /** Overload this method to specify the outputs.*/
57  virtual ModelObjectsTemp do_get_outputs(kernel::Model *m,
58  const ParticleIndexes &pis) const;
59  virtual ~ParticleOutputs() {}
60 };
61 
62 /** Compute the set of score states required by the passed list of
63  ModelObjects. This will compute dependencies if needed.*/
64 IMPKERNELEXPORT ScoreStatesTemp
66  ScoreStatesTemp exclude = ScoreStatesTemp());
67 
68 IMPKERNEL_END_NAMESPACE
69 
70 #endif /* IMPKERNEL_MODEL_OBJECT_HELPERS_H */
Various general useful functions for IMP.
ParticlesTemp get_output_particles(const ModelObjectsTemp &mos)
Return all the output particles for a given ModelObject.
ContainersTemp get_output_containers(const ModelObjectsTemp &mos)
Return all the output particles for a given ModelObject.
ParticlesTemp get_input_particles(const ModelObjectsTemp &mos)
Return all the input particles for a given ModelObject.
ScoreStatesTemp get_required_score_states(const ModelObjectsTemp &mos, ScoreStatesTemp exclude=ScoreStatesTemp())
Single variable function.
ContainersTemp get_input_containers(const ModelObjectsTemp &mos)
Return all the input particles for a given ModelObject.
IMP::base::Vector< IMP::base::WeakPointer< ScoreState > > ScoreStatesTemp
Shared score state.
Class to handle individual model particles.
Class for storing model, its restraints, constraints, and particles.
Definition: kernel/Model.h:73