ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
DetectorDescription
GeoModel
GeoModelUtilities
GeoModelUtilities
GeoGetIds.h
Go to the documentation of this file.
1
// This file's extension implies that it's C, but it's really -*- C++ -*-.
2
/*
3
* Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration.
4
*/
11
12
13
#ifndef GEOMODELUTILITIES_GEOGETIDS_H
14
#define GEOMODELUTILITIES_GEOGETIDS_H
15
17
#include "
GeoPrimitives/GeoPrimitives.h
"
18
19
#include "GeoModelKernel/GeoNodeAction.h"
20
21
27
class
IGeoGetIdsAction
28
{
29
public
:
30
virtual
~IGeoGetIdsAction
() =
default
;
31
virtual
void
operator()
(
int
id
) = 0;
32
};
33
34
39
class
GeoGetIds
40
:
public
GeoNodeAction
41
{
42
public
:
43
GeoGetIds
(
IGeoGetIdsAction
& action,
int
depthLimit = 1);
44
virtual
void
handleSerialTransformer
(
const
GeoSerialTransformer *sT)
override
;
45
virtual
void
handleIdentifierTag
(
const
GeoIdentifierTag *idTag)
override
;
46
virtual
void
handleSerialIdentifier
(
const
GeoSerialIdentifier *sI)
override
;
47
48
49
private
:
50
IGeoGetIdsAction
&
m_action
;
51
const
GeoSerialIdentifier *
m_serialIdentifier
=
nullptr
;
52
};
53
54
58
template
<
class
FUNCTION>
59
class
GeoGetIdsAction
60
:
public
IGeoGetIdsAction
61
{
62
public
:
63
GeoGetIdsAction
(FUNCTION f) :
m_f
(f) {}
64
virtual
void
operator()
(
int
id
)
override
65
{
66
m_f
(
id
);
67
}
68
FUNCTION
m_f
;
69
};
70
71
72
81
template
<
class
FUNCTION>
82
void
geoGetIds
(FUNCTION f,
const
GeoGraphNode*
node
,
int
depthLimit = 1)
83
{
84
GeoGetIdsAction<FUNCTION>
act (f);
85
GeoGetIds
visitor (act, depthLimit);
86
node
->exec (&visitor);
87
}
88
89
90
#endif
// not GEOMODELUTILITIES_GEOGETIDS_H
geoGetIds
void geoGetIds(FUNCTION f, const GeoGraphNode *node, int depthLimit=1)
Template helper for running the visitor.
Definition
GeoGetIds.h:82
GeoPrimitives.h
GeoGetIdsAction
Callback object calling a templated functional.
Definition
GeoGetIds.h:61
GeoGetIdsAction::operator()
virtual void operator()(int id) override
Definition
GeoGetIds.h:64
GeoGetIdsAction::m_f
FUNCTION m_f
Definition
GeoGetIds.h:68
GeoGetIdsAction::GeoGetIdsAction
GeoGetIdsAction(FUNCTION f)
Definition
GeoGetIds.h:63
GeoGetIds
Visitor to traverse a GeoModel graph and make a callback for each identifier found.
Definition
GeoGetIds.h:41
GeoGetIds::handleIdentifierTag
virtual void handleIdentifierTag(const GeoIdentifierTag *idTag) override
Definition
GeoGetIds.cxx:34
GeoGetIds::handleSerialIdentifier
virtual void handleSerialIdentifier(const GeoSerialIdentifier *sI) override
Definition
GeoGetIds.cxx:41
GeoGetIds::m_action
IGeoGetIdsAction & m_action
Definition
GeoGetIds.h:50
GeoGetIds::handleSerialTransformer
virtual void handleSerialTransformer(const GeoSerialTransformer *sT) override
Definition
GeoGetIds.cxx:23
GeoGetIds::GeoGetIds
GeoGetIds(IGeoGetIdsAction &action, int depthLimit=1)
Definition
GeoGetIds.cxx:15
GeoGetIds::m_serialIdentifier
const GeoSerialIdentifier * m_serialIdentifier
Definition
GeoGetIds.h:51
IGeoGetIdsAction
Ensure that the extensions for the Vector3D are properly loaded.
Definition
GeoGetIds.h:28
IGeoGetIdsAction::operator()
virtual void operator()(int id)=0
IGeoGetIdsAction::~IGeoGetIdsAction
virtual ~IGeoGetIdsAction()=default
node
Definition
node.h:24
Generated on
for ATLAS Offline Software by
1.17.0