Gaudi Framework, version v25r0

Home   Generated: Mon Feb 17 2014
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
listcomponents.cpp File Reference
#include <iostream>
#include <string>
#include <set>
#include <cstdlib>
#include <getopt.h>
#include <dlfcn.h>
#include <Gaudi/PluginService.h>
Include dependency graph for listcomponents.cpp:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Function Documentation

int main ( int  argc,
char *  argv[] 
)
Author
Marco Clemencic marco.nosp@m..cle.nosp@m.menci.nosp@m.c@ce.nosp@m.rn.ch

Definition at line 24 of file listcomponents.cpp.

{
Gaudi::PluginService::Details::Registry &reg =
// cache to keep track of the loaded factories
{
// initialize the local cache
std::set<key_type> base = reg.loadedFactories();
for (std::set<key_type>::const_iterator f = base.begin(); f != base.end(); ++f)
{
loaded.insert(std::make_pair(*f, std::string("<preloaded>")));
}
}
// loop over the list of libraries passed on the command line
for (int i = 1; i < argc; ++i) {
if (dlopen(argv[i], RTLD_LAZY | RTLD_LOCAL)) {
std::set<key_type> factories = reg.loadedFactories();
for (f = factories.begin(); f != factories.end(); ++f) {
if (loaded.find(*f) == loaded.end())
{
std::cout << argv[i] << ":" << *f << std::endl;
loaded[*f] = argv[i];
}
else
std::cerr << "WARNING: factory '" << *f
<< "' already found in " << loaded[*f]
}
} else {
std::cerr << "ERROR: failed to load " << argv[i] << std::endl;
return EXIT_FAILURE;
}
}
return EXIT_SUCCESS;
}

Generated at Mon Feb 17 2014 14:37:54 for Gaudi Framework, version v25r0 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004