Belle II Software development
QuadTreeItem.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#pragma once
9
10namespace Belle2 {
15 namespace TrackFindingCDC {
16
17 class CDCWireHit;
18 class CDCSegment2D;
19
26 template<class AData>
28 public:
30 explicit QuadTreeItem(AData* data)
31 : m_data(data)
32 , m_usedFlag(false) {};
33
34 private:
36 QuadTreeItem(const QuadTreeItem& copy) = delete;
37
39 QuadTreeItem& operator=(QuadTreeItem const& copy) = delete;
40
41 public:
43 AData* getPointer() const
44 {
45 return m_data;
46 }
47
52 bool isUsed() const
53 {
54 return m_usedFlag;
55 }
56
58 void setUsedFlag(bool usedFlag = true)
59 {
60 m_usedFlag = usedFlag;
61 }
62
65 {
66 setUsedFlag(false);
67 }
68
69 private:
71 AData* m_data;
72
75 };
76
80 template<>
82
86 template<>
88
92 template<>
94
98 template<>
100 }
102}
This class serves as a wrapper around all things that should go into a QuadTree.
Definition: QuadTreeItem.h:27
bool m_usedFlag
This flag can be set to not use the item in the next quad tree search round.
Definition: QuadTreeItem.h:74
QuadTreeItem(const QuadTreeItem &copy)=delete
Do not copy!
QuadTreeItem(AData *data)
Constructor.
Definition: QuadTreeItem.h:30
bool isUsed() const
Flag is set if the item was used as a result of the quad tree search and should not be used in the ne...
Definition: QuadTreeItem.h:52
AData * m_data
A pointer to the underlying item data.
Definition: QuadTreeItem.h:71
QuadTreeItem & operator=(QuadTreeItem const &copy)=delete
Do not copy!
AData * getPointer() const
Returns the underlying data.
Definition: QuadTreeItem.h:43
void unsetUsedFlag()
Unset the used flag again if you have noticed that a previous setting was wrong.
Definition: QuadTreeItem.h:64
void setUsedFlag(bool usedFlag=true)
Set the used flag if you do not want that item to go into the next search round again.
Definition: QuadTreeItem.h:58
Abstract base class for different kinds of events.