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  :
37  {}
T const * product() const
Definition: TestHandle.h:53
template<typename T >
edm::test::TestHandle< T >::TestHandle ( std::shared_ptr< HandleExceptionFactory iFailed)
inlineexplicit

Definition at line 39 of file TestHandle.h.

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

39  :
40  product_{nullptr},
42  {}
std::shared_ptr< HandleExceptionFactory > whyFailedFactory_
Definition: TestHandle.h:76
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 48 of file TestHandle.h.

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

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

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

Definition at line 44 of file TestHandle.h.

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

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

Definition at line 63 of file TestHandle.h.

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

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

Definition at line 58 of file TestHandle.h.

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

58  {
59  return product();
60  }
T const * product() const
Definition: TestHandle.h:53
template<typename T >
T const* edm::test::TestHandle< T >::product ( ) const
inline

Definition at line 53 of file TestHandle.h.

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

Referenced by edm::test::TestHandle< T >::operator*(), and edm::test::TestHandle< T >::operator->().

53  {
54  return productStorage();
55  }
T const * productStorage() const
Definition: TestHandle.h:68
template<typename T >
T const* edm::test::TestHandle< T >::productStorage ( ) const
inlineprivate

Definition at line 68 of file TestHandle.h.

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

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

68  {
69  if(product_) {
70  return product_;
71  }
72  throw *(whyFailedFactory_->make());
73  }
std::shared_ptr< HandleExceptionFactory > whyFailedFactory_
Definition: TestHandle.h:76

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