1 #ifndef DataFormats_Common_refcore_implementation_h 2 #define DataFormats_Common_refcore_implementation_h 34 namespace refcoreimpl {
45 std::uintptr_t
tmp =
reinterpret_cast<std::uintptr_t
>(iGetter);
47 ptr.store(reinterpret_cast<void const*>(tmp));
52 std::uintptr_t
tmp =
reinterpret_cast<std::uintptr_t
>(iGetter);
54 ptr =
reinterpret_cast<void const*
>(
tmp);
58 inline void setCacheIsItem(std::atomic<void const*>& iCache,
void const* iNewValue) {
63 auto cache = iCache.load();
65 return iCache.compare_exchange_strong(
cache, iNewValue);
70 inline void const*
productPtr(std::atomic<void const*>
const& iCache) {
71 auto tmp = iCache.load();
76 auto tmp = iCache.load();
83 #define ID_IMPL return ProductID(processIndex_ & refcoreimpl::kProcessIndexMask,productIndex_) 85 #define PRODUCTPTR_IMPL return refcoreimpl::productPtr(cachePtr_) 87 #define ISNONNULL_IMPL return isTransient() ? productPtr() != nullptr : id().isValid() 89 #define PRODUCTGETTER_IMPL return refcoreimpl::productGetter(cachePtr_) 91 #define ISTRANSIENT_IMPL return 0!=(processIndex_ & refcoreimpl::kTransientBit) 93 #define SETTRANSIENT_IMPL processIndex_ |=refcoreimpl::kTransientBit 95 #define SETCACHEISPRODUCTPTR_IMPL(_item_) refcoreimpl::setCacheIsItem(cachePtr_,_item_) 97 #define SETCACHEISPRODUCTGETTER_IMPL(_getter_) refcoreimpl::setCacheIsProductGetter(cachePtr_, _getter_) void const * productPtr(std::atomic< void const * > const &iCache)
void setCacheIsItem(std::atomic< void const * > &iCache, void const *iNewValue)
EDProductGetter const * productGetter(std::atomic< void const * > const &iCache)
bool tryToSetCacheItemForFirstTime(std::atomic< void const * > &iCache, void const *iNewValue)
void setCacheIsProductGetter(std::atomic< void const * > &ptr, EDProductGetter const *iGetter)
const std::uintptr_t kCacheIsProductPtrMask
const unsigned short kProcessIndexMask
bool cacheIsProductPtr(void const *iPtr)
std::vector< std::vector< double > > tmp
const std::uintptr_t kCacheIsProductPtrBit
const unsigned short kTransientBit