ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthToolSupport
AsgTools
util
asg_tools_test_init.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
7
8
9
//
10
// includes
11
//
12
13
#include <
AsgTools/StandaloneToolHandle.h
>
14
#include <
AsgTools/IAsgTool.h
>
15
16
//
17
// main program
18
//
19
20
int
main
(
int
argc,
char
*argv [])
21
{
22
using namespace
asg::msgUserCode;
23
ANA_CHECK_SET_TYPE
(
int
);
24
25
if
(argc < 2)
26
{
27
ANA_MSG_ERROR
(
"missing argument: [type]"
);
28
return
-1;
29
}
30
31
asg::StandaloneToolHandle<asg::IAsgTool>
tool (std::string (argv[1]) +
"/tool"
);
32
for
(
int
iter = 2; iter != argc; ++ iter)
33
{
34
const
std::string arg = argv[iter];
35
const
auto
split
= arg.find (
"="
);
36
if
(
split
== std::string::npos)
37
{
38
ANA_MSG_ERROR
(
"argument doesn't match name=value syntax: \""
<< arg <<
"\""
);
39
return
-1;
40
}
41
//cppcheck-suppress throwInEntryPoint
42
ANA_CHECK
(tool.setProperty (arg.substr (0,
split
), arg.substr (
split
+ 1)));
43
}
44
//cppcheck-suppress throwInEntryPoint
45
ANA_CHECK
(tool.initialize());
46
ANA_MSG_INFO
(
"successfully initialized tool"
);
47
return
0;
48
}
ANA_MSG_INFO
#define ANA_MSG_INFO(xmsg)
Macro printing info messages.
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:290
ANA_MSG_ERROR
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:294
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
ANA_CHECK_SET_TYPE
#define ANA_CHECK_SET_TYPE(TYPE)
set the type for ANA_CHECK to report failures
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:314
IAsgTool.h
StandaloneToolHandle.h
asg::StandaloneToolHandle
an "initializing" ToolHandle for stand-alone applications
Definition
StandaloneToolHandle.h:44
split
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition
hcg.cxx:179
main
int main()
Definition
hello.cxx:18
Generated on
for ATLAS Offline Software by
1.17.0