28 std::cout <<
"Usage: " << argv0 <<
" [option] library1 [library2 ...]\n" 29 "\n list the component factories present in the given libraries\n\n" 31 " -h, --help show this help message and exit\n" 32 " -o OUTPUT, --output OUTPUT\n" 33 " write the list of factories on the file OUTPUT, use - for\n" 34 " standard output (default)\n" 39 std::cout <<
"Usage: " << argv0 <<
" [option] library1 [library2 ...]\n" 40 "Try `" << argv0 <<
" -h' for more information.\n" 60 auto i = argv0.
rfind(
'/');
61 if (i != std::string::npos)
68 if (arg ==
"-o" || arg ==
"--output") {
76 }
else if (arg ==
"-h" || arg ==
"--help") {
92 if (output_opt !=
"-") {
98 for (
char* lib: libs) {
99 if (dlopen(lib, RTLD_LAZY | RTLD_LOCAL)) {
101 auto f = loaded.
find(factory);
102 if ( f == loaded.
end()) {
103 output << lib <<
":" << factory <<
std::endl;
106 std::cerr <<
"WARNING: factory '" << factory
107 <<
"' already found in " << f->second
111 std::cerr <<
"ERROR: failed to load " << lib
void usage(std::string argv0)
std::set< KeyType > loadedFactories() const
Return a list of all the known and loaded factories.
int main(int argc, char *argv[])
void help(std::string argv0)
static Registry & instance()
Retrieve the singleton instance of Registry.
In-memory database of the loaded factories.