/* * Project: MoleCuilder * Description: creates and alters molecular systems * Copyright (C) 2012 University of Bonn. All rights reserved. * Please see the LICENSE file or "Copyright notice" in builder.cpp for details. */ /* * LinkedCell_Model_LinkedCellArrayCache.cpp * * Created on: Dec 20, 2011 * Author: heber */ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include "CodePatterns/MemDebug.hpp" #include #include #include "LinkedCell_Model_LinkedCellArrayCache.hpp" #include "LinkedCell_Model_changeModel.hpp" /** Constructor for class LinkedCellArrayCache. * */ LinkedCell::LinkedCell_Model::LinkedCellArrayCache::LinkedCellArrayCache( Observable *_observable, boost::function _updatefunction, const std::string _name) : updatefunction(_updatefunction), UpToDate(_observable, boost::bind(&LinkedCellArrayCache::updateMe, this), _name) {} /** Destructor for class LinkedCellArrayCache. * */ LinkedCell::LinkedCell_Model::LinkedCellArrayCache::~LinkedCellArrayCache() {} /** Getter for read operations. * * Here, we check whether the LinkedCellArray is up-to-date. * * @return const reference to LinkedCellArray */ const LinkedCell::LinkedCellArray &LinkedCell::LinkedCell_Model::LinkedCellArrayCache::getN() const { if (*UpToDate) { // just a pseudo if to make sure the update function gets called. } return N; } /** Getter for write operations. * * This is only accessible for LinkedCell_Model and its update operations. * * @return reference to LinkedCellArray. */ LinkedCell::LinkedCellArray &LinkedCell::LinkedCell_Model::LinkedCellArrayCache::setN() { return N; }