/* * LinkedCell_Model_changeModel.hpp * * Created on: Dec 20, 2011 * Author: heber */ #ifndef LINKEDCELL_MODEL_CHANGEMODEL_HPP_ #define LINKEDCELL_MODEL_CHANGEMODEL_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include #include "CodePatterns/Observer/Observable.hpp" #include "LinkedCell_Model.hpp" #include "LinkedCell_Model_Update.hpp" class TesselPoint; namespace LinkedCell { /** This structures encapsulates changes occuring to the model. * * We do this mostly to keep the Observer LinkedCell_Model away from the * Observable which we need for the Cacheable LinkedCell_Model::N. */ class LinkedCell_Model::changeModel : public Observable { //!> grant LinkedCell_ModelTest test access to queue friend class ::LinkedCell_ModelTest; public: explicit changeModel(const double distance); ~changeModel(); void addUpdate( const TesselPoint *Walker, const Update::PriorityLevel priority, boost::function _updateMethod ); private: //!> grant LinkedCell_Model access to bind LinkedCellArrayCache to update funcation friend class LinkedCell_Model; void performUpdates(); private: typedef std::map UpdateQueueMap; UpdateQueueMap queue; }; } // namespace LinkedCell #endif /* LINKEDCELL_MODEL_CHANGEMODEL_HPP_ */