Index: kernel/include/IMP/score_states/MaxChangeScoreState.h =================================================================== --- kernel/include/IMP/score_states/MaxChangeScoreState.h (revision 385) +++ kernel/include/IMP/score_states/MaxChangeScoreState.h (working copy) @@ -25,8 +25,6 @@ Particles ps_; float max_change_; public: - IMP_LIST(Particle, particle, Particle*); - MaxChangeScoreState(const FloatKeys &keys):keys_(keys){} virtual ~MaxChangeScoreState(){} @@ -38,6 +36,7 @@ return max_change_; } + IMP_LIST(public, Particle, particle, Particle*); }; } // namespace IMP Index: kernel/include/IMP/Restraint.h =================================================================== --- kernel/include/IMP/Restraint.h (revision 385) +++ kernel/include/IMP/Restraint.h (working copy) @@ -81,8 +81,7 @@ return model_; } -protected: - IMP_LIST(Particle, particle, Particle*) + IMP_LIST(protected, Particle, particle, Particle*) private: Model* model_; Index: kernel/include/IMP/macros.h =================================================================== --- kernel/include/IMP/macros.h (revision 385) +++ kernel/include/IMP/macros.h (working copy) @@ -213,7 +213,9 @@ /** \internal */ -#define IMP_CONTAINER_CORE(Ucname, lcname, Data, IndexType, Container) \ +#define IMP_CONTAINER_CORE(protection, Ucname, lcname, Data, IndexType,\ + Container) \ + protection: \ /** \short Add an object. \param[in] obj Pointer to the object \return index of object within the object @@ -248,6 +250,8 @@ return lcname##_vector_.begin();} \ Ucname##ConstIterator lcname##s_end() const { \ return lcname##_vector_.end();} \ + private: \ + /** \internal */ \ Container lcname##_vector_; /** \internal @@ -278,22 +282,23 @@ /** Such a container adds public methods add_foo, get_foo, number_of_foo and a private type foo_iterator, with methods foo_begin, foo_end. + \param[in] protection The level of protection for the container. \param[in] Ucname The name of the type in uppercase \param[in] lcname The name of the type in lower case \param[in] Data The type of the data to store. \param[in] Onchanged Code to get executed every time the container changes - Eventually we can add removal and correctness checks. - Note that the type Ucnames must be declared and be a vector of + \note the type Ucnames must be declared and be a vector of Data. */ -#define IMP_LIST(Ucname, lcname, Data) \ +#define IMP_LIST(protection, Ucname, lcname, Data) \ + protection: \ /** \short Clear the contents of the container */ \ void clear_##lcname##s(); \ /** \short Remove any occurences of d from the container */ \ void erase_##lcname(Data d); \ - IMP_CONTAINER_CORE(Ucname, lcname, Data, unsigned int, \ + IMP_CONTAINER_CORE(protection, Ucname, lcname, Data, unsigned int, \ IMP::internal::Vector) @@ -335,12 +340,17 @@ \param[in] IndexType The type to use for the index. This should be an instantiation of Index or something similar. - Eventually we can add removal and correctness checks. + \note The type Ucnames must be declared and be a vector of + Data. + \note these containers are always public */ #define IMP_CONTAINER(Ucname, lcname, IndexType) \ + private: \ + /** \internal + This is an implementation detail.*/ \ typedef IMP::internal::ObjectContainer \ Ucname##Container; \ - IMP_CONTAINER_CORE(Ucname, lcname, Ucname*, IndexType, \ + IMP_CONTAINER_CORE(public, Ucname, lcname, Ucname*, IndexType,\ Ucname##Container)