CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
edm::FwdRef< C, T, F > Class Template Reference

#include <FwdRef.h>

Public Types

typedef boost::binary_traits< F >::second_argument_type argument_type
 
typedef const T element_type
 
typedef F finder_type
 
typedef std::remove_cv< typename std::remove_reference< argument_type >::type >::type key_type
 
typedef C product_type
 for export More...
 
typedef T value_type
 

Public Member Functions

Ref< C, T, F > const & backRef () const
 
 FwdRef ()
 Default constructor needed for reading from persistent store. Not for direct use. More...
 
 FwdRef (Ref< C, T, F > const &ref, Ref< C, T, F > const &backRef)
 General purpose constructor from 2 refs (forward and backward. More...
 
T const * get () const
 Returns C++ pointer to the item. More...
 
bool hasProductCache () const
 
ProductID id () const
 Accessor for product ID. More...
 
bool isAvailable () const
 
bool isNonnull () const
 Checks for non-null. More...
 
bool isNull () const
 Checks for null. More...
 
bool isTransient () const
 Checks if this ref is transient (i.e. not persistable). More...
 
key_type key () const
 Accessor for product key. More...
 
bool operator! () const
 Checks for null. More...
 
T const & operator* () const
 Dereference operator. More...
 
T const * operator-> () const
 Member dereference operator. More...
 
EDProductGetter const * productGetter () const
 Accessor for product getter. More...
 
Ref< C, T, F > const & ref () const
 
 ~FwdRef ()
 Destructor. More...
 

Static Public Member Functions

static short Class_Version ()
 

Private Attributes

Ref< C, T, FbackRef_
 
Ref< C, T, Fref_
 

Detailed Description

template<typename C, typename T = typename refhelper::ValueTrait<C>::value, typename F = typename refhelper::FindTrait<C, T>::value>
class edm::FwdRef< C, T, F >

Definition at line 123 of file FwdRef.h.

Member Typedef Documentation

◆ argument_type

template<typename C, typename T = typename refhelper::ValueTrait<C>::value, typename F = typename refhelper::FindTrait<C, T>::value>
typedef boost::binary_traits<F>::second_argument_type edm::FwdRef< C, T, F >::argument_type

Definition at line 130 of file FwdRef.h.

◆ element_type

template<typename C, typename T = typename refhelper::ValueTrait<C>::value, typename F = typename refhelper::FindTrait<C, T>::value>
typedef const T edm::FwdRef< C, T, F >::element_type

Definition at line 128 of file FwdRef.h.

◆ finder_type

template<typename C, typename T = typename refhelper::ValueTrait<C>::value, typename F = typename refhelper::FindTrait<C, T>::value>
typedef F edm::FwdRef< C, T, F >::finder_type

Definition at line 129 of file FwdRef.h.

◆ key_type

template<typename C, typename T = typename refhelper::ValueTrait<C>::value, typename F = typename refhelper::FindTrait<C, T>::value>
typedef std::remove_cv<typename std::remove_reference<argument_type>::type>::type edm::FwdRef< C, T, F >::key_type

Definition at line 131 of file FwdRef.h.

◆ product_type

template<typename C, typename T = typename refhelper::ValueTrait<C>::value, typename F = typename refhelper::FindTrait<C, T>::value>
typedef C edm::FwdRef< C, T, F >::product_type

for export

Definition at line 126 of file FwdRef.h.

◆ value_type

template<typename C, typename T = typename refhelper::ValueTrait<C>::value, typename F = typename refhelper::FindTrait<C, T>::value>
typedef T edm::FwdRef< C, T, F >::value_type

Definition at line 127 of file FwdRef.h.

Constructor & Destructor Documentation

◆ FwdRef() [1/2]

template<typename C, typename T = typename refhelper::ValueTrait<C>::value, typename F = typename refhelper::FindTrait<C, T>::value>
edm::FwdRef< C, T, F >::FwdRef ( )
inline

Default constructor needed for reading from persistent store. Not for direct use.

C is the type of the collection T is the type of a member the collection

Definition at line 136 of file FwdRef.h.

136 : ref_(), backRef_() {}

◆ FwdRef() [2/2]

template<typename C, typename T = typename refhelper::ValueTrait<C>::value, typename F = typename refhelper::FindTrait<C, T>::value>
edm::FwdRef< C, T, F >::FwdRef ( Ref< C, T, F > const &  ref,
Ref< C, T, F > const &  backRef 
)
inline

General purpose constructor from 2 refs (forward and backward.

Definition at line 139 of file FwdRef.h.

139  : ref_(ref), backRef_(backRef) {
140  assert(ref.isNull() == backRef.isNull());
141  }

◆ ~FwdRef()

template<typename C, typename T = typename refhelper::ValueTrait<C>::value, typename F = typename refhelper::FindTrait<C, T>::value>
edm::FwdRef< C, T, F >::~FwdRef ( )
inline

Destructor.

Definition at line 144 of file FwdRef.h.

144 {}

Member Function Documentation

◆ backRef()

template<typename C, typename T = typename refhelper::ValueTrait<C>::value, typename F = typename refhelper::FindTrait<C, T>::value>
Ref<C, T, F> const& edm::FwdRef< C, T, F >::backRef ( ) const
inline

◆ Class_Version()

template<typename C, typename T = typename refhelper::ValueTrait<C>::value, typename F = typename refhelper::FindTrait<C, T>::value>
static short edm::FwdRef< C, T, F >::Class_Version ( )
inlinestatic

Definition at line 200 of file FwdRef.h.

202 :
203  Ref<C, T, F> ref_;

◆ get()

template<typename C, typename T = typename refhelper::ValueTrait<C>::value, typename F = typename refhelper::FindTrait<C, T>::value>
T const* edm::FwdRef< C, T, F >::get ( ) const
inline

◆ hasProductCache()

template<typename C, typename T = typename refhelper::ValueTrait<C>::value, typename F = typename refhelper::FindTrait<C, T>::value>
bool edm::FwdRef< C, T, F >::hasProductCache ( ) const
inline

Definition at line 190 of file FwdRef.h.

190 { return ref_.hasProductCache() || backRef_.hasProductCache(); }

◆ id()

template<typename C, typename T = typename refhelper::ValueTrait<C>::value, typename F = typename refhelper::FindTrait<C, T>::value>
ProductID edm::FwdRef< C, T, F >::id ( ) const
inline

Accessor for product ID.

Definition at line 185 of file FwdRef.h.

185 { return ref_.isNonnull() ? ref_.id() : backRef_.id(); }

◆ isAvailable()

template<typename C, typename T = typename refhelper::ValueTrait<C>::value, typename F = typename refhelper::FindTrait<C, T>::value>
bool edm::FwdRef< C, T, F >::isAvailable ( ) const
inline

Checks if collection is in memory or available in the Event. No type checking is done.

Definition at line 194 of file FwdRef.h.

194 { return ref_.isAvailable() || backRef_.isAvailable(); }

◆ isNonnull()

template<typename C, typename T = typename refhelper::ValueTrait<C>::value, typename F = typename refhelper::FindTrait<C, T>::value>
bool edm::FwdRef< C, T, F >::isNonnull ( ) const
inline

Checks for non-null.

Definition at line 166 of file FwdRef.h.

166 { return ref_.isNonnull() || backRef_.isNonnull(); }

Referenced by edm::FwdRef< reco::GenJetCollection >::isNull().

◆ isNull()

template<typename C, typename T = typename refhelper::ValueTrait<C>::value, typename F = typename refhelper::FindTrait<C, T>::value>
bool edm::FwdRef< C, T, F >::isNull ( ) const
inline

Checks for null.

Definition at line 162 of file FwdRef.h.

162 { return !isNonnull(); }

Referenced by edm::FwdRef< reco::GenJetCollection >::operator!().

◆ isTransient()

template<typename C, typename T = typename refhelper::ValueTrait<C>::value, typename F = typename refhelper::FindTrait<C, T>::value>
bool edm::FwdRef< C, T, F >::isTransient ( ) const
inline

Checks if this ref is transient (i.e. not persistable).

Definition at line 197 of file FwdRef.h.

197 { return ref_.isTransient(); }

◆ key()

template<typename C, typename T = typename refhelper::ValueTrait<C>::value, typename F = typename refhelper::FindTrait<C, T>::value>
key_type edm::FwdRef< C, T, F >::key ( ) const
inline

Accessor for product key.

Definition at line 188 of file FwdRef.h.

188 { return ref_.isNonnull() ? ref_.key() : backRef_.key(); }

◆ operator!()

template<typename C, typename T = typename refhelper::ValueTrait<C>::value, typename F = typename refhelper::FindTrait<C, T>::value>
bool edm::FwdRef< C, T, F >::operator! ( ) const
inline

Checks for null.

Definition at line 169 of file FwdRef.h.

169 { return isNull(); }

◆ operator*()

template<typename C , typename T , typename F >
T const & edm::FwdRef< C, T, F >::operator* ( ) const
inline

Dereference operator.

Definition at line 214 of file FwdRef.h.

214  {
215  return ref_.isNonnull() && ref_.isAvailable() ? ref_.operator*() : backRef_.operator*();
216  }

◆ operator->()

template<typename C , typename T , typename F >
T const * edm::FwdRef< C, T, F >::operator-> ( ) const
inline

Member dereference operator.

Definition at line 220 of file FwdRef.h.

220  {
221  return ref_.isNonnull() && ref_.isAvailable() ? ref_.operator->() : backRef_.operator->();
222  }

◆ productGetter()

template<typename C, typename T = typename refhelper::ValueTrait<C>::value, typename F = typename refhelper::FindTrait<C, T>::value>
EDProductGetter const* edm::FwdRef< C, T, F >::productGetter ( ) const
inline

Accessor for product getter.

Definition at line 175 of file FwdRef.h.

175  {
176  //another thread might cause productGetter() to change its value
177  EDProductGetter const* getter = ref_.productGetter();
178  if (getter)
179  return getter;
180  else
181  return backRef_.productGetter();
182  }

◆ ref()

template<typename C, typename T = typename refhelper::ValueTrait<C>::value, typename F = typename refhelper::FindTrait<C, T>::value>
Ref<C, T, F> const& edm::FwdRef< C, T, F >::ref ( ) const
inline

Definition at line 171 of file FwdRef.h.

171 { return ref_; }

Referenced by edm::FwdRef< reco::GenJetCollection >::FwdRef(), edm::operator<(), and edm::operator==().

Member Data Documentation

◆ backRef_

template<typename C, typename T = typename refhelper::ValueTrait<C>::value, typename F = typename refhelper::FindTrait<C, T>::value>
Ref<C, T, F> edm::FwdRef< C, T, F >::backRef_
private

◆ ref_

template<typename C, typename T = typename refhelper::ValueTrait<C>::value, typename F = typename refhelper::FindTrait<C, T>::value>
Ref<C, T, F> edm::FwdRef< C, T, F >::ref_
private
edm::FwdRef::backRef_
Ref< C, T, F > backRef_
Definition: FwdRef.h:204
cms::cuda::assert
assert(be >=bs)
edm::FwdRef::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: FwdRef.h:166
edm::FwdRef::isNull
bool isNull() const
Checks for null.
Definition: FwdRef.h:162
EDProductGetter
edm::FwdRef::backRef
Ref< C, T, F > const & backRef() const
Definition: FwdRef.h:172
edm::FwdRef::ref
Ref< C, T, F > const & ref() const
Definition: FwdRef.h:171
edm::FwdRef::ref_
Ref< C, T, F > ref_
Definition: FwdRef.h:203