Changeset ef0f8f


Ignore:
Timestamp:
Apr 23, 2021, 8:34:22 PM (5 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Candidate_v1.7.0, stable
Children:
f3eb6a
Parents:
d9e1d1
git-author:
Frederik Heber <frederik.heber@…> (10/03/20 21:21:28)
git-committer:
Frederik Heber <frederik.heber@…> (04/23/21 20:34:22)
Message:

LinkCell model has name on update for debugging.

Location:
src/LinkedCell
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/LinkedCell/LinkedCell_Model.cpp

    rd9e1d1 ref0f8f  
    322322{
    323323  LOG(2, "INFO: Requesting update to add node " << *Walker << ".");
    324   Changes->addUpdate(Walker, 0, boost::bind(&LinkedCell_Model::addNode_internal, this, _1));
     324  Changes->addUpdate(Walker, 0, boost::bind(&LinkedCell_Model::addNode_internal, this, _1), "add");
    325325}
    326326
     
    334334{
    335335  LOG(2, "INFO: Requesting update to delete node " << *Walker << ".");
    336   Changes->addUpdate(Walker, 0, boost::bind(&LinkedCell_Model::deleteNode_internal, this, _1));
     336  Changes->addUpdate(Walker, 0, boost::bind(&LinkedCell_Model::deleteNode_internal, this, _1), "delete");
    337337}
    338338
     
    345345  LOG(2, "INFO: Requesting update to move node " << *Walker << " to position "
    346346      << Walker->getPosition() << ".");
    347   Changes->addUpdate(Walker, 10, boost::bind(&LinkedCell_Model::moveNode_internal, this, _1));
     347  Changes->addUpdate(Walker, 10, boost::bind(&LinkedCell_Model::moveNode_internal, this, _1), "move");
    348348}
    349349
  • src/LinkedCell/LinkedCell_Model_Update.cpp

    rd9e1d1 ref0f8f  
    4444 * @param _priority priority of the update (the lower, the more important)
    4545 */
    46 LinkedCell::LinkedCell_Model::Update::Update(boost::function<void (const TesselPoint *)> _updateMethod, const TesselPoint *_Walker, const PriorityLevel _priority) :
     46LinkedCell::LinkedCell_Model::Update::Update(boost::function<void (const TesselPoint *)> _updateMethod, const TesselPoint *_Walker, const PriorityLevel _priority, const std::string _name) :
    4747  updateMethod(_updateMethod),
    4848  Walker(_Walker),
    49   priority(_priority)
     49  priority(_priority),
     50  name(_name)
    5051{}
    5152
  • src/LinkedCell/LinkedCell_Model_Update.hpp

    rd9e1d1 ref0f8f  
    1313#include <config.h>
    1414#endif
     15
     16#include <string>
    1517
    1618#include <boost/function.hpp>
     
    3234    typedef size_t PriorityLevel;
    3335
    34     Update(boost::function<void (const TesselPoint *)> _updateMethod, const TesselPoint *_Walker, const PriorityLevel _priority);
     36    Update(boost::function<void (const TesselPoint *)> _updateMethod, const TesselPoint *_Walker, const PriorityLevel _priority, const std::string name="");
    3537    ~Update();
    3638
     
    3840
    3941    size_t getPriority() const { return priority; }
     42
     43    std::string getName() { return name; }
    4044
    4145  private:
     
    5357    //!> priority level of this Update (the lower, the more important)
    5458    PriorityLevel priority;
     59    //!> name of the update
     60    const std::string name;
    5561  };
    5662} // namespace LinkedCell
  • src/LinkedCell/LinkedCell_Model_changeModel.cpp

    rd9e1d1 ref0f8f  
    4040#include "CodePatterns/toString.hpp"
    4141
     42#include "Atom/TesselPoint.hpp"
     43
    4244/** Constructor of LinkedCell_Model::changeModel.
    4345 *
     
    6971    const TesselPoint *Walker,
    7072    const LinkedCell_Model::Update::PriorityLevel priority,
    71     boost::function<void (const TesselPoint *)> _updateMethod
     73    boost::function<void (const TesselPoint *)> _updateMethod,
     74    const std::string name
    7275    )
    7376{
     
    7881      OBSERVE;
    7982      delete iter->second;
    80       iter->second = new Update(_updateMethod, Walker, priority);
     83      iter->second = new Update(_updateMethod, Walker, priority, name);
    8184    } else {
    82       LOG(2, "INFO: Rejecting update for LinkedCell_Model as higher prioritized one is present.");
     85      LOG(2, "INFO: Rejecting update '" << name << "' for LinkedCell_Model as higher prioritized one is present.");
    8386    }
    8487  } else {
    8588    // insert new update
    86     LOG(2, "INFO: Placing new update into queue for LinkedCell_Model.");
     89    LOG(2, "INFO: Placing new update '" << name << "' into queue for LinkedCell_Model.");
    8790    OBSERVE;
    88     queue.insert( std::make_pair(Walker, new Update(_updateMethod, Walker, priority)) );
     91    queue.insert( std::make_pair(Walker, new Update(_updateMethod, Walker, priority, name)) );
    8992  }
    9093}
     
    99102      !queue.empty();
    100103      iter = queue.begin()) {
    101     LOG(2, "INFO: Performing update ...");
     104    LOG(2, "INFO: Performing update '"+iter->second->getName()+"' on "
     105        +toString(iter->first)+"...");
    102106    // perform update
    103107    (*iter->second)();
  • src/LinkedCell/LinkedCell_Model_changeModel.hpp

    rd9e1d1 ref0f8f  
    4343        const TesselPoint *Walker,
    4444        const Update::PriorityLevel priority,
    45         boost::function<void (const TesselPoint *)> _updateMethod
     45        boost::function<void (const TesselPoint *)> _updateMethod,
     46        const std::string name=""
    4647        );
    4748  private:
Note: See TracChangeset for help on using the changeset viewer.