Skip to content

Commit

Permalink
thread-safety: return const* for getDTConfigBti and getDTConfigTraco too
Browse files Browse the repository at this point in the history
  • Loading branch information
smuzaffar committed Nov 12, 2013
1 parent 6407681 commit ba2e54b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions L1TriggerConfig/DTTPGConfig/interface/DTConfigManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ class DTConfigManager {
~DTConfigManager();

//! Get desired BTI configuration
DTConfigBti* getDTConfigBti(DTBtiId) const;
const DTConfigBti* getDTConfigBti(DTBtiId) const;

//! Get desired BTI configuration map for a given DTChamber
const std::map<DTBtiId,DTConfigBti>& getDTConfigBtiMap(DTChamberId) const;

//! Get desired TRACO configuration
DTConfigTraco* getDTConfigTraco(DTTracoId) const;
const DTConfigTraco* getDTConfigTraco(DTTracoId) const;

//! Get desired TRACO configuration map for a given DTChamber
const std::map<DTTracoId,DTConfigTraco>& getDTConfigTracoMap(DTChamberId) const;
Expand Down
8 changes: 4 additions & 4 deletions L1TriggerConfig/DTTPGConfig/src/DTConfigManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ DTConfigManager::~DTConfigManager(){
// Operations --
//--------------

DTConfigBti* DTConfigManager::getDTConfigBti(DTBtiId btiid) const {
const DTConfigBti* DTConfigManager::getDTConfigBti(DTBtiId btiid) const {

DTChamberId chambid = btiid.SLId().chamberId();
BtiMap::const_iterator biter1 = my_btimap.find(chambid);
Expand All @@ -82,7 +82,7 @@ DTConfigBti* DTConfigManager::getDTConfigBti(DTBtiId btiid) const {
<< ") not found, return 0" << std::endl;
return 0;
}
return const_cast<DTConfigBti*>(&(*biter2).second);
return &(*biter2).second;

}

Expand All @@ -100,7 +100,7 @@ const std::map<DTBtiId,DTConfigBti>& DTConfigManager::getDTConfigBtiMap(DTChambe

}

DTConfigTraco* DTConfigManager::getDTConfigTraco(DTTracoId tracoid) const {
const DTConfigTraco* DTConfigManager::getDTConfigTraco(DTTracoId tracoid) const {

DTChamberId chambid = tracoid.ChamberId();
TracoMap::const_iterator titer1 = my_tracomap.find(chambid);
Expand All @@ -121,7 +121,7 @@ DTConfigTraco* DTConfigManager::getDTConfigTraco(DTTracoId tracoid) const {
<< ") not found, return a reference to the end of the map" << std::endl;
return 0;
}
return const_cast<DTConfigTraco*>(&(*titer2).second);
return &(*titer2).second;

}

Expand Down

0 comments on commit ba2e54b

Please sign in to comment.