Changeset ef0f8f
- Timestamp:
- Apr 23, 2021, 8:34:22 PM (5 years ago)
- 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)
- Location:
- src/LinkedCell
- Files:
-
- 5 edited
-
LinkedCell_Model.cpp (modified) (3 diffs)
-
LinkedCell_Model_Update.cpp (modified) (1 diff)
-
LinkedCell_Model_Update.hpp (modified) (4 diffs)
-
LinkedCell_Model_changeModel.cpp (modified) (4 diffs)
-
LinkedCell_Model_changeModel.hpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/LinkedCell/LinkedCell_Model.cpp
rd9e1d1 ref0f8f 322 322 { 323 323 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"); 325 325 } 326 326 … … 334 334 { 335 335 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"); 337 337 } 338 338 … … 345 345 LOG(2, "INFO: Requesting update to move node " << *Walker << " to position " 346 346 << 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"); 348 348 } 349 349 -
src/LinkedCell/LinkedCell_Model_Update.cpp
rd9e1d1 ref0f8f 44 44 * @param _priority priority of the update (the lower, the more important) 45 45 */ 46 LinkedCell::LinkedCell_Model::Update::Update(boost::function<void (const TesselPoint *)> _updateMethod, const TesselPoint *_Walker, const PriorityLevel _priority ) :46 LinkedCell::LinkedCell_Model::Update::Update(boost::function<void (const TesselPoint *)> _updateMethod, const TesselPoint *_Walker, const PriorityLevel _priority, const std::string _name) : 47 47 updateMethod(_updateMethod), 48 48 Walker(_Walker), 49 priority(_priority) 49 priority(_priority), 50 name(_name) 50 51 {} 51 52 -
src/LinkedCell/LinkedCell_Model_Update.hpp
rd9e1d1 ref0f8f 13 13 #include <config.h> 14 14 #endif 15 16 #include <string> 15 17 16 18 #include <boost/function.hpp> … … 32 34 typedef size_t PriorityLevel; 33 35 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=""); 35 37 ~Update(); 36 38 … … 38 40 39 41 size_t getPriority() const { return priority; } 42 43 std::string getName() { return name; } 40 44 41 45 private: … … 53 57 //!> priority level of this Update (the lower, the more important) 54 58 PriorityLevel priority; 59 //!> name of the update 60 const std::string name; 55 61 }; 56 62 } // namespace LinkedCell -
src/LinkedCell/LinkedCell_Model_changeModel.cpp
rd9e1d1 ref0f8f 40 40 #include "CodePatterns/toString.hpp" 41 41 42 #include "Atom/TesselPoint.hpp" 43 42 44 /** Constructor of LinkedCell_Model::changeModel. 43 45 * … … 69 71 const TesselPoint *Walker, 70 72 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 72 75 ) 73 76 { … … 78 81 OBSERVE; 79 82 delete iter->second; 80 iter->second = new Update(_updateMethod, Walker, priority );83 iter->second = new Update(_updateMethod, Walker, priority, name); 81 84 } 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."); 83 86 } 84 87 } else { 85 88 // 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."); 87 90 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)) ); 89 92 } 90 93 } … … 99 102 !queue.empty(); 100 103 iter = queue.begin()) { 101 LOG(2, "INFO: Performing update ..."); 104 LOG(2, "INFO: Performing update '"+iter->second->getName()+"' on " 105 +toString(iter->first)+"..."); 102 106 // perform update 103 107 (*iter->second)(); -
src/LinkedCell/LinkedCell_Model_changeModel.hpp
rd9e1d1 ref0f8f 43 43 const TesselPoint *Walker, 44 44 const Update::PriorityLevel priority, 45 boost::function<void (const TesselPoint *)> _updateMethod 45 boost::function<void (const TesselPoint *)> _updateMethod, 46 const std::string name="" 46 47 ); 47 48 private:
Note:
See TracChangeset
for help on using the changeset viewer.
