CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 41 of file refcore_implementation.h.

References kCacheIsProductPtrBit.

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

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

Definition at line 76 of file refcore_implementation.h.

References cacheIsProductPtr(), compareJSON::const, kCacheIsProductPtrMask, and tmp.

Referenced by edm::RefToBase< T >::castTo(), and edm::getProduct().

76  {
77  auto tmp = iCache.load();
78  return (!refcoreimpl::cacheIsProductPtr(tmp))? reinterpret_cast<EDProductGetter const*>(reinterpret_cast<std::uintptr_t>(tmp)&refcoreimpl::kCacheIsProductPtrMask):static_cast<EDProductGetter const*>(nullptr);
79  }
const std::uintptr_t kCacheIsProductPtrMask
bool cacheIsProductPtr(void const *iPtr)
string const
Definition: compareJSON.py:14
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 71 of file refcore_implementation.h.

References cacheIsProductPtr(), compareJSON::const, and tmp.

71  {
72  auto tmp = iCache.load();
73  return refcoreimpl::cacheIsProductPtr(tmp)?tmp:static_cast<void const*>(nullptr);
74  }
bool cacheIsProductPtr(void const *iPtr)
string const
Definition: compareJSON.py:14
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 59 of file refcore_implementation.h.

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

Definition at line 45 of file refcore_implementation.h.

References kCacheIsProductPtrBit, and tmp.

45  {
46  std::uintptr_t tmp = reinterpret_cast<std::uintptr_t>(iGetter);
48  ptr.store(reinterpret_cast<void const*>(tmp));
49  }
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 52 of file refcore_implementation.h.

References compareJSON::const, kCacheIsProductPtrBit, and tmp.

52  {
53  std::uintptr_t tmp = reinterpret_cast<std::uintptr_t>(iGetter);
55  ptr = reinterpret_cast<void const*>(tmp);
56  }
string const
Definition: compareJSON.py:14
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 63 of file refcore_implementation.h.

References cacheIsProductPtr().

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

63  {
64  auto cache = iCache.load();
65  if(not cacheIsProductPtr(cache)) {
66  return iCache.compare_exchange_strong(cache, iNewValue);
67  }
68  return false;
69  }
bool cacheIsProductPtr(void const *iPtr)

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 39 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().