CMS 3D CMS Logo

Functions | Variables
edm::refcoreimpl Namespace Reference

Functions

bool cacheIsProductPtr (void const *iPtr)
 
EDProductGetter const * productGetter (std::atomic< void const * > const &iCache)
 
void const * productPtr (std::atomic< void const * > const &iCache)
 
void setCacheIsItem (std::atomic< void const * > &iCache, void const *iNewValue)
 
void setCacheIsProductGetter (std::atomic< void const * > &ptr, EDProductGetter const *iGetter)
 
void setCacheIsProductGetter (void const *&ptr, EDProductGetter const *iGetter)
 
bool tryToSetCacheItemForFirstTime (std::atomic< void const * > &iCache, void const *iNewValue)
 

Variables

const std::uintptr_t kCacheIsProductPtrBit = 0x1
 
const std::uintptr_t kCacheIsProductPtrMask = std::numeric_limits<std::uintptr_t>::max() ^ kCacheIsProductPtrBit
 
const unsigned short kProcessIndexMask = 0x3FFF
 
const unsigned short kTransientBit = 0x8000
 

Function Documentation

bool edm::refcoreimpl::cacheIsProductPtr ( void const *  iPtr)
inline

Definition at line 40 of file refcore_implementation.h.

References kCacheIsProductPtrBit.

Referenced by productGetter(), productPtr(), and tryToSetCacheItemForFirstTime().

40  {
41  return 0 == (reinterpret_cast<std::uintptr_t>(iPtr) & refcoreimpl::kCacheIsProductPtrBit);
42  }
const std::uintptr_t kCacheIsProductPtrBit
EDProductGetter const* edm::refcoreimpl::productGetter ( std::atomic< void const * > const &  iCache)
inline

Definition at line 75 of file refcore_implementation.h.

References cacheIsProductPtr(), kCacheIsProductPtrMask, and tmp.

Referenced by edm::Event::fillView_(), edm::getProduct(), and edm::RefToBaseVector< reco::Track >::isInvalid().

75  {
76  auto tmp = iCache.load();
77  return (!refcoreimpl::cacheIsProductPtr(tmp))? reinterpret_cast<EDProductGetter const*>(reinterpret_cast<std::uintptr_t>(tmp)&refcoreimpl::kCacheIsProductPtrMask):static_cast<EDProductGetter const*>(nullptr);
78  }
const std::uintptr_t kCacheIsProductPtrMask
bool cacheIsProductPtr(void const *iPtr)
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
void const* edm::refcoreimpl::productPtr ( std::atomic< void const * > const &  iCache)
inline

Definition at line 70 of file refcore_implementation.h.

References cacheIsProductPtr(), and tmp.

70  {
71  auto tmp = iCache.load();
72  return refcoreimpl::cacheIsProductPtr(tmp)?tmp:static_cast<void const*>(nullptr);
73  }
bool cacheIsProductPtr(void const *iPtr)
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
void edm::refcoreimpl::setCacheIsItem ( std::atomic< void const * > &  iCache,
void const *  iNewValue 
)
inline

Definition at line 58 of file refcore_implementation.h.

58  {
59  iCache = iNewValue;
60  }
void edm::refcoreimpl::setCacheIsProductGetter ( std::atomic< void const * > &  ptr,
EDProductGetter const *  iGetter 
)
inline

Definition at line 44 of file refcore_implementation.h.

References kCacheIsProductPtrBit, and tmp.

44  {
45  std::uintptr_t tmp = reinterpret_cast<std::uintptr_t>(iGetter);
47  ptr.store(reinterpret_cast<void const*>(tmp));
48  }
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
const std::uintptr_t kCacheIsProductPtrBit
void edm::refcoreimpl::setCacheIsProductGetter ( void const *&  ptr,
EDProductGetter const *  iGetter 
)
inline

Definition at line 51 of file refcore_implementation.h.

References kCacheIsProductPtrBit, and tmp.

51  {
52  std::uintptr_t tmp = reinterpret_cast<std::uintptr_t>(iGetter);
54  ptr = reinterpret_cast<void const*>(tmp);
55  }
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
const std::uintptr_t kCacheIsProductPtrBit
bool edm::refcoreimpl::tryToSetCacheItemForFirstTime ( std::atomic< void const * > &  iCache,
void const *  iNewValue 
)
inline

Definition at line 62 of file refcore_implementation.h.

References utilities::cache(), and cacheIsProductPtr().

Referenced by edm::RefCore::tryToSetProductPtrForFirstTime(), and edm::RefCoreWithIndex::tryToSetProductPtrForFirstTime().

62  {
63  auto cache = iCache.load();
64  if(not cacheIsProductPtr(cache)) {
65  return iCache.compare_exchange_strong(cache, iNewValue);
66  }
67  return false;
68  }
bool cacheIsProductPtr(void const *iPtr)
def cache(function)
Definition: utilities.py:3

Variable Documentation

const std::uintptr_t edm::refcoreimpl::kCacheIsProductPtrBit = 0x1
const std::uintptr_t edm::refcoreimpl::kCacheIsProductPtrMask = std::numeric_limits<std::uintptr_t>::max() ^ kCacheIsProductPtrBit

Definition at line 38 of file refcore_implementation.h.

Referenced by edm::RefCore::cachePtrIsInvalid(), and productGetter().

const unsigned short edm::refcoreimpl::kProcessIndexMask = 0x3FFF

Definition at line 36 of file refcore_implementation.h.

const unsigned short edm::refcoreimpl::kTransientBit = 0x8000

Definition at line 35 of file refcore_implementation.h.

Referenced by edm::RefCore::setId().