Index: kernel/include/IMP/Model.h =================================================================== --- kernel/include/IMP/Model.h (revision 420) +++ kernel/include/IMP/Model.h (working copy) @@ -10,7 +10,6 @@ #define __IMP_MODEL_H #include "IMP_config.h" -#include "ScoreState.h" #include "internal/Object.h" #include "base_types.h" @@ -20,7 +19,9 @@ class Particle; class Restraint; class ModelData; +class ScoreState; typedef std::vector Restraints; +typedef std::vector ScoreStates; //! Class for storing model, its restraints, constraints, and particles. /** All attribute data for particles is stored through indexing in the Index: kernel/include/IMP/ScoreState.h =================================================================== --- kernel/include/IMP/ScoreState.h (revision 420) +++ kernel/include/IMP/ScoreState.h (working copy) @@ -10,6 +10,8 @@ #include "IMP_config.h" #include "internal/Object.h" +#include "internal/ObjectPointer.h" +#include "Model.h" #include "utility.h" #include @@ -51,21 +53,19 @@ //! return the stored model data Model *get_model() const { - IMP_assert(model_ != NULL, + IMP_assert(model_, "Must call set_model before get_model on state"); - return model_; + return model_.get(); } protected: // all of the particle data - Model* model_; + internal::ObjectPointer model_; std::string name_; }; IMP_OUTPUT_OPERATOR(ScoreState); -typedef std::vector ScoreStates; - } // namespace IMP #endif /* __IMP_SCORE_STATE_H */ Index: kernel/src/Model.cpp =================================================================== --- kernel/src/Model.cpp (revision 420) +++ kernel/src/Model.cpp (working copy) @@ -12,6 +12,7 @@ #include "IMP/log.h" #include "IMP/Restraint.h" #include "IMP/DerivativeAccumulator.h" +#include "IMP/ScoreState.h" namespace IMP {