Beispiel #1
0
void ModelObject::validate_inputs() const {
  if (!get_has_dependencies()) return;
  IMP_IF_CHECK(USAGE_AND_INTERNAL) {
    ModelObjectsTemp ret = do_get_inputs();
    std::sort(ret.begin(), ret.end());
    ret.erase(std::unique(ret.begin(), ret.end()), ret.end());
    // since I/O nodes are considered outputs
    ModelObjectsTemp saved = get_model()->get_dependency_graph_inputs(this) +
                             get_model()->get_dependency_graph_outputs(this);
    std::sort(saved.begin(), saved.end());
    ModelObjectsTemp intersection;
    std::set_intersection(saved.begin(), saved.end(), ret.begin(), ret.end(),
                          std::back_inserter(intersection));
    IMP_USAGE_CHECK(
        intersection.size() == ret.size(),
        "Dependencies changed without invalidating dependencies."
            << " Make sure you call set_has_dependencies(false) any "
            << "time the list of dependencies changed. Object is " << get_name()
            << " of type " << get_type_name() << " -- " << ret << " vs "
            << saved);
  }
}
ModelObjectsTemp ExampleSingletonModifier::do_get_outputs(
    Model *m, const ParticleIndexes &pis) const {
  return do_get_inputs(m, pis);
}
Beispiel #3
0
ModelObjectsTemp ModelObject::get_inputs() const {
  IMP_OBJECT_LOG;
  validate_inputs();
  return do_get_inputs();
}
Beispiel #4
0
IMPKERNEL_BEGIN_NAMESPACE

ModelObjectsTemp ParticleInputs::get_inputs(kernel::Model *m,
                                            const ParticleIndexes &pis) const {
  return do_get_inputs(m, pis);
}