#include <iostream>
#include <string>
#include "GaudiKernel/IClassManager.h"
#include "GaudiKernel/IProperty.h"
#include "GaudiKernel/ISvcLocator.h"
#include "GaudiKernel/SmartIF.h"
#include "GaudiKernel/IAppMgrUI.h"
#include "GaudiKernel/IClassIDSvc.h"
#include "GaudiKernel/Bootstrap.h"
#include "AthenaKernel/errorcheck.h"
#include <boost/program_options.hpp>
Go to the source code of this file.
◆ doBanner()
◆ initGaudi()
IAppMgrUI* initGaudi |
( |
const std::string & |
options, |
|
|
bool |
verbose, |
|
|
ISvcLocator *& |
svcLocator |
|
) |
| |
Definition at line 31 of file genCLIDDB.cxx.
32 IAppMgrUI*
theApp = Gaudi::createApplicationMgr();
33 SmartIF<IProperty> propMgr(
theApp);
38 CHECK_WITH_CONTEXT( propMgr->setProperty(
"JobOptionsType",
"NONE"),
"initGaudi",
nullptr );
41 CHECK_WITH_CONTEXT( propMgr->setProperty(
"OutputLevel", MSG::WARNING),
"initGaudi",
nullptr );
45 svcLocator = Gaudi::svcLocator();
◆ inputError()
int inputError |
( |
const std::string & |
errDescr, |
|
|
const po::options_description & |
optDescr |
|
) |
| |
Definition at line 25 of file genCLIDDB.cxx.
26 std::cerr << errDescr <<
"\n" << optDescr << std::endl;
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 50 of file genCLIDDB.cxx.
53 const std::string appName(
"genCLIDDB");
54 po::options_description
desc(appName +
" allowed options");
56 (
"help,h",
"produce help message")
57 (
"package,p", po::value<std::string>(),
"package we want to load clids from")
58 (
"input,i", po::value<std::string>(),
"optional path to input clid db file")
59 (
"output,o", po::value<std::string>(),
"optional path to resulting clid db file")
60 (
"jobopts,j", po::value<std::string>(),
"name of optional job options txt file, located at ../share/jobopts")
61 (
"verbose,v", po::value<bool>()->implicit_value(
true),
"verbose output")
63 std::string packageName(
"ALL");
64 std::string inputCLIDDB;
75 if (vm.count(
"help")) {
76 std::cout <<
desc << std::endl;
80 if (vm.count(
"package")) {
81 packageName = vm[
"package"].as<std::string>();
83 return inputError(
"Please specify a package using option --package.\n",
desc);
86 if (vm.count(
"output")) {
92 bool verbose = vm.count(
"verbose") && vm[
"verbose"].as<
bool>();
95 ISvcLocator* pSvcLoc(
nullptr);
96 std::string
jobopts(
"CLIDComps/minimalPrintout.opts");
97 if (vm.count(
"jobopts")) {
98 jobopts = vm[
"jobopts"].as<std::string>();
101 std::cerr <<
"cannot initialize Gaudi" << std::endl;
106 SmartIF<IMessageSvc>
msgSvc(pSvcLoc);
108 std::cerr <<
"cannot retrieve MessageSvc" << std::endl;
113 log.setLevel(MSG::WARNING);
116 SmartIF<IClassManager> pICM(pSvcLoc);
117 if (!pICM.isValid()) {
118 log << MSG::ERROR <<
"cannot retrieve ClassManager" <<
endmsg;
122 IClassIDSvc* pClassIDSvc(
nullptr);
125 SmartIF<IProperty> pCLIDSvcProp(pClassIDSvc);
126 if (!pCLIDSvcProp.isValid()) {
127 log << MSG::ERROR <<
"cannot retrieve ClassIDSvc" << std::endl;
131 log << MSG::INFO <<
"Writing clid.db for package "
135 std::string dbfiles(
"{}");
136 if (vm.count(
"input")) {
137 log << MSG::INFO <<
"Reading clid.db from " << vm[
"input"].as<std::string>() <<
"." <<
endmsg;
138 dbfiles =
"{\"" + vm[
"input"].as<std::string>() +
"\"}";
150 return (pClassIDSvc->finalize()).isSuccess() ? 0 : -1;