/** * \file CLASSNAMEContainerSet.h * \brief Store a set of CLASSNAMEContainers * * This file is generated by a script (core/tools/make-container). * Do not edit directly. * * Copyright 2007-2010 IMP Inventors. All rights reserved. */ #ifndef IMPCONTAINER_HEADERNAME_CONTAINER_SET_H #define IMPCONTAINER_HEADERNAME_CONTAINER_SET_H #include "container_config.h" #include #include #include IMPCONTAINER_BEGIN_NAMESPACE //! Stores a set of CLASSNAMEContainers /** The input sets must be disjoint. This can change if there is demand for it. \usesconstraint */ class IMPCONTAINEREXPORT CLASSNAMEContainerSet : public CLASSNAMEContainer { IMP_CONTAINER_DEPENDENCIES(CLASSNAMEContainerSet, { ret.insert(ret.end(), back_->CLASSFUNCTIONNAME_containers_begin(), back_->CLASSFUNCTIONNAME_containers_end()); }); // to not have added and removed CLASSNAMEContainerSet(); CLASSNAMEContainerPair get_added_and_removed_containers() const { CLASSNAMEContainerSet *added= create_untracked_container(); CLASSNAMEContainerSet *removed=create_untracked_container(); for (unsigned int i=0; i< get_number_of_CLASSFUNCTIONNAME_containers(); ++i) { added->add_CLASSFUNCTIONNAME_container(get_CLASSFUNCTIONNAME_container(i) ->get_added_container()); removed->add_CLASSFUNCTIONNAME_container(get_CLASSFUNCTIONNAME_container(i) ->get_removed_container()); } return CLASSNAMEContainerPair(added, removed); } public: //! Construct and empty set CLASSNAMEContainerSet(Model *m, std::string name="CLASSNAMEContainerSet %1%"); CLASSNAMEContainerSet(const CLASSNAMEContainersTemp &pc, std::string name="CLASSNAMEContainerSet %1%"); bool get_contains_FUNCTIONNAME(ARGUMENTTYPE) const; unsigned int get_number_of_FUNCTIONNAMEs() const; VARIABLETYPE get_FUNCTIONNAME(unsigned int i) const; void apply(const CLASSNAMEModifier *sm); void apply(const CLASSNAMEModifier *sm, DerivativeAccumulator &da); double evaluate(const CLASSNAMEScore *s, DerivativeAccumulator *da) const; double evaluate_change(const CLASSNAMEScore *s, DerivativeAccumulator *da) const; double evaluate_prechange(const CLASSNAMEScore *s, DerivativeAccumulator *da) const; template void template_apply(const SM *sm, DerivativeAccumulator &da) { for (unsigned int i=0; i< get_number_of_CLASSFUNCTIONNAME_containers(); ++i) { get_CLASSFUNCTIONNAME_container(i)->apply(sm, da); } } template void template_apply(const SM *sm) { for (unsigned int i=0; i< get_number_of_CLASSFUNCTIONNAME_containers(); ++i) { get_CLASSFUNCTIONNAME_container(i)->apply(sm); } } template double template_evaluate(const SS *s, DerivativeAccumulator *da) const { double ret=0; for (unsigned int i=0; i< get_number_of_CLASSFUNCTIONNAME_containers(); ++i) { ret+=get_CLASSFUNCTIONNAME_container(i)->evaluate(s, da); } return ret; } template double template_evaluate_change(const SS *s, DerivativeAccumulator *da) const { double ret=0; for (unsigned int i=0; i< get_number_of_CLASSFUNCTIONNAME_containers(); ++i) { ret+=get_CLASSFUNCTIONNAME_container(i)->evaluate_change(s, da); } return ret; } template double template_evaluate_prechange(const SS *s, DerivativeAccumulator *da) const { double ret=0; for (unsigned int i=0; i< get_number_of_CLASSFUNCTIONNAME_containers(); ++i) { ret+=get_CLASSFUNCTIONNAME_container(i)->evaluate_prechange(s, da); } return ret; } ParticlesTemp get_contained_particles() const; bool get_contained_particles_changed() const; IMP_OBJECT(CLASSNAMEContainerSet); /** @name Methods to control the nested container This container merges a set of nested containers. To add or remove nested containers, use the methods below. */ /**@{*/ IMP_LIST(public, CLASSNAMEContainer, CLASSFUNCTIONNAME_container, CLASSNAMEContainer*, CLASSNAMEContainers); /**@}*/ static CLASSNAMEContainerSet *create_untracked_container() { CLASSNAMEContainerSet *lsc = new CLASSNAMEContainerSet(); return lsc; } #ifndef IMP_DOXYGEN bool get_is_up_to_date() const { for (unsigned int i=0; i< get_number_of_CLASSFUNCTIONNAME_containers(); ++i) { if (!get_CLASSFUNCTIONNAME_container(i)->get_is_up_to_date()) return false; } return true; } #endif }; IMPCONTAINER_END_NAMESPACE #endif /* IMPCONTAINER_HEADERNAME_CONTAINER_SET_H */