src
FWCore
PluginManager
bin
dump.cc
Go to the documentation of this file.
1
//<<<<<< INCLUDES >>>>>>
2
3
#include <iostream>
4
#include <utility>
5
#include <cstdlib>
6
#include <string>
7
#include <set>
8
#include <boost/program_options.hpp>
9
10
#include "
FWCore/PluginManager/interface/PluginManager.h
"
11
#include "
FWCore/PluginManager/interface/standard.h
"
12
13
using namespace
edmplugin
;
14
15
int
main
(
int
argc
,
char
**
argv
) {
16
using namespace
boost::program_options;
17
18
static
const
char
*
const
kFilesOpt =
"files"
;
19
static
const
char
*
const
kFilesCommandOpt =
"files,f"
;
20
static
const
char
*
const
kAllFilesOpt =
"all_files"
;
21
static
const
char
*
const
kAllFilesCommandOpt =
"all_files,a"
;
22
static
const
char
*
const
kHelpOpt
=
"help"
;
23
static
const
char
*
const
kHelpCommandOpt
=
"help,h"
;
24
25
std::string
descString(
argv
[0]);
26
descString +=
" [options]"
;
27
descString +=
"\nAllowed options"
;
28
options_description
desc
(descString);
29
desc
.add_options()(
kHelpCommandOpt
,
"produce help message"
)(
30
kFilesCommandOpt,
31
"list the file from which a plugin will come"
)(kAllFilesCommandOpt,
32
"list all the files to which a plugin is registered"
)
33
//(kAllCommandOpt,"when no paths given, try to update caches for all known directories [default is to only scan the first directory]")
34
;
35
36
variables_map vm;
37
try
{
38
store(command_line_parser(
argc
,
argv
).
options
(
desc
).
run
(), vm);
39
notify(vm);
40
}
catch
(
const
error
& iException) {
41
std::cerr
<< iException.what();
42
return
1;
43
}
44
45
if
(vm.count(
kHelpOpt
)) {
46
std::cout
<<
desc
<< std::endl;
47
return
0;
48
}
49
50
bool
printFiles =
false
;
51
if
(vm.count(kFilesOpt)) {
52
printFiles =
true
;
53
}
54
55
bool
printAllFiles =
false
;
56
if
(vm.count(kAllFilesOpt)) {
57
printFiles =
true
;
58
printAllFiles =
true
;
59
}
60
61
int
returnValue = EXIT_SUCCESS;
62
try
{
63
//dump all know plugins
64
PluginManager::configure
(
standard::config
());
65
66
typedef
edmplugin::PluginManager::CategoryToInfos
CatToInfos;
67
68
const
CatToInfos& catToInfos =
edmplugin::PluginManager::get
()->
categoryToInfos
();
69
// map every module to its library. Code copied from EdmPluginDump
70
for
(CatToInfos::const_iterator it = catToInfos.begin(), itEnd = catToInfos.end(); it != itEnd; ++it) {
71
std::cout
<<
"Category "
<< it->first <<
":"
<< std::endl;
72
std::string
prevPluginName;
73
for
(edmplugin::PluginManager::Infos::const_iterator itInfo = it->second.begin(), itInfoEnd = it->second.end();
74
itInfo != itInfoEnd;
75
++itInfo) {
76
std::string
pluginName
= itInfo->name_;
77
if
(
pluginName
!= prevPluginName) {
78
std::cout
<<
" "
<<
pluginName
<< std::endl;
79
if
(printFiles) {
80
std::cout
<<
" "
<< itInfo->loadable_.string() << std::endl;
81
}
82
prevPluginName =
pluginName
;
83
}
else
if
(printAllFiles) {
84
std::cout
<<
" "
<< itInfo->loadable_.string() << std::endl;
85
}
86
}
87
}
88
}
catch
(
std::exception
& iException) {
89
std::cerr
<<
"Caught exception "
<< iException.what() << std::endl;
90
returnValue = EXIT_FAILURE;
91
}
92
93
return
returnValue;
94
}
edmplugin::PluginManager::categoryToInfos
const CategoryToInfos & categoryToInfos() const
Definition:
PluginManager.h:82
relativeConstraints.error
error
Definition:
relativeConstraints.py:53
edmplugin::PluginManager::configure
static PluginManager & configure(const Config &)
Definition:
PluginManager.cc:315
edmplugin::PluginManager::CategoryToInfos
std::map< std::string, Infos > CategoryToInfos
Definition:
PluginManager.h:51
cmsBatch.argv
argv
Definition:
cmsBatch.py:279
writedatasetfile.run
run
Definition:
writedatasetfile.py:27
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
cppFunctionSkipper.exception
exception
Definition:
cppFunctionSkipper.py:10
edmplugin::standard::config
PluginManager::Config config()
Definition:
standard.cc:21
submitPVResolutionJobs.desc
string desc
Definition:
submitPVResolutionJobs.py:251
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition:
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8
kHelpCommandOpt
static const char *const kHelpCommandOpt
Definition:
CmsShowMain.cc:106
PluginManager.h
dir2webdir.argc
argc
Definition:
dir2webdir.py:39
main
int main(int argc, char **argv)
Definition:
dump.cc:15
crab_NZS2018C_1.pluginName
pluginName
Definition:
crab_NZS2018C_1.py:10
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
kHelpOpt
static const char *const kHelpOpt
Definition:
CmsShowMain.cc:105
edmplugin::PluginManager::get
static PluginManager * get()
Definition:
PluginManager.cc:306
AlcaSiPixelAliHarvester0T_cff.options
options
Definition:
AlcaSiPixelAliHarvester0T_cff.py:42
edmplugin
Definition:
AlignmentAlgorithmPluginFactory.cc:9
standard.h
Generated for CMSSW Reference Manual by
1.8.14