/** * \file ListCLASSNAMEContainer.cpp \brief A list of PLURALVARIABLETYPE. * * This file is generated by a script (core/tools/make-container). * Do not edit directly. * * Copyright 2007-2010 IMP Inventors. All rights reserved. * */ #include "IMP/core/internal/CoreListCLASSNAMEContainer.h" #include "IMP/CLASSNAMEModifier.h" #include "IMP/CLASSNAMEScore.h" #include IMPCORE_BEGIN_INTERNAL_NAMESPACE namespace { CoreListCLASSNAMEContainer* get_list(CLASSNAMEContainer *g) { return dynamic_cast(g); } } IMP_ACTIVE_CONTAINER_DEF(CoreListCLASSNAMEContainer); CoreListCLASSNAMEContainer ::CoreListCLASSNAMEContainer(): internal::ListLikeCLASSNAMEContainer(){} CoreListCLASSNAMEContainer ::CoreListCLASSNAMEContainer(Model *m, std::string name): internal::ListLikeCLASSNAMEContainer(m, name){ initialize_active_container(m); } CoreListCLASSNAMEContainer ::CoreListCLASSNAMEContainer(Model *m, const char *name): internal::ListLikeCLASSNAMEContainer(m, name){ initialize_active_container(m); } void CoreListCLASSNAMEContainer::do_show(std::ostream &out) const { IMP_CHECK_OBJECT(this); out << get_number_of_FUNCTIONNAMEs() << " CLASSNAMEs." << std::endl; } void CoreListCLASSNAMEContainer::set_FUNCTIONNAMEs(PLURALARGUMENTTYPE sc) { update_list(sc); } void CoreListCLASSNAMEContainer::clear_FUNCTIONNAMEs() { PLURALVARIABLETYPE t; update_list(t); } void CoreListCLASSNAMEContainer::add_FUNCTIONNAME(ARGUMENTTYPE vt) { IMP_USAGE_CHECK(IMP::internal::is_valid(vt), "Passed CLASSNAME cannot be NULL (or None)"); add_to_list(vt); IMP_USAGE_CHECK(!get_has_added_and_removed_containers() || !get_removed_container() ->get_contains(vt), "You cannot remove and add the same item in one time step."); } void CoreListCLASSNAMEContainer::add_FUNCTIONNAMEs(const PLURALARGUMENTTYPE &c) { if (c.empty()) return; PLURALVARIABLETYPE cp= c; add_to_list(cp); IMP_IF_CHECK(USAGE) { for (unsigned int i=0; i< c.size(); ++i) { IMP_USAGE_CHECK(IMP::internal::is_valid(c[i]), "Passed CLASSNAME cannot be NULL (or None)"); IMP_USAGE_CHECK(!get_has_added_and_removed_containers() || !get_removed_container() ->get_contains(c[i]), "You cannot remove and add the same item in one time step."); } } } void CoreListCLASSNAMEContainer ::remove_FUNCTIONNAMEs(const PLURALVARIABLETYPE &c) { if (c.empty()) return; PLURALVARIABLETYPE cp= c; remove_from_list(cp); IMP_IF_CHECK(USAGE) { for (unsigned int i=0; i< c.size(); ++i) { IMP_USAGE_CHECK(IMP::internal::is_valid(c[i]), "Passed CLASSNAME cannot be NULL (or None)"); } } } void CoreListCLASSNAMEContainer::do_before_evaluate() { internal::ListLikeCLASSNAMEContainer::do_before_evaluate(); } void CoreListCLASSNAMEContainer::do_after_evaluate() { internal::ListLikeCLASSNAMEContainer::do_after_evaluate(); } ParticlesTemp CoreListCLASSNAMEContainer::get_state_input_particles() const { return ParticlesTemp(); } ContainersTemp CoreListCLASSNAMEContainer::get_state_input_containers() const { return ContainersTemp(); } bool CoreListCLASSNAMEContainer::get_contained_particles_changed() const { return !get_added()->get_access().empty() || !get_removed()->get_access().empty(); } ParticlesTemp CoreListCLASSNAMEContainer::get_contained_particles() const { return IMP::internal::flatten(get_access()); } IMPCORE_END_INTERNAL_NAMESPACE