- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Descriptors/AtomDescriptor.cpp
r112b09 r8cce2b 12 12 13 13 #include "World.hpp" 14 15 14 #include "atom.hpp" 15 #include "Patterns/ObservedContainer_impl.hpp" 16 16 17 17 #include <boost/bind.hpp> 18 #include <cassert> 18 19 19 #include <iostream> 20 20 21 21 using namespace std; 22 22 23 typedef World::AtomSet::i terator atoms_iter_t;23 typedef World::AtomSet::internal_iterator atoms_iter_t; 24 24 25 25 /************************ Forwarding object **************************************/ … … 74 74 75 75 atom* AtomDescriptor_impl::find() { 76 World::AtomSet atoms = getAtoms();77 atoms_iter_t res = find_if(atoms.begin (),atoms.end(),boost::bind(&AtomDescriptor_impl::predicate,this,_1));78 return (res!=atoms.end ())?((*res).second):0;76 World::AtomSet &atoms = getAtoms(); 77 atoms_iter_t res = find_if(atoms.begin_internal(),atoms.end_internal(),boost::bind(&AtomDescriptor_impl::predicate,this,_1)); 78 return (res!=atoms.end_internal())?((*res).second):0; 79 79 } 80 80 … … 82 82 vector<atom*> res; 83 83 World::AtomSet atoms = getAtoms(); 84 atoms_iter_t iter; 85 for(iter=atoms.begin();iter!=atoms.end();++iter) { 86 if(predicate(*iter)){ 87 res.push_back((*iter).second); 88 } 84 for_each(atoms.begin_internal(), 85 atoms.end_internal(), 86 boost::bind(&AtomDescriptor_impl::checkAndAdd, 87 this,&res,_1)); 88 return res; 89 } 90 91 void AtomDescriptor_impl::checkAndAdd(std::vector<atom*> *v,std::pair<atomId_t,atom*> p){ 92 if(predicate(p)){ 93 v->push_back(p.second); 89 94 } 90 return res;91 95 } 92 96
Note:
See TracChangeset
for help on using the changeset viewer.