ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthToolSupport
AsgTools
util
asg_component_factory_scanner.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
7
8
//
9
// includes
10
//
11
12
#include <
AsgTools/AsgComponentFactories.h
>
13
#include <
AsgTools/MessageCheckAsgTools.h
>
14
#include <fstream>
15
16
//
17
// program implementation
18
//
19
20
using namespace
asg
;
21
using namespace
asg::msgComponentConfig;
22
44
45
int
main
(
int
argc,
char
**argv)
46
{
47
if
(argc != 3)
48
{
49
ATH_MSG_ERROR
(
"usage: "
<< argv[0] <<
" <module path> <output file>"
);
50
return
1;
51
}
52
53
const
std::string modulePathName = argv[1];
54
const
std::string outputFile = argv[2];
55
56
std::string modulePath, moduleName;
57
{
58
const
auto
pos = modulePathName.find_last_of (
'/'
);
59
if
(pos != std::string::npos)
60
{
61
modulePath = modulePathName.substr (0, pos);
62
moduleName = modulePathName.substr (pos + 1);
63
}
64
else
65
{
66
modulePath =
"."
;
67
moduleName = modulePathName;
68
}
69
}
70
71
if
(
auto
types
= getLoadedComponentFactoryTypes (); !
types
.empty())
72
{
73
ANA_MSG_ERROR
(
"already loaded component factory types:"
);
74
for
(
const
auto
&
type
:
types
)
75
ANA_MSG_ERROR
(
" "
<<
type
);
76
return
1;
77
}
78
79
ATH_MSG_DEBUG
(
"loading component factory preloader module from "
<< modulePath <<
" with name "
<< moduleName);
80
loadComponentFactoryModule (moduleName, modulePath);
81
82
std::ofstream outputStream (outputFile);
83
for
(
auto
&
type
: getLoadedComponentFactoryTypes ())
84
{
85
ANA_MSG_DEBUG
(
"module loaded type "
<<
type
);
86
outputStream << moduleName <<
" "
<<
type
<<
"\n"
;
87
}
88
89
return
0;
90
}
AsgComponentFactories.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
ANA_MSG_ERROR
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:294
ANA_MSG_DEBUG
#define ANA_MSG_DEBUG(xmsg)
Macro printing debug messages.
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:288
MessageCheckAsgTools.h
types
static const std::vector< std::string > types
Definition
MuonTriggerSFFilesTest.cxx:20
main
int main()
Definition
hello.cxx:18
asg
Definition
DataHandleTestTool.h:28
type
Generated on
for ATLAS Offline Software by
1.17.0