Lines 259-265
Rosstackage::~Rosstackage()
Link Here
|
259 |
|
259 |
|
260 |
void Rosstackage::clearStackages() |
260 |
void Rosstackage::clearStackages() |
261 |
{ |
261 |
{ |
262 |
for(std::tr1::unordered_map<std::string, Stackage*>::const_iterator it = stackages_.begin(); |
262 |
for(boost::unordered_map<std::string, Stackage*>::const_iterator it = stackages_.begin(); |
263 |
it != stackages_.end(); |
263 |
it != stackages_.end(); |
264 |
++it) |
264 |
++it) |
265 |
{ |
265 |
{ |
Lines 382-388
Rosstackage::crawl(std::vector<std::string> search_path,
Link Here
|
382 |
search_paths_ = search_path; |
382 |
search_paths_ = search_path; |
383 |
|
383 |
|
384 |
std::vector<DirectoryCrawlRecord*> dummy; |
384 |
std::vector<DirectoryCrawlRecord*> dummy; |
385 |
std::tr1::unordered_set<std::string> dummy2; |
385 |
boost::unordered_set<std::string> dummy2; |
386 |
for(std::vector<std::string>::const_iterator p = search_paths_.begin(); |
386 |
for(std::vector<std::string>::const_iterator p = search_paths_.begin(); |
387 |
p != search_paths_.end(); |
387 |
p != search_paths_.end(); |
388 |
++p) |
388 |
++p) |
Lines 447-453
Rosstackage::contents(const std::string& name,
Link Here
|
447 |
std::set<std::string>& packages) |
447 |
std::set<std::string>& packages) |
448 |
{ |
448 |
{ |
449 |
Rospack rp2; |
449 |
Rospack rp2; |
450 |
std::tr1::unordered_map<std::string, Stackage*>::const_iterator it = stackages_.find(name); |
450 |
boost::unordered_map<std::string, Stackage*>::const_iterator it = stackages_.find(name); |
451 |
if(it != stackages_.end()) |
451 |
if(it != stackages_.end()) |
452 |
{ |
452 |
{ |
453 |
std::vector<std::string> search_paths; |
453 |
std::vector<std::string> search_paths; |
Lines 474-480
Rosstackage::contains(const std::string& name,
Link Here
|
474 |
std::string& path) |
474 |
std::string& path) |
475 |
{ |
475 |
{ |
476 |
Rospack rp2; |
476 |
Rospack rp2; |
477 |
for(std::tr1::unordered_map<std::string, Stackage*>::const_iterator it = stackages_.begin(); |
477 |
for(boost::unordered_map<std::string, Stackage*>::const_iterator it = stackages_.begin(); |
478 |
it != stackages_.end(); |
478 |
it != stackages_.end(); |
479 |
++it) |
479 |
++it) |
480 |
{ |
480 |
{ |
Lines 503-509
Rosstackage::contains(const std::string& name,
Link Here
|
503 |
void |
503 |
void |
504 |
Rosstackage::list(std::set<std::pair<std::string, std::string> >& list) |
504 |
Rosstackage::list(std::set<std::pair<std::string, std::string> >& list) |
505 |
{ |
505 |
{ |
506 |
for(std::tr1::unordered_map<std::string, Stackage*>::const_iterator it = stackages_.begin(); |
506 |
for(boost::unordered_map<std::string, Stackage*>::const_iterator it = stackages_.begin(); |
507 |
it != stackages_.end(); |
507 |
it != stackages_.end(); |
508 |
++it) |
508 |
++it) |
509 |
{ |
509 |
{ |
Lines 519-525
Rosstackage::listDuplicates(std::vector<std::string>& dups)
Link Here
|
519 |
{ |
519 |
{ |
520 |
dups.resize(dups_.size()); |
520 |
dups.resize(dups_.size()); |
521 |
int i = 0; |
521 |
int i = 0; |
522 |
for(std::tr1::unordered_map<std::string, std::vector<std::string> >::const_iterator it = dups_.begin(); |
522 |
for(boost::unordered_map<std::string, std::vector<std::string> >::const_iterator it = dups_.begin(); |
523 |
it != dups_.end(); |
523 |
it != dups_.end(); |
524 |
++it) |
524 |
++it) |
525 |
{ |
525 |
{ |
Lines 532-538
void
Link Here
|
532 |
Rosstackage::listDuplicatesWithPaths(std::map<std::string, std::vector<std::string> >& dups) |
532 |
Rosstackage::listDuplicatesWithPaths(std::map<std::string, std::vector<std::string> >& dups) |
533 |
{ |
533 |
{ |
534 |
dups.clear(); |
534 |
dups.clear(); |
535 |
for(std::tr1::unordered_map<std::string, std::vector<std::string> >::const_iterator it = dups_.begin(); |
535 |
for(boost::unordered_map<std::string, std::vector<std::string> >::const_iterator it = dups_.begin(); |
536 |
it != dups_.end(); |
536 |
it != dups_.end(); |
537 |
++it) |
537 |
++it) |
538 |
{ |
538 |
{ |
Lines 598-604
Rosstackage::depsIndent(const std::string& name, bool direct,
Link Here
|
598 |
{ |
598 |
{ |
599 |
computeDeps(stackage); |
599 |
computeDeps(stackage); |
600 |
std::vector<Stackage*> deps_vec; |
600 |
std::vector<Stackage*> deps_vec; |
601 |
std::tr1::unordered_set<Stackage*> deps_hash; |
601 |
boost::unordered_set<Stackage*> deps_hash; |
602 |
std::vector<std::string> indented_deps; |
602 |
std::vector<std::string> indented_deps; |
603 |
gatherDepsFull(stackage, direct, POSTORDER, 0, deps_hash, deps_vec, true, indented_deps); |
603 |
gatherDepsFull(stackage, direct, POSTORDER, 0, deps_hash, deps_vec, true, indented_deps); |
604 |
for(std::vector<std::string>::const_iterator it = indented_deps.begin(); |
604 |
for(std::vector<std::string>::const_iterator it = indented_deps.begin(); |
Lines 1089-1095
Rosstackage::plugins(const std::string& name, const std::string& attrib,
Link Here
|
1089 |
if(!depsOnDetail(name, true, stackages, true)) |
1089 |
if(!depsOnDetail(name, true, stackages, true)) |
1090 |
return false; |
1090 |
return false; |
1091 |
// Also look in the package itself |
1091 |
// Also look in the package itself |
1092 |
std::tr1::unordered_map<std::string, Stackage*>::const_iterator it = stackages_.find(name); |
1092 |
boost::unordered_map<std::string, Stackage*>::const_iterator it = stackages_.find(name); |
1093 |
if(it != stackages_.end()) |
1093 |
if(it != stackages_.end()) |
1094 |
{ |
1094 |
{ |
1095 |
// don't warn here; it was done in depsOnDetail() |
1095 |
// don't warn here; it was done in depsOnDetail() |
Lines 1102-1108
Rosstackage::plugins(const std::string& name, const std::string& attrib,
Link Here
|
1102 |
std::vector<Stackage*> top_deps; |
1102 |
std::vector<Stackage*> top_deps; |
1103 |
if(!depsDetail(top, false, top_deps)) |
1103 |
if(!depsDetail(top, false, top_deps)) |
1104 |
return false; |
1104 |
return false; |
1105 |
std::tr1::unordered_set<Stackage*> top_deps_set; |
1105 |
boost::unordered_set<Stackage*> top_deps_set; |
1106 |
for(std::vector<Stackage*>::iterator it = top_deps.begin(); |
1106 |
for(std::vector<Stackage*>::iterator it = top_deps.begin(); |
1107 |
it != top_deps.end(); |
1107 |
it != top_deps.end(); |
1108 |
++it) |
1108 |
++it) |
Lines 1292-1298
Rosstackage::depsOnDetail(const std::string& name, bool direct,
Link Here
|
1292 |
} |
1292 |
} |
1293 |
try |
1293 |
try |
1294 |
{ |
1294 |
{ |
1295 |
for(std::tr1::unordered_map<std::string, Stackage*>::const_iterator it = stackages_.begin(); |
1295 |
for(boost::unordered_map<std::string, Stackage*>::const_iterator it = stackages_.begin(); |
1296 |
it != stackages_.end(); |
1296 |
it != stackages_.end(); |
1297 |
++it) |
1297 |
++it) |
1298 |
{ |
1298 |
{ |
Lines 1327-1333
Rosstackage::profile(const std::vector<std::string>& search_path,
Link Here
|
1327 |
{ |
1327 |
{ |
1328 |
double start = time_since_epoch(); |
1328 |
double start = time_since_epoch(); |
1329 |
std::vector<DirectoryCrawlRecord*> dcrs; |
1329 |
std::vector<DirectoryCrawlRecord*> dcrs; |
1330 |
std::tr1::unordered_set<std::string> dcrs_hash; |
1330 |
boost::unordered_set<std::string> dcrs_hash; |
1331 |
for(std::vector<std::string>::const_iterator p = search_path.begin(); |
1331 |
for(std::vector<std::string>::const_iterator p = search_path.begin(); |
1332 |
p != search_path.end(); |
1332 |
p != search_path.end(); |
1333 |
++p) |
1333 |
++p) |
Lines 1437-1443
Rosstackage::crawlDetail(const std::string& path,
Link Here
|
1437 |
int depth, |
1437 |
int depth, |
1438 |
bool collect_profile_data, |
1438 |
bool collect_profile_data, |
1439 |
std::vector<DirectoryCrawlRecord*>& profile_data, |
1439 |
std::vector<DirectoryCrawlRecord*>& profile_data, |
1440 |
std::tr1::unordered_set<std::string>& profile_hash) |
1440 |
boost::unordered_set<std::string>& profile_hash) |
1441 |
{ |
1441 |
{ |
1442 |
if(depth > MAX_CRAWL_DEPTH) |
1442 |
if(depth > MAX_CRAWL_DEPTH) |
1443 |
throw Exception("maximum depth exceeded during crawl"); |
1443 |
throw Exception("maximum depth exceeded during crawl"); |
Lines 1786-1792
Rosstackage::gatherDeps(Stackage* stackage, bool direct,
Link Here
|
1786 |
std::vector<Stackage*>& deps, |
1786 |
std::vector<Stackage*>& deps, |
1787 |
bool no_recursion_on_wet) |
1787 |
bool no_recursion_on_wet) |
1788 |
{ |
1788 |
{ |
1789 |
std::tr1::unordered_set<Stackage*> deps_hash; |
1789 |
boost::unordered_set<Stackage*> deps_hash; |
1790 |
std::vector<std::string> indented_deps; |
1790 |
std::vector<std::string> indented_deps; |
1791 |
gatherDepsFull(stackage, direct, order, 0, |
1791 |
gatherDepsFull(stackage, direct, order, 0, |
1792 |
deps_hash, deps, false, indented_deps, no_recursion_on_wet); |
1792 |
deps_hash, deps, false, indented_deps, no_recursion_on_wet); |
Lines 1795-1801
Rosstackage::gatherDeps(Stackage* stackage, bool direct,
Link Here
|
1795 |
void |
1795 |
void |
1796 |
_gatherDepsFull(Stackage* stackage, bool direct, |
1796 |
_gatherDepsFull(Stackage* stackage, bool direct, |
1797 |
traversal_order_t order, int depth, |
1797 |
traversal_order_t order, int depth, |
1798 |
std::tr1::unordered_set<Stackage*>& deps_hash, |
1798 |
boost::unordered_set<Stackage*>& deps_hash, |
1799 |
std::vector<Stackage*>& deps, |
1799 |
std::vector<Stackage*>& deps, |
1800 |
bool get_indented_deps, |
1800 |
bool get_indented_deps, |
1801 |
std::vector<std::string>& indented_deps, |
1801 |
std::vector<std::string>& indented_deps, |
Lines 1881-1887
_gatherDepsFull(Stackage* stackage, bool direct,
Link Here
|
1881 |
void |
1881 |
void |
1882 |
Rosstackage::gatherDepsFull(Stackage* stackage, bool direct, |
1882 |
Rosstackage::gatherDepsFull(Stackage* stackage, bool direct, |
1883 |
traversal_order_t order, int depth, |
1883 |
traversal_order_t order, int depth, |
1884 |
std::tr1::unordered_set<Stackage*>& deps_hash, |
1884 |
boost::unordered_set<Stackage*>& deps_hash, |
1885 |
std::vector<Stackage*>& deps, |
1885 |
std::vector<Stackage*>& deps, |
1886 |
bool get_indented_deps, |
1886 |
bool get_indented_deps, |
1887 |
std::vector<std::string>& indented_deps, |
1887 |
std::vector<std::string>& indented_deps, |
Lines 2068-2074
Rosstackage::writeCache()
Link Here
|
2068 |
{ |
2068 |
{ |
2069 |
char *rpp = getenv("ROS_PACKAGE_PATH"); |
2069 |
char *rpp = getenv("ROS_PACKAGE_PATH"); |
2070 |
fprintf(cache, "#ROS_PACKAGE_PATH=%s\n", (rpp ? rpp : "")); |
2070 |
fprintf(cache, "#ROS_PACKAGE_PATH=%s\n", (rpp ? rpp : "")); |
2071 |
for(std::tr1::unordered_map<std::string, Stackage*>::const_iterator it = stackages_.begin(); |
2071 |
for(boost::unordered_map<std::string, Stackage*>::const_iterator it = stackages_.begin(); |
2072 |
it != stackages_.end(); |
2072 |
it != stackages_.end(); |
2073 |
++it) |
2073 |
++it) |
2074 |
fprintf(cache, "%s\n", it->second->path_.c_str()); |
2074 |
fprintf(cache, "%s\n", it->second->path_.c_str()); |