ATLAS Offline Software
Loading...
Searching...
No Matches
TGCModuleMap.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
7namespace MuonTGC_Cabling {
8
10
11std::unique_ptr<TGCModuleId> TGCModuleMap::popModule(const int port) {
12 auto itr = m_moduleMap.find(port);
13 if (itr != m_moduleMap.end()) {
14 std::unique_ptr<TGCModuleId> returnMe = std::move(itr->second);
15 m_moduleMap.erase(itr);
16 return returnMe;
17 }
18 return nullptr;
19}
20TGCModuleMap::Store_t::const_iterator TGCModuleMap::begin() const {
21 return m_moduleMap.begin();
22}
23TGCModuleMap::Store_t::const_iterator TGCModuleMap::end() const {
24 return m_moduleMap.end();
25}
26TGCModuleMap::Store_t::iterator TGCModuleMap::begin() {
27 return m_moduleMap.begin();
28}
29TGCModuleMap::Store_t::iterator TGCModuleMap::end() {
30 return m_moduleMap.end();
31}
32
33void TGCModuleMap::insert(int connector,
34 std::unique_ptr<TGCModuleId> moduleId) {
35 m_moduleMap.emplace(connector, std::move(moduleId));
36}
37
38bool TGCModuleMap::empty() const {
39 return m_moduleMap.empty();
40}
41std::size_t TGCModuleMap::size() const {
42 return m_moduleMap.size();
43}
44
46 m_moduleMap.clear();
47}
48
49} // namespace MuonTGC_Cabling
Store_t::const_iterator end() const
Returns the end iterator of the underlying map.
Store_t::const_iterator begin() const
Returns the begin iterator of the underlying map.
void insert(int connector, std::unique_ptr< TGCModuleId > moduleId)
std::unique_ptr< TGCModuleId > popModule(const int connector)
Return a certain module and remove it from the map.