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

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.

References patCaloMETCorrections_cff::C, F(), patCandidates_cff::func, parseEventContent::prod, edm::RefCore::productGetter(), edm::RefCore::productPtr(), and svgfig::template().

Referenced by edm::getRefPtr().

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  }
def template(fileName, svg, replaceme="REPLACEME")
Definition: svgfig.py:520
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:281
long double T