CMS 3D CMS Logo

List of all members | Static Public Member Functions
edm::refitem::GetRefPtrImpl< C, T, F, KEY > Struct Template Reference

#include <RefItemGet.h>

Static Public Member Functions

static T const * getRefPtr_ (RefCore const &product, KEY const &key)
 

Detailed Description

template<typename C, typename T, typename F, typename KEY>
struct edm::refitem::GetRefPtrImpl< C, T, F, KEY >

Definition at line 25 of file RefItemGet.h.

Member Function Documentation

◆ getRefPtr_()

template<typename C , typename T , typename F , typename KEY >
static T const* edm::refitem::GetRefPtrImpl< C, T, F, KEY >::getRefPtr_ ( RefCore const &  product,
KEY const &  key 
)
inlinestatic

Definition at line 26 of file RefItemGet.h.

26  {
27  T const* item = static_cast<T const*>(product.productPtr());
28  if (item != nullptr) {
29  return item;
30  }
31  auto prodGetter = product.productGetter();
32  if (nullptr == prodGetter) {
33  item = static_cast<T const*>(product.productPtr());
34  if (item != nullptr) {
35  //Another thread updated the value since we checked
36  return item;
37  }
38  }
39  C const* prod = edm::template getProductWithCoreFromRef<C>(product, prodGetter);
40  /*
41  typename C::const_iterator it = prod->begin();
42  std::advance(it, item.key());
43  T const* p = it.operator->();
44  */
45  F func;
46  item = func(*prod, key);
47  product.setProductPtr(item);
48  return item;
49  }

References gen::C, F(), TrackCollections2monitor_cff::func, B2GTnPMonitor_cfi::item, crabWrapper::key, dumpMFGeometry_cfg::prod, edm::RefCore::productGetter(), edm::RefCore::productPtr(), edm::RefCore::setProductPtr(), and svgfig::template().

Referenced by edm::getRefPtr().

F
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:163
dumpMFGeometry_cfg.prod
prod
Definition: dumpMFGeometry_cfg.py:24
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
svgfig.template
def template(fileName, svg, replaceme="REPLACEME")
Definition: svgfig.py:521
TrackCollections2monitor_cff.func
func
Definition: TrackCollections2monitor_cff.py:359
gen::C
C
Definition: PomwigHadronizer.cc:76
T
long double T
Definition: Basic3DVectorLD.h:48
crabWrapper.key
key
Definition: crabWrapper.py:19