ATLAS Offline Software
Loading...
Searching...
No Matches
ToObj2MultiAssociationTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5// $Id$
12
13
15
16
17namespace D3PDTest {
18
19
27 (const std::string& type,
28 const std::string& name,
29 const IInterface* parent)
30 : Base (type, name, parent)
31{
32 declareProperty ("Which", m_which = 0);
33}
34
35
41{
42 if (m_which == 0) {
43 m_it = p.m_vo2.begin();
44 m_end = p.m_vo2.end();
45 }
46 else {
47 m_it = p.m_vo3.begin();
48 m_end = p.m_vo3.end();
49 }
50 return StatusCode::SUCCESS;
51}
52
53
59{
60 m_tmpvec.clear();
61 m_tmpvec.push_back (p);
62 m_it = m_tmpvec.begin();
63 m_end = m_tmpvec.end();
64 return StatusCode::SUCCESS;
65}
66
67
74{
75 if (m_it == m_end)
76 return 0;
77 const Obj2* p = &*m_it;
78 ++m_it;
79 return p;
80}
81
82
83} // namespace D3PDTest
Test code: Test MultiAssociationToolMulti.
Test class for D3PD maker.
Definition Obj1.h:38
Test class for D3PD maker.
Definition Obj2.h:28
std::vector< Obj2 >::const_iterator m_it
ToObj2MultiAssociationTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
virtual const Obj2 * next()
Return a pointer to the next element in the association.
std::vector< Obj2 >::const_iterator m_end
D3PD::MultiAssociationTool< D3PD::Types< Obj1, Obj2 >, Obj2 > Base
virtual StatusCode reset(const Obj1 &p)
Start the iteration for a new association.