/* * LinkedCell_Controller.hpp * * Created on: Nov 15, 2011 * Author: heber */ #ifndef LINKEDCELL_CONTROLLER_HPP_ #define LINKEDCELL_CONTROLLER_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include "LinkedCell/LinkedCell_View.hpp" namespace LinkedCell { class LinkedCell_Model; /** This is the controller in the MVC ansatz for the LinkedCell structure. * * \sa linkedcell * * The Controller contains multiple models (i.e. LinkedCell instances) and he * takes care that the view (the interface) can give its functionality with * low computational complexity. * * Here, it contains multiple LinkedCell_Model instances, each with different * edge lengths of the inherent mesh. You request a LinkedCell instance from * the controller, but you basically just receive a const interface reference * to a present LinkedCell instance. * */ class LinkedCell_Controller { public: LinkedCell_Controller(const Box &_domain); ~LinkedCell_Controller(); LinkedCell_View getView(const double distance); private: const LinkedCell_Model * getBestModel(const double distance) const; private: //!> typedef for the (edge length, model) map typedef std::map MapEdgelengthModel; //!> internal map of present LinkedCell_Model instances by their egde length MapEdgelengthModel ModelsMap; //!> internal reference to domain required for constructing LinkedCell_Model instances. const Box &domain; }; } #endif /* LINKEDCELL_CONTROLLER_HPP_ */