ATLAS Offline Software
Control/SGTools/src/DataStore.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "SGTools/DataStore.h"
6 #include "SGTools/DataProxy.h"
7 #include "SGTools/exceptions.h"
10 #include "GaudiKernel/ClassID.h"
11 #include "GaudiKernel/MsgStream.h"
12 #include "GaudiKernel/Bootstrap.h"
13 #include "GaudiKernel/ISvcLocator.h"
15 #include "CxxUtils/SimpleUpdater.h"
18 
19 using namespace std;
20 using SG::DataStore;
21 using SG::DataProxy;
22 using SG::ProxyMap;
23 using SG::ProxyIterator;
25 
26 
31 DataStore::DataStore (IProxyDict& pool)
32  : m_pool (pool),
33  m_storeMap(),
34  m_keyMap(KeyMap_t::Updater_t()),
35  m_storeID(StoreID::UNKNOWN), m_t2p(),
36  m_noAudSvc(0), m_pSvcLoc(0)
37 {
38  setSvcLoc().ignore();
39 }
40 
41 //Destructor
43 {
44  clearStore(false, true, nullptr);
45 }
46 
48  StatusCode sc(StatusCode::FAILURE);
49  m_pSvcLoc = Gaudi::svcLocator( );
50  if (!m_pSvcLoc) std::cout<<"DataStore::setSvcLoc: WARNING svcLocator not found! "<<std::endl;
51  return sc;
52 }
53 
55  if (!m_pSGAudSvc) {
56  //try once to get the service
57  if (!m_noAudSvc) {
58  const bool DONOTCREATE(false);
59  m_pSGAudSvc = m_pSvcLoc->service("SGAudSvc", DONOTCREATE);
60  m_noAudSvc = not m_pSGAudSvc.isValid();
61  }
62  }
63  return;
64 }
65 
66 
68 void DataStore::clearStore(bool force, bool hard, MsgStream* /*pmlog*/)
69 {
72 
80  std::unordered_set<DataProxy*> removed;
81 
87  for (size_t i = 0; i < m_proxies.size(); ) {
89  if (ATH_UNLIKELY (dp->requestRelease (force, hard))) {
90  removed.insert (dp);
91  if (removeProxyImpl (dp, i).isFailure()) {
92  ++i;
93  }
94  }
95  else {
96  ++i;
97  }
98  }
99 
100  if (!removed.empty()) {
101  KeyMap_t newMap (KeyMap_t::Updater_t(), m_keyMap.capacity());
102  {
103  auto lock = newMap.lock();
104  auto ctx = KeyMap_t::Updater_t::defaultContext();
105  for (auto p : m_keyMap) {
106  if (removed.count (p.second) == 0) {
107  newMap.emplace (lock, p.first, p.second, ctx);
108  }
109  }
110  }
111  m_keyMap.swap (newMap);
112  }
113 
114  // clear T2PMap
115  m_t2p.clear();
116 }
117 
119 // access all the keys associated with an object:
120 //
121 void DataStore::keys(const CLID& id, std::vector<std::string>& vkeys,
122  bool includeAlias, bool onlyValid)
123 {
124  vkeys.clear();
125  for (const ProxyMap::value_type& p : m_storeMap[id]) {
126  bool includeProxy(true);
127  if (onlyValid) includeProxy=p.second->isValid();
128  if (includeAlias) {
129  if (includeProxy) vkeys.push_back(p.first);
130  }
131  else {
132  if (p.first == p.second->name() && includeProxy)
133  vkeys.push_back(p.first);
134  }
135  }
136 }
137 
139 //---------------------------------------------------------------//
140 // record the proxy in StoreGate
141 StatusCode
143 {
144  if (!dp) {
145  return StatusCode::FAILURE;
146  }
147 
150  bool primary = false;
151  if (dp->store() == nullptr) {
152  m_proxies.push_back (dp);
153  primary = true;
154  }
155 
156  if (id == 0 && dp->clID() == 0 && dp->sgkey() != 0) {
157  // Handle a dummied proxy.
158  m_keyMap.emplace (dp->sgkey(), dp);
159  }
160  else {
161  ProxyMap& pmap = m_storeMap[id];
162 
163  // Set the primary key.
164  sgkey_t primary_sgkey = m_pool.stringToKey (dp->name(), dp->clID());
165  sgkey_t sgkey = primary_sgkey;
166  if (id != dp->clID()) {
167  sgkey = m_pool.stringToKey (dp->name(), id);
168  }
169  if (dp->sgkey() == 0) {
170  dp->setSGKey (sgkey);
171  }
172 
173  if (!m_keyMap.emplace (sgkey, dp).second) {
174  if (primary) {
175  m_proxies.pop_back();
176  }
177  return StatusCode::FAILURE;
178  }
179 
180  pmap.insert(ProxyMap::value_type(dp->name(), dp));
181  }
182 
183  // Note : No checking if proxy already exists in store because it
184  // is already checked in StoreGateSvc.
185  // if (pmap.find(dp->name()) == pmap.end()) {
186  dp->addRef(); // The store now owns this
187  dp->setT2p(&m_t2p);
188  dp->setStore(&m_pool);
189 
190  return StatusCode::SUCCESS;
191 }
192 
193 
195 //---------------------------------------------------------------//
196 // if Proxy is a resettable proxy only then reset it, otherwise
197 // delete it and remove from proxy map.
199 DataStore::removeProxy(DataProxy* proxy, bool forceRemove, bool hard)
200 {
201  if (!proxy) {
202  return StatusCode::FAILURE;
203  }
204 
205  if (!forceRemove && proxy->isResetOnly()) {
206  // A reset-only proxy. Don't remove it.
207  proxy->reset (hard);
208  return StatusCode::SUCCESS;
209  }
210 
211  // First remove from m_keyMap.
212  // We may fail to find the entry if this is a key that has been versioned.
213  // E.g., we add aVersObj. Call this DP1.
214  // Then we add a new version of it. Call this DP2.
215  // The version logic will add the alias ';00;aVersObj' to DP1.
216  // It will also then add the alias `aVersObj' to DP2.
217  // This will overwrite the entries for DP1 in pmap and m_keyMap.
218  // If we then clear and DP2 is removed first, then the m_keyMap entry
219  // for DP1's primary key will be gone.
220  // FIXME: Should just remove the versioned key code ... it's anyway
221  // not compatible with MT.
222  removeFromKeyMap (proxy).ignore();
223 
224  // Then remove from the m_storeMap and release the proxy.
225  auto it = std::find (m_proxies.begin(), m_proxies.end(), proxy);
226  if (it == m_proxies.end()) {
227  return StatusCode::FAILURE;
228  }
229  return removeProxyImpl (proxy, it - m_proxies.begin());
230 }
231 
232 
238 {
239  SG::DataProxy::AliasCont_t alias_set = proxy->alias();
240  std::string name = proxy->name();
241 
242  for (CLID symclid : proxy->transientID())
243  {
244  sgkey_t sgkey = m_pool.stringToKey (name, symclid);
245  m_keyMap.erase (sgkey);
246 
247  for (const std::string& alias : alias_set) {
248  m_keyMap.erase (m_pool.stringToKey (alias, symclid));
249  }
250  }
251 
252  return StatusCode::SUCCESS;
253 }
254 
255 
266 {
267  proxy->setStore (nullptr);
268 
269  std::string name = proxy->name();
270  CLID clid = proxy->clID();
271  SG::DataProxy::AliasCont_t alias_set = proxy->alias();
272 
273  // nb. This has to be here, not just before the loop below,
274  // as the proxy may be deleted in the meantime.
276 
277  StoreIterator storeIter = m_storeMap.find(clid);
278  if (storeIter != m_storeMap.end()) {
279  ProxyMap& pmap = storeIter->second;
280 
281  // first remove the alias key:
282  for (const std::string& alias : alias_set) {
283  if (1 == pmap.erase(alias)) proxy->release();
284  }
285 
286  // Remove primary entry.
287  if (1 == pmap.erase(name)) {
288  proxy->release();
289  }
290  }
291  else {
292  // A dummy proxy.
293  proxy->release();
294  }
295 
296  // Remove all symlinks too.
297  for (CLID symclid : clids)
298  {
299  if (clid == symclid) continue;
300  storeIter = m_storeMap.find(symclid);
301  if (storeIter != m_storeMap.end()) {
302  ProxyMap& pmap = storeIter->second;
303  SG::ProxyIterator it = pmap.find (name);
304  if (it != pmap.end() && it->second == proxy) {
305  storeIter->second.erase (it);
306  proxy->release();
307  }
308 
309  for (const std::string& alias : alias_set) {
310  if (1 == pmap.erase (alias)) proxy->release();
311  }
312  }
313  } //symlinks loop
314 
315  if (index != -1 && !m_proxies.empty()) {
316  // Remove the proxy from m_proxies. If it's not at the end, then
317  // move the proxy at the end to this proxy's index (and update the
318  // index for the other proxy stored in m_keyMap).
319  if (index != (int)m_proxies.size() - 1) {
320  m_proxies[index] = m_proxies.back();
321  }
322  m_proxies.pop_back();
323  }
324 
325  return StatusCode::SUCCESS;
326 }
327 
329 //---------------------------------------------------------------//
330 // record the symlink in StoreGate
331 StatusCode
333 {
334  // Make sure the symlink doesn't already exist.
335  DataProxy* exist = proxy_exact (linkid, dp->name());
336  if (exist == dp) {
337  // Entry already exists pointing at the desired proxy.
338  return StatusCode::SUCCESS;
339  }
340  else if (!exist) {
341  dp->setTransientID(linkid);
342  return addToStore(linkid, dp);
343  }
344 
345  // Already an existing proxy.
346  if (exist->isValidObject()) {
347  // And it's set to something. Ok if it's the same DataObject.
348  // Otherwise fail.
349  if (exist->object() == dp->object()) {
350  dp->setTransientID(linkid);
351  return StatusCode::SUCCESS;
352  }
353  return StatusCode::FAILURE;
354  }
355  if (!dp->object()) {
356  return StatusCode::FAILURE;
357  }
358  if (exist->loader()) {
359  return StatusCode::FAILURE;
360  }
361 
362  // The existing proxy is not set to anything, and it doesn't have a loader.
363  // It may have been created by a forward-declared link to a base class.
364  // In that case, set the existing proxy to also point at the same DataObject.
365  const SG::BaseInfoBase* bib = SG::BaseInfoBase::find (dp->clID());
366  if (bib && bib->is_base (exist->clID())) {
367  dp->setTransientID(linkid);
368  exist->setObject (dp->object(), false);
369  return StatusCode::SUCCESS;
370  }
371 
372  // Entry already exists pointing at another proxy.
373  // Don't change the existing entry.
374  return StatusCode::FAILURE;
375 }
376 //---------------------------------------------------------------//
377 // record the alias in StoreGate
379 DataStore::addAlias(const std::string& aliasKey, DataProxy* dp)
380 {
381  for (CLID clid : dp->transientID()) {
382  // locate proxy map and add alias to proxymap
383  ProxyMap& pmap = m_storeMap[clid];
384 
385  // check if another proxy for the same type caries the same alias.
386  // if yes, then remove that alias from that proxy and establish the
387  // alias in the new proxy.
388  // pmap.insert will overwrite, associate alias with new proxy.
389  ConstProxyIterator p_iter = pmap.find(aliasKey);
390  if (p_iter != pmap.end() && dp->clID() == p_iter->second->clID()) {
391  if (dp->name() == p_iter->second->name()) return StatusCode::SUCCESS;
392  p_iter->second->removeAlias(aliasKey);
393  p_iter->second->release();
394  }
395  dp->addRef();
396  pmap[aliasKey] = dp;
397  m_keyMap.emplace (m_pool.stringToKey (aliasKey, clid), dp);
398  }
399 
400  // set alias in proxy
401  dp->setAlias(aliasKey);
402 
403  return StatusCode::SUCCESS;
404 }
405 //---------------------------------------------------------------//
406 // Count instances of TYPE in store
407 int DataStore::typeCount(const CLID& id) const
408 {
409  ConstStoreIterator storeIter = m_storeMap.find(id);
410  if (storeIter == m_storeMap.end()) return 0;
411  return (storeIter->second).size();
412 }
413 
414 //---------------------------------------------------------------//
415 // Return proxy for a given Transient Address
417 {
418  return proxy(tAddr->clID(), tAddr->name());
419 }
420 
421 // Return proxy for a given Transient ID (TYPE and KEY)
422 DataProxy* DataStore::proxy(const CLID& id, const std::string& key) const
423 {
424 
425  // The logic here: if a key is specified, we locate it.
426  // If we don't find it and the default key (DEFAULTKEY) is specified,
427  // then we return any existing proxy for this type as long as there
428  // is exactly one, not counting aliases. More than one would be ambiguous
429 
430  ConstStoreIterator siter = m_storeMap.find(id);
431  DataProxy *p(0);
432  if (siter != m_storeMap.end())
433  {
434  const ProxyMap& pmap = siter->second;
435  ConstProxyIterator p_iter = pmap.find(key);
436  if (p_iter != pmap.end()) {
437  p=p_iter->second;
438 
439  } else if (key == SG::DEFAULTKEY && !pmap.empty()) {
440  // we did not find the object using key.
441  // Now check for default object.
442  // If there are multiple entries, they must all be
443  // referring to the same proxy (aliases).
444  for (const auto& ent : pmap) {
445  if (!p) {
446  p = ent.second;
447  }
448  else if (p != ent.second) {
449  p = nullptr;
450  break;
451  }
452  }
453 
454  // If that didn't work, try it again, considering only objects that
455  // are exactly the type being requested.
456  if (!p) {
457  for (const auto& ent : pmap) {
458  if (ent.second->clID() == id) {
459  if (!p) {
460  p = ent.second;
461  }
462  else if (p != ent.second) {
463  p = nullptr;
464  break;
465  }
466  }
467  }
468  }
469  }
470  else {
471  // Ok since access to DataStore is serialized by StoreGate.
472  DataStore* nc_store ATLAS_THREAD_SAFE = const_cast<DataStore*> (this);
473  p = nc_store->findDummy (id, key);
474  }
475  }
476  else {
477  // Ok since access to DataStore is serialized by StoreGate.
478  DataStore* nc_store ATLAS_THREAD_SAFE = const_cast<DataStore*> (this);
479  p = nc_store->findDummy (id, key);
480  }
481 
482  if (p && m_pSGAudSvc)
483  m_pSGAudSvc->SGAudit(p->name(), id, 0, m_storeID);
484 
485  return p;
486 }
487 
488 
507 DataProxy* DataStore::findDummy (CLID id, const std::string& key)
508 {
511  if (p) {
512  p->setID (id, key);
513  ProxyMap& pmap = m_storeMap[id];
514  if (!pmap.insert(ProxyMap::value_type(key, p)).second) {
515  // This shouldn't happen.
516  DataProxy* p2 = pmap[key];
517  throw SG::ExcProxyCollision (id, key, p2->clID(), p2->name());
518  }
519  }
520  return p;
521 }
522 
523 
527 {
528  if (m_pSGAudSvc) {
529  CLID clid;
530  const std::string* strkey = m_pool.keyToString (sgkey, clid);
531  if (strkey)
532  m_pSGAudSvc->SGAudit(*strkey, clid, 0, m_storeID);
533  }
534  KeyMap_t::const_iterator i = m_keyMap.find (sgkey);
535  if (i != m_keyMap.end())
536  return i->second;
537  return 0;
538 }
539 
540 
546  std::recursive_mutex& mutex) const
547 {
548  if (m_pSGAudSvc) {
549  std::unique_lock lock (mutex);
550  CLID clid;
551  const std::string* strkey = m_pool.keyToString (sgkey, clid);
552  if (strkey)
553  m_pSGAudSvc->SGAudit(*strkey, clid, 0, m_storeID);
554  }
555  KeyMap_t::const_iterator i = m_keyMap.find (sgkey);
556  if (i != m_keyMap.end())
557  return i->second;
558  return 0;
559 }
560 
561 
565  const std::string& key) const
566 {
567  // Suppress warning here about calling to a nonconst method
568  // of m_pool. Ok since all callers here must own the store lock.
570  return proxy_exact (pool_nc.stringToKey (key, id));
571 }
572 
573 
574 //---------------------------------------------------------------//
575 // Return an iterator over proxies for a given CLID:
577  ConstProxyIterator& pe) const
578 {
579  static const ProxyMap emptyMap;
580  StatusCode sc(StatusCode::FAILURE);
581 
582  ConstStoreIterator storeIter = m_storeMap.find(id);
583  if (storeIter != m_storeMap.end())
584  {
585  const ProxyMap& pmap = storeIter->second;
586  pf = pmap.begin();
587  pe = pmap.end();
588  if (pmap.size() > 0) sc = StatusCode::SUCCESS;
589  } else {
590  //keep valgrind happy
591  pf = emptyMap.end();
592  pe = emptyMap.end();
593  }
594  return sc;
595 }
596 //---------------------------------------------------------------//
597 // Return an iterator over the Store Map
599  ConstStoreIterator& te) const
600 {
601  tf = m_storeMap.begin();
602  te = m_storeMap.end();
603  return StatusCode::SUCCESS;
604 }
605 //---------------------------------------------------------------//
606 // locate Persistent Representation of a Transient Object
607 //
608 DataProxy* DataStore::locatePersistent(const void* const pTransient) const
609 {
610  return m_t2p.locatePersistent(pTransient);
611 }
612 
615 DataStore::t2pRegister(const void* const pTrans, DataProxy* const pPers)
616 {
617  std::string name=pPers->name();
618  int i=name.find('/', 0);
619  name=name.erase(0,i+1);
620 
621  if (doAudit()) m_pSGAudSvc->SGAudit(name, pPers->clID(), 1, m_storeID);
622 
623  return (m_t2p.t2pRegister(pTrans, pPers)) ?
624  StatusCode::SUCCESS :
625  StatusCode::FAILURE;
626 }
627 
628 
629 const std::vector<DataProxy*>& DataStore::proxies() const
630 {
631  return m_proxies;
632 }
633 
SG::ProxyIterator
ProxyMap::iterator ProxyIterator
Definition: ProxyMap.h:27
python.StoreID.UNKNOWN
int UNKNOWN
Definition: StoreID.py:16
SG::DataStore::typeCount
int typeCount(const CLID &id) const
Count number of object of a given type in store.
Definition: Control/SGTools/src/DataStore.cxx:407
common.sgkey
def sgkey(tool)
Definition: common.py:1027
exceptions.h
Exceptions that can be thrown by SGTools.
TileDCSDataPlotter.dp
dp
Definition: TileDCSDataPlotter.py:842
SG::DataStore::t2pRegister
StatusCode t2pRegister(const void *const pTrans, DataProxy *const pPers)
methods to query the T2PMap:
Definition: Control/SGTools/src/DataStore.cxx:615
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:407
SG::DataStore::~DataStore
virtual ~DataStore()
Definition: Control/SGTools/src/DataStore.cxx:42
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
calibdata.force
bool force
Definition: calibdata.py:18
SG::T2pMap::locatePersistent
DataProxy * locatePersistent(const void *const pTransient) const
Definition: T2pMap.h:42
SG::DataStore::proxy
virtual DataProxy * proxy(const TransientAddress *tAddr) const override
return proxy for a given type/key pair if key is empty returns the default proxy (currently last regi...
Definition: Control/SGTools/src/DataStore.cxx:416
IStringPool::stringToKey
virtual sgkey_t stringToKey(const std::string &str, CLID clid)=0
Find the key for a string/CLID pair.
index
Definition: index.py:1
SG::DataStore::m_t2p
T2pMap m_t2p
Definition: Control/SGTools/SGTools/DataStore.h:201
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
DataStore.h
SG::DataStore::addAlias
virtual StatusCode addAlias(const std::string &aliasKey, DataProxy *proxy) override
add alias to store
Definition: Control/SGTools/src/DataStore.cxx:379
pool
pool namespace
Definition: libname.h:15
SG::DataStore::m_keyMap
KeyMap_t m_keyMap
Definition: Control/SGTools/SGTools/DataStore.h:194
skel.it
it
Definition: skel.GENtoEVGEN.py:407
SG::DataStore::m_storeMap
StoreMap m_storeMap
Maps locating proxies by clid/key.
Definition: Control/SGTools/SGTools/DataStore.h:183
SG::TransientAddress
Definition: TransientAddress.h:32
SG::DataStore::ConstStoreIterator
StoreMap::const_iterator ConstStoreIterator
Definition: Control/SGTools/SGTools/DataStore.h:81
SG::DataStore::clearStore
void clearStore(bool force, bool hard, MsgStream *pmlog)
If HARD is true, then the bound objects should also clear any data that depends on the identity of th...
Definition: Control/SGTools/src/DataStore.cxx:68
ATH_UNLIKELY
#define ATH_UNLIKELY(x)
Definition: AthUnlikelyMacros.h:17
python.RatesEmulationExample.lock
lock
Definition: RatesEmulationExample.py:148
LArG4AODNtuplePlotter.pe
pe
Definition: LArG4AODNtuplePlotter.py:116
IProxyDict
A proxy dictionary.
Definition: AthenaKernel/AthenaKernel/IProxyDict.h:47
SG::DataProxy::CLIDCont_t
TransientAddress::TransientClidSet CLIDCont_t
Definition: DataProxy.h:54
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SG::DataStore::removeFromKeyMap
StatusCode removeFromKeyMap(DataProxy *proxy)
Remove a proxy from m_keyMap.
Definition: Control/SGTools/src/DataStore.cxx:237
SG::DataProxy::setStore
void setStore(IProxyDict *store)
Set the store of which we're a part.
SG::DataStore::doAudit
bool doAudit()
Definition: Control/SGTools/SGTools/DataStore.h:206
SG::ProxyMap
std::map< std::string, DataProxy * > ProxyMap
Definition: ProxyMap.h:24
SG::DataProxy::AliasCont_t
std::vector< std::string > AliasCont_t
Definition: DataProxy.h:55
SG::DataStore::StoreIterator
StoreMap::iterator StoreIterator
Definition: Control/SGTools/SGTools/DataStore.h:80
SG::TransientAddress::name
const std::string & name() const
Get the primary (hashed) SG key.
Definition: TransientAddress.h:217
AthUnlikelyMacros.h
SG::DataStore::setSGAudSvc
void setSGAudSvc()
Definition: Control/SGTools/src/DataStore.cxx:54
TRTCalib_cfilter.p2
p2
Definition: TRTCalib_cfilter.py:131
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
StateLessPT_NewConfig.primary
primary
Definition: StateLessPT_NewConfig.py:234
WriteCellNoiseToCool.exist
exist
Definition: WriteCellNoiseToCool.py:543
IStringPool.h
Abstract interface for looking up strings/CLIDs in a pool.
lumiFormat.i
int i
Definition: lumiFormat.py:85
SG::DataStore::m_proxies
std::vector< DataProxy * > m_proxies
All proxies managed by this store.
Definition: Control/SGTools/SGTools/DataStore.h:180
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SG::DataStore::findDummy
DataProxy * findDummy(CLID id, const std::string &key)
Look for (and convert) a matching dummy proxy.
Definition: Control/SGTools/src/DataStore.cxx:507
SG::DataProxy::alias
AliasCont_t alias() const
access set of proxy aliases Returns a COPY of the alias set.
SG::TransientAddress::clID
CLID clID() const
Retrieve string key:
Definition: TransientAddress.h:210
SG::DataStore::m_pool
IProxyDict & m_pool
The string pool associated with this store.
Definition: Control/SGTools/SGTools/DataStore.h:176
COOLRates.alias
alias
Definition: COOLRates.py:1172
SG::DataStore::m_pSGAudSvc
SmartIF< ISGAudSvc > m_pSGAudSvc
Definition: Control/SGTools/SGTools/DataStore.h:204
SG::T2pMap::t2pRegister
bool t2pRegister(const void *const pTrans, DataProxy *const pPers)
Definition: T2pMap.h:34
SG::DataStore::m_pSvcLoc
ISvcLocator * m_pSvcLoc
Definition: Control/SGTools/SGTools/DataStore.h:211
SG::DataStore::addSymLink
StatusCode addSymLink(const CLID &linkid, DataProxy *proxy)
add symlink to store:
Definition: Control/SGTools/src/DataStore.cxx:332
SG::DataStore::sgkey_t
IStringPool::sgkey_t sgkey_t
Definition: Control/SGTools/SGTools/DataStore.h:78
StoreID
defines an enum used by address providers to decide what kind of StoreGateSvc they are providing addr...
Definition: StoreID.h:18
SG::T2pMap::clear
void clear()
Definition: T2pMap.h:53
SG::DEFAULTKEY
const std::string DEFAULTKEY
Definition: DefaultKey.h:12
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
SG::DataProxy::clID
CLID clID() const
Retrieve clid.
SG::DataProxy::release
virtual unsigned long release() override final
release reference to object
Definition: DataProxy.cxx:321
SG::DataStore::removeProxyImpl
StatusCode removeProxyImpl(DataProxy *proxy, int index)
Helper for removing a proxy.
Definition: Control/SGTools/src/DataStore.cxx:265
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:239
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
SG::BaseInfoBase::find
static const BaseInfoBase * find(CLID clid)
Find the BaseInfoBase instance for clid.
Definition: BaseInfo.cxx:570
SG::DataStore::keys
void keys(const CLID &id, std::vector< std::string > &vkeys, bool includeAlias, bool onlyValid)
Definition: Control/SGTools/src/DataStore.cxx:121
SG::DataStore::setSvcLoc
StatusCode setSvcLoc()
Definition: Control/SGTools/src/DataStore.cxx:47
SG::DataProxy::name
virtual const name_type & name() const override final
Retrieve data object key == string.
SG::DataStore::locatePersistent
DataProxy * locatePersistent(const void *const pTransient) const
locate the persistent (proxy) for a given T* (void*):
Definition: Control/SGTools/src/DataStore.cxx:608
SG::DataStore::m_storeID
StoreID::type m_storeID
Definition: Control/SGTools/SGTools/DataStore.h:196
SG::DataStore::addToStore
virtual StatusCode addToStore(const CLID &id, DataProxy *proxy) override
add proxy to store.
Definition: Control/SGTools/src/DataStore.cxx:142
DeMoScan.index
string index
Definition: DeMoScan.py:362
SG::DataStore::proxy_exact
virtual SG::DataProxy * proxy_exact(sgkey_t sgkey) const override
get proxy with given key.
Definition: Control/SGTools/src/DataStore.cxx:526
SG::DataProxy::reset
void reset(bool hard=false)
Other methods of DataProxy (not in Interface IRegistry):
Definition: DataProxy.cxx:241
SimpleUpdater.h
Simple (non-deleting) Updater implementation.
SG::DataProxy::transientID
bool transientID(CLID id) const
return the list of transient IDs (primary or symLinked):
python.output.AtlRunQueryRoot.pf
pf
Definition: AtlRunQueryRoot.py:988
SG::DataStore
Hold DataProxy instances associated with a store.
Definition: Control/SGTools/SGTools/DataStore.h:74
SG::DataStore::proxies
const std::vector< DataProxy * > & proxies() const
All proxies managed by this store.
Definition: Control/SGTools/src/DataStore.cxx:629
ISGAudSvc.h
IStringPool::keyToString
virtual const std::string * keyToString(sgkey_t key) const =0
Find the string corresponding to a given key.
SG::BaseInfoBase
The non-template portion of the BaseInfo implementation.
Definition: Control/AthenaKernel/AthenaKernel/BaseInfo.h:451
SG::DataStore::KeyMap_t
CxxUtils::ConcurrentMap< sgkey_t, DataProxy *, CxxUtils::SimpleUpdater, SGKeyHash, SGKeyEqual, 0, s_nullval > KeyMap_t
Definition: Control/SGTools/SGTools/DataStore.h:193
SG::DataStore::pRange
StatusCode pRange(const CLID &id, SG::ConstProxyIterator &f, SG::ConstProxyIterator &e) const
Return an iterator over proxy for a given CLID:
Definition: Control/SGTools/src/DataStore.cxx:576
SG::DataStore::removeProxy
StatusCode removeProxy(DataProxy *proxy, bool forceRemove, bool hard)
remove proxy from store, unless proxy is reset only.
Definition: Control/SGTools/src/DataStore.cxx:199
SG::DataProxy::isResetOnly
bool isResetOnly() const
Check reset only:
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211
checker_macros.h
Define macros for attributes used to control the static checker.
SG::DataProxy
Definition: DataProxy.h:45
SG::DataStore::tRange
StatusCode tRange(ConstStoreIterator &f, ConstStoreIterator &e) const
Return an iterator over the StoreMap:
Definition: Control/SGTools/src/DataStore.cxx:598
SG::DataStore::proxy_exact_unlocked
SG::DataProxy * proxy_exact_unlocked(sgkey_t sgkey, std::recursive_mutex &mutex) const
Like proxy_exact, but intended to be called without holding the store lock.
Definition: Control/SGTools/src/DataStore.cxx:545
SG::DataStore::m_noAudSvc
bool m_noAudSvc
Definition: Control/SGTools/SGTools/DataStore.h:205
SG::ExcProxyCollision
Exception — Proxy collision for clid/key.
Definition: Control/SGTools/SGTools/exceptions.h:83
SG::ConstProxyIterator
ProxyMap::const_iterator ConstProxyIterator
Definition: ProxyMap.h:28
ConcurrentPtrSet.h
A set of pointers, alowing concurrent, lockless reads.
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
DataProxy.h
SG::BaseInfoBase::is_base
bool is_base(CLID clid) const
Return true if clid is the ID of a class that is known to be a base of T.
Definition: BaseInfo.cxx:344