105 #ifndef ROSPACK_ROSPACK_H 106 #define ROSPACK_ROSPACK_H 108 #include <boost/version.hpp> 110 #if BOOST_VERSION < 106500 111 #include <boost/tr1/unordered_set.hpp> 112 #include <boost/tr1/unordered_map.hpp> 114 #include <boost/unordered_set.hpp> 115 #include <boost/unordered_map.hpp> 126 #if 1 // def ROSPACK_API_BACKCOMPAT_V1 135 #ifndef CONSOLE_BRIDGE_logError // class_loader < 0.3 136 #ifdef logError // class_loader < 0.4 was included 138 #define CONSOLE_BRIDGE_logError(fmt, ...) \ 139 console_bridge::log(__FILE__, __LINE__, console_bridge::CONSOLE_BRIDGE_LOG_ERROR, fmt, ##__VA_ARGS__) 142 #ifdef logError // class_loader < 0.4 was included 147 #ifndef CONSOLE_BRIDGE_logWarn // class_loader < 0.3 148 #ifdef logWarn // class_loader < 0.4 was included 150 #define CONSOLE_BRIDGE_logWarn(fmt, ...) \ 151 console_bridge::log(__FILE__, __LINE__, console_bridge::CONSOLE_BRIDGE_LOG_WARN, fmt, ##__VA_ARGS__) 154 #ifdef logWarn // class_loader < 0.4 was included 159 #ifndef CONSOLE_BRIDGE_logInform // class_loader < 0.3 160 #ifdef logInform // class_loader < 0.4 was included 162 #define CONSOLE_BRIDGE_logInform(fmt, ...) \ 163 console_bridge::log(__FILE__, __LINE__, console_bridge::CONSOLE_BRIDGE_LOG_INFO, fmt, ##__VA_ARGS__) 168 #ifndef CONSOLE_BRIDGE_logDebug // class_loader < 0.3 169 #ifdef logDebug // class_loader < 0.4 was included 171 #define CONSOLE_BRIDGE_logDebug(fmt, ...) \ 172 console_bridge::log(__FILE__, __LINE__, console_bridge::CONSOLE_BRIDGE_LOG_DEBUG, fmt, ##__VA_ARGS__) 205 #if BOOST_VERSION < 106500 206 std::tr1::unordered_map<std::string, std::vector<std::string> >
dups_;
209 boost::unordered_map<std::string, std::vector<std::string> > dups_;
210 boost::unordered_map<std::string, Stackage*> stackages_;
212 Stackage* findWithRecrawl(
const std::string& name);
213 void log(
const std::string& level,
const std::string& msg,
bool append_errno);
214 void clearStackages();
215 void addStackage(
const std::string& path);
216 void crawlDetail(
const std::string& path,
219 bool collect_profile_data,
220 std::vector<DirectoryCrawlRecord*>& profile_data,
221 #
if BOOST_VERSION < 106500
222 std::tr1::unordered_set<std::string>& profile_hash);
224 boost::unordered_set<std::string>& profile_hash);
226 bool isStackage(
const std::string& path);
227 void loadManifest(
Stackage* stackage);
228 void computeDeps(
Stackage* stackage,
bool ignore_errors=
false,
bool ignore_missing=
false);
229 void computeDepsInternal(
Stackage* stackage,
bool ignore_errors,
const std::string& depend_tag,
bool ignore_missing=
false);
230 bool isSysPackage(
const std::string& pkgname);
231 void gatherDeps(
Stackage* stackage,
bool direct,
232 traversal_order_t order,
233 std::vector<Stackage*>& deps,
234 bool no_recursion_on_wet=
false);
235 void gatherDepsFull(
Stackage* stackage,
bool direct,
236 traversal_order_t order,
int depth,
237 #
if BOOST_VERSION < 106500
238 std::tr1::unordered_set<Stackage*>& deps_hash,
240 boost::unordered_set<Stackage*>& deps_hash,
242 std::vector<Stackage*>& deps,
243 bool get_indented_deps,
244 std::vector<std::string>& indented_deps,
245 bool no_recursion_on_wet=
false);
246 std::string getCachePath();
247 std::string getCacheHash();
250 FILE* validateCache();
251 bool expandExportString(
Stackage* stackage,
252 const std::string& instring,
253 std::string& outstring);
256 std::list<std::list<Stackage*> >& acc_list);
270 const std::string& cache_prefix,
271 const std::string& name,
272 const std::string& tag);
284 virtual const char*
usage() {
return ""; }
296 void crawl(std::vector<std::string> search_path,
bool force);
303 bool inStackage(std::string& name);
310 void setQuiet(
bool quiet);
324 bool getSearchPathFromEnv(std::vector<std::string>& sp);
331 bool find(
const std::string& name, std::string& path);
338 bool contents(
const std::string& name, std::set<std::string>& packages);
346 bool contains(
const std::string& name,
354 void list(std::set<std::pair<std::string, std::string> >& list);
360 void listDuplicates(std::vector<std::string>& dups);
366 void listDuplicatesWithPaths(std::map<std::string, std::vector<std::string> >& dups);
377 bool deps(
const std::string& name,
bool direct, std::vector<std::string>& deps);
388 bool depsOn(
const std::string& name,
bool direct,
389 std::vector<std::string>& deps);
400 bool depsDetail(
const std::string& name,
bool direct, std::vector<Stackage*>& deps);
410 bool depsOnDetail(
const std::string& name,
bool direct,
411 std::vector<Stackage*>& deps,
bool ignore_missing=
false);
421 bool depsManifests(
const std::string& name,
bool direct,
422 std::vector<std::string>& manifests);
436 bool depsMsgSrv(
const std::string& name,
bool direct,
437 std::vector<std::string>& gens);
459 bool depsIndent(
const std::string& name,
bool direct,
460 std::vector<std::string>& deps);
477 bool depsWhy(
const std::string& from,
478 const std::string& to,
479 std::string& output);
491 bool rosdeps(
const std::string& name,
bool direct,
492 std::set<std::string>& rosdeps);
493 void _rosdeps(
Stackage* stackage, std::set<std::string>& rosdeps,
const char* tag_name);
506 bool vcs(
const std::string& name,
bool direct,
507 std::vector<std::string>& vcs);
520 bool cpp_exports(
const std::string& name,
const std::string& type,
521 const std::string& attrib,
bool deps_only,
522 std::vector<std::pair<std::string, bool> >& flags);
529 bool reorder_paths(
const std::string& paths, std::string& reordered);
542 bool exports(
const std::string& name,
const std::string& lang,
543 const std::string& attrib,
bool deps_only,
544 std::vector<std::string>& flags);
553 bool exports_dry_package(
Stackage* stackage,
const std::string& lang,
554 const std::string& attrib,
555 std::vector<std::string>& flags);
567 bool plugins(
const std::string& name,
const std::string& attrib,
568 const std::string& top,
569 std::vector<std::string>& flags);
595 bool profile(
const std::vector<std::string>& search_path,
598 std::vector<std::string>& dirs);
605 void logWarn(
const std::string& msg,
606 bool append_errno =
false);
613 void logError(
const std::string& msg,
614 bool append_errno =
false);
638 virtual const char* usage();
640 virtual std::string get_manifest_type();
658 virtual const char* usage();
660 virtual std::string get_manifest_type();
std::vector< std::string > search_paths_
virtual std::string get_manifest_type()
std::string manifest_name_
std::tr1::unordered_map< std::string, std::vector< std::string > > dups_
std::string cache_prefix_
virtual const char * usage()
Usage string, to be overridden by derived classes.
Package crawler. Create one of these to operate on a package tree. Call public methods inherited from...
const std::string & getName()
Get the name of the tool that's in use (e.g., "rospack" or "rosstack")
The base class for package/stack ("stackage") crawlers. Users of the library should use the functiona...
std::tr1::unordered_map< std::string, Stackage * > stackages_
Stack crawler. Create one of these to operate on a stack tree. Call public methods inherited from Ros...