CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
edm::test::TestHandle< T > Class Template Reference

#include <TestHandle.h>

Public Member Functions

bool isValid () const
 
 operator bool ()
 
T const & operator* () const
 
T const * operator-> () const
 
T const * product () const
 
 TestHandle (T const *product)
 
 TestHandle (std::shared_ptr< HandleExceptionFactory > iFailed)
 

Private Member Functions

T const * productStorage () const
 

Private Attributes

T const * product_
 
std::shared_ptr< HandleExceptionFactorywhyFailedFactory_
 

Detailed Description

template<typename T>
class edm::test::TestHandle< T >

Definition at line 33 of file TestHandle.h.

Constructor & Destructor Documentation

template<typename T >
edm::test::TestHandle< T >::TestHandle ( T const *  product)
inlineexplicit

Definition at line 35 of file TestHandle.h.

35 : product_{product} {}
T const * product() const
Definition: TestHandle.h:44
template<typename T >
edm::test::TestHandle< T >::TestHandle ( std::shared_ptr< HandleExceptionFactory iFailed)
inlineexplicit

Definition at line 37 of file TestHandle.h.

References eostools::move(), and edm::test::TestHandle< T >::whyFailedFactory_.

38  : product_{nullptr}, whyFailedFactory_{std::move(iFailed)} {}
std::shared_ptr< HandleExceptionFactory > whyFailedFactory_
Definition: TestHandle.h:59
def move(src, dest)
Definition: eostools.py:511

Member Function Documentation

template<typename T >
bool edm::test::TestHandle< T >::isValid ( void  ) const
inline

Definition at line 42 of file TestHandle.h.

References edm::test::TestHandle< T >::product_.

Referenced by ntupleDataFormat._Object::_checkIsValid(), and core.AutoHandle.AutoHandle::ReallyLoad().

42 { return product_ != nullptr; }
template<typename T >
edm::test::TestHandle< T >::operator bool ( )
inline

Definition at line 40 of file TestHandle.h.

References edm::test::TestHandle< T >::product_.

40 { return product_ != nullptr; }
template<typename T >
T const& edm::test::TestHandle< T >::operator* ( void  ) const
inline

Definition at line 48 of file TestHandle.h.

References edm::test::TestHandle< T >::product().

48 { return *product(); }
T const * product() const
Definition: TestHandle.h:44
template<typename T >
T const* edm::test::TestHandle< T >::operator-> ( ) const
inline

Definition at line 46 of file TestHandle.h.

References edm::test::TestHandle< T >::product().

46 { return product(); }
T const * product() const
Definition: TestHandle.h:44
template<typename T >
T const* edm::test::TestHandle< T >::product ( ) const
inline
template<typename T >
T const* edm::test::TestHandle< T >::productStorage ( ) const
inlineprivate

Definition at line 51 of file TestHandle.h.

References edm::test::TestHandle< T >::product_, and edm::test::TestHandle< T >::whyFailedFactory_.

Referenced by edm::test::TestHandle< T >::product().

51  {
52  if (product_) {
53  return product_;
54  }
55  throw *(whyFailedFactory_->make());
56  }
std::shared_ptr< HandleExceptionFactory > whyFailedFactory_
Definition: TestHandle.h:59

Member Data Documentation

template<typename T >
T const* edm::test::TestHandle< T >::product_
private
template<typename T >
std::shared_ptr<HandleExceptionFactory> edm::test::TestHandle< T >::whyFailedFactory_
private