ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
DetectorDescription
AGDD
AGDDHandlers
src
foreachHandler.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
AGDDHandlers/foreachHandler.h
"
6
#include "
AGDDControl/XercesParser.h
"
7
#include "
AGDDControl/AGDDController.h
"
8
#include <iostream>
9
10
11
using namespace
xercesc;
12
13
foreachHandler::foreachHandler
(
const
std::string& s,
14
AGDDController
& c)
15
:
XMLHandler
(s, c)
16
{
17
// std::cout<<"Creating handler for foreach"<<std::endl;
18
}
19
20
void
foreachHandler::ElementHandle
(
AGDDController
& c,
21
xercesc::DOMNode *t)
22
{
23
std::string
index
=
getAttributeAsString
(c, t,
"index"
);
24
int
ibegin=
getAttributeAsInt
(c, t,
"begin"
);
25
int
iloops=
getAttributeAsInt
(c, t,
"loops"
);
26
StopLoop
(
true
);
27
c.Evaluator().RegisterVariable(
index
,ibegin);
28
29
IAGDDParser
& parser = *c.GetParser();
30
DOMNode *fChild=t->getFirstChild();
31
for
(
int
i=ibegin;i<ibegin+iloops;i++)
32
{
33
34
// std::cout<<"\t\tindex "<<i<<std::endl;
35
c.Evaluator().RegisterVariable(
index
,i);
36
37
DOMNode *child;
38
for
(child=fChild;child!=0;child=child->getNextSibling())
39
{
40
if
(child->getNodeType()==DOMNode::ELEMENT_NODE) {
41
parser.elementLoop(c, child);
42
}
43
}
44
45
46
}
47
48
}
AGDDController.h
XercesParser.h
AGDDController
Definition
AGDDController.h:30
IAGDDParser
Definition
IAGDDParser.h:15
XMLHandler::StopLoop
void StopLoop(bool)
Definition
XMLHandler.cxx:28
XMLHandler::getAttributeAsInt
int getAttributeAsInt(AGDDController &c, const xercesc::DOMNode *t, const std::string &) const
Definition
XMLHandler.cxx:89
XMLHandler::XMLHandler
XMLHandler(const std::string &n, AGDDController &c)
Definition
XMLHandler.cxx:15
XMLHandler::getAttributeAsString
std::string getAttributeAsString(AGDDController &c, const xercesc::DOMNode *t, const std::string &) const
Definition
XMLHandler.cxx:69
foreachHandler::foreachHandler
foreachHandler(const std::string &, AGDDController &c)
Definition
foreachHandler.cxx:13
foreachHandler::ElementHandle
virtual void ElementHandle(AGDDController &c, xercesc::DOMNode *t) override
Definition
foreachHandler.cxx:20
foreachHandler.h
index
Definition
index.py:1
Generated on
for ATLAS Offline Software by
1.17.0