CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

edm::reftobase::RefHolder< REF > Class Template Reference

#include <RefHolder_.h>

Inheritance diagram for edm::reftobase::RefHolder< REF >:
edm::reftobase::RefHolderBase

List of all members.

Public Member Functions

virtual RefHolderBaseclone () const
virtual bool fillRefIfMyTypeMatches (RefHolderBase &fillme, std::string &msg) const
REF const & getRef () const
virtual bool hasProductCache () const
virtual ProductID id () const
virtual bool isAvailable () const
virtual bool isEqualTo (RefHolderBase const &rhs) const
virtual size_t key () const
virtual std::auto_ptr
< RefVectorHolderBase
makeVectorHolder () const
virtual void const * product () const
virtual EDProductGetter const * productGetter () const
 RefHolder ()
 RefHolder (REF const &ref)
void setRef (REF const &r)
void swap (RefHolder &other)
virtual ~RefHolder ()

Private Member Functions

virtual void const * pointerToType (Reflex::Type const &iToType) const

Private Attributes

REF ref_

Detailed Description

template<class REF>
class edm::reftobase::RefHolder< REF >

Definition at line 20 of file RefHolder_.h.


Constructor & Destructor Documentation

template<class REF >
edm::reftobase::RefHolder< REF >::RefHolder ( )

Definition at line 56 of file RefHolder_.h.

                              : 
      RefHolderBase(), ref_()
    { }
template<class REF >
edm::reftobase::RefHolder< REF >::RefHolder ( REF const &  ref) [explicit]

Definition at line 61 of file RefHolder_.h.

                                            : 
      RefHolderBase(), ref_(ref) 
    { }
template<class REF >
edm::reftobase::RefHolder< REF >::~RefHolder ( ) [virtual]

Definition at line 66 of file RefHolder_.h.

    { }

Member Function Documentation

template<class REF >
RefHolderBase * edm::reftobase::RefHolder< REF >::clone ( void  ) const [virtual]

Implements edm::reftobase::RefHolderBase.

Definition at line 71 of file RefHolder_.h.

    {
      return new RefHolder(ref_);
    }
template<class REF >
bool edm::reftobase::RefHolder< REF >::fillRefIfMyTypeMatches ( RefHolderBase fillme,
std::string &  msg 
) const [virtual]

Implements edm::reftobase::RefHolderBase.

Definition at line 93 of file RefHolder_.h.

References h, mergeVDriftHistosByStation::name, and edm::reftobase::RefHolder< REF >::setRef().

    {
      RefHolder* h = dynamic_cast<RefHolder*>(&fillme);
      bool conversion_worked = (h != 0);
      if (conversion_worked)
        h->setRef(ref_);
      else
        msg = typeid(REF).name();
      return conversion_worked;
    }
template<class REF >
REF const & edm::reftobase::RefHolder< REF >::getRef ( ) const [inline]
template<class REF >
bool edm::reftobase::RefHolder< REF >::hasProductCache ( ) const [virtual]

Implements edm::reftobase::RefHolderBase.

Definition at line 119 of file RefHolder_.h.

                                               {
      return ref_.hasProductCache();
    }
template<class REF >
ProductID edm::reftobase::RefHolder< REF >::id ( void  ) const [virtual]

Implements edm::reftobase::RefHolderBase.

Definition at line 78 of file RefHolder_.h.

References edm::ProductID::id().

    {
      return ref_.id();
    }
template<class REF>
virtual bool edm::reftobase::RefHolder< REF >::isAvailable ( ) const [inline, virtual]

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

Implements edm::reftobase::RefHolderBase.

Definition at line 42 of file RefHolder_.h.

References edm::reftobase::RefHolder< REF >::ref_.

{ return ref_.isAvailable(); }
template<class REF >
bool edm::reftobase::RefHolder< REF >::isEqualTo ( RefHolderBase const &  rhs) const [virtual]

Implements edm::reftobase::RefHolderBase.

Definition at line 85 of file RefHolder_.h.

References edm::reftobase::RefHolder< REF >::getRef(), edm::getRef(), and h.

    { 
      RefHolder const* h(dynamic_cast<RefHolder const*>(&rhs));
      return h && (getRef() == h->getRef());
    }
template<class REF >
size_t edm::reftobase::RefHolder< REF >::key ( ) const [virtual]

Implements edm::reftobase::RefHolderBase.

Definition at line 27 of file RefHolder.h.

References combine::key.

    {
      typedef typename RefKeyTrait<REF>::type helper;
      return helper::key( ref_ );
    }
template<class REF >
std::auto_ptr< RefVectorHolderBase > edm::reftobase::RefHolder< REF >::makeVectorHolder ( ) const [virtual]

Implements edm::reftobase::RefHolderBase.

Definition at line 14 of file RefHolder.h.

                                                                            {
      typedef typename RefHolderToRefVectorTrait<REF>::type helper;
      return helper::makeVectorHolder();
    }
template<class REF >
void const * edm::reftobase::RefHolder< REF >::pointerToType ( Reflex::Type const &  iToType) const [private, virtual]

Implements edm::reftobase::RefHolderBase.

Definition at line 146 of file RefHolder_.h.

References VarParsing::obj.

    {
      typedef typename REF::value_type contained_type;
      static const Reflex::Type s_type(Reflex::Type::ByTypeInfo(typeid(contained_type)));
    
      // The const_cast below is needed because
      // Object's constructor requires a pointer to
      // non-const void, although the implementation does not, of
      // course, modify the object to which the pointer points.
      Reflex::Object obj(s_type, const_cast<void*>(static_cast<const void*>(ref_.get())));
      if ( s_type == iToType ) return obj.Address();
      Reflex::Object cast = obj.CastObject(iToType);
      return cast.Address(); // returns void*, after pointer adjustment
    }
template<class REF >
void const * edm::reftobase::RefHolder< REF >::product ( ) const [virtual]

Implements edm::reftobase::RefHolderBase.

Definition at line 124 of file RefHolder_.h.

                                               {
      return ref_.product();
    }
template<class REF >
EDProductGetter const * edm::reftobase::RefHolder< REF >::productGetter ( ) const [virtual]

Implements edm::reftobase::RefHolderBase.

Definition at line 114 of file RefHolder_.h.

                                                               {
      return ref_.productGetter();
    }
template<class REF >
void edm::reftobase::RefHolder< REF >::setRef ( REF const &  r) [inline]
template<class REF >
void edm::reftobase::RefHolder< REF >::swap ( RefHolder< REF > &  other) [inline]

Definition at line 131 of file RefHolder_.h.

References edm::reftobase::RefHolder< REF >::ref_, and edm::reftobase::swap().

    {
      std::swap(ref_, other.ref_);
    }

Member Data Documentation

template<class REF>
REF edm::reftobase::RefHolder< REF >::ref_ [private]