CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | 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 T const element_type
 
typedef F finder_type
 
typedef boost::remove_cv
< typename
boost::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...
 
C const * product () const
 Accessor for product collection. More...
 
EDProductGetter const * productGetter () const
 Accessor for product getter. More...
 
Ref< C, T, F > const & ref () const
 
 ~FwdRef ()
 Destructor. More...
 

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

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 132 of file FwdRef.h.

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

Definition at line 130 of file FwdRef.h.

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 131 of file FwdRef.h.

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

Definition at line 133 of file FwdRef.h.

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 128 of file FwdRef.h.

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 129 of file FwdRef.h.

Constructor & Destructor Documentation

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 138 of file FwdRef.h.

138 : ref_(), backRef_() {}
Ref< C, T, F > backRef_
Definition: FwdRef.h:211
Ref< C, T, F > ref_
Definition: FwdRef.h:210
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 141 of file FwdRef.h.

142  :
143  ref_(ref), backRef_(backRef) {}
Ref< C, T, F > backRef_
Definition: FwdRef.h:211
Ref< C, T, F > ref_
Definition: FwdRef.h:210
Ref< C, T, F > const & backRef() const
Definition: FwdRef.h:178
Ref< C, T, F > const & ref() const
Definition: FwdRef.h:177
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 146 of file FwdRef.h.

146 {}

Member Function Documentation

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

Definition at line 178 of file FwdRef.h.

Referenced by edm::operator==(), and pat::Jet::updateFwdGenJetFwdRef().

178 { return backRef_; }
Ref< C, T, F > backRef_
Definition: FwdRef.h:211
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 ( void  ) const
inline

Returns C++ pointer to the item.

Definition at line 157 of file FwdRef.h.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), pat::Jet::genJet(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), and betterConfigParser.BetterConfigParser::getResultingSection().

157  {
158  if ( ref_.isNonnull() ) {
159  return ref_.get();
160  } else if ( backRef_.isNonnull() ) {
161  return backRef_.get();
162  } else {
163  return 0;
164  }
165  }
Ref< C, T, F > backRef_
Definition: FwdRef.h:211
Ref< C, T, F > ref_
Definition: FwdRef.h:210
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 197 of file FwdRef.h.

197 {return ref_.hasProductCache() || backRef_.hasProductCache();}
Ref< C, T, F > backRef_
Definition: FwdRef.h:211
Ref< C, T, F > ref_
Definition: FwdRef.h:210
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 ( void  ) const
inline

Accessor for product ID.

Definition at line 191 of file FwdRef.h.

191 {return ref_.isNonnull() ? ref_.id() : backRef_.id();}
Ref< C, T, F > backRef_
Definition: FwdRef.h:211
Ref< C, T, F > ref_
Definition: FwdRef.h:210
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 201 of file FwdRef.h.

201 {return ref_.isAvailable() || backRef_.isAvailable();}
Ref< C, T, F > backRef_
Definition: FwdRef.h:211
Ref< C, T, F > ref_
Definition: FwdRef.h:210
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 172 of file FwdRef.h.

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

172 { return ref_.isNonnull() || backRef_.isNonnull(); }
Ref< C, T, F > backRef_
Definition: FwdRef.h:211
Ref< C, T, F > ref_
Definition: FwdRef.h:210
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 168 of file FwdRef.h.

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

168 {return !isNonnull(); }
bool isNonnull() const
Checks for non-null.
Definition: FwdRef.h:172
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 204 of file FwdRef.h.

204 {return ref_.isTransient();}
Ref< C, T, F > ref_
Definition: FwdRef.h:210
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 195 of file FwdRef.h.

195 {return ref_.isNonnull() ? ref_.key() : backRef_.key() ;}
Ref< C, T, F > backRef_
Definition: FwdRef.h:211
Ref< C, T, F > ref_
Definition: FwdRef.h:210
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 175 of file FwdRef.h.

175 {return isNull();}
bool isNull() const
Checks for null.
Definition: FwdRef.h:168
template<typename C , typename T , typename F >
T const & edm::FwdRef< C, T, F >::operator* ( ) const
inline

Dereference operator.

Definition at line 235 of file FwdRef.h.

235  {
236  return ref_.isNonnull() && ref_.isAvailable() ?
237  ref_.operator*() :
238  backRef_.operator*();
239  }
Ref< C, T, F > backRef_
Definition: FwdRef.h:211
Ref< C, T, F > ref_
Definition: FwdRef.h:210
template<typename C , typename T , typename F >
T const * edm::FwdRef< C, T, F >::operator-> ( ) const
inline

Member dereference operator.

Definition at line 245 of file FwdRef.h.

245  {
246  return ref_.isNonnull() && ref_.isAvailable() ?
247  ref_.operator->() :
248  backRef_.operator->();
249  }
Ref< C, T, F > backRef_
Definition: FwdRef.h:211
Ref< C, T, F > ref_
Definition: FwdRef.h:210
template<typename C , typename T , typename F >
C const * edm::FwdRef< C, T, F >::product ( ) const
inline

Accessor for product collection.

Definition at line 225 of file FwdRef.h.

225  {
226  return ref_.isNonnull() && ref_.isAvailable() ?
227  ref_.product() :
228  backRef_.product();
229  }
Ref< C, T, F > backRef_
Definition: FwdRef.h:211
Ref< C, T, F > ref_
Definition: FwdRef.h:210
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 181 of file FwdRef.h.

181  {
182  if ( ref_.productGetter() ) return ref_.productGetter();
183  else return backRef_.productGetter();
184  }
Ref< C, T, F > backRef_
Definition: FwdRef.h:211
Ref< C, T, F > ref_
Definition: FwdRef.h:210
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 177 of file FwdRef.h.

Referenced by edm::operator==().

177 { return ref_; }
Ref< C, T, F > ref_
Definition: FwdRef.h:210

Member Data Documentation

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
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