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 const > iFailed)
 

Private Member Functions

T const * productStorage () const
 

Private Attributes

T const * product_
 
std::shared_ptr< HandleExceptionFactory const > whyFailedFactory_
 

Detailed Description

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

Definition at line 33 of file TestHandle.h.

Constructor & Destructor Documentation

◆ TestHandle() [1/2]

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

Definition at line 35 of file TestHandle.h.

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

35 : product_{product} {}
T const * product() const
Definition: TestHandle.h:44

◆ TestHandle() [2/2]

template<typename T >
edm::test::TestHandle< T >::TestHandle ( std::shared_ptr< HandleExceptionFactory const >  iFailed)
inlineexplicit

Definition at line 37 of file TestHandle.h.

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

Member Function Documentation

◆ isValid()

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

◆ operator bool()

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

◆ operator*()

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

◆ operator->()

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

◆ product()

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

◆ productStorage()

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 const > whyFailedFactory_
Definition: TestHandle.h:59

Member Data Documentation

◆ product_

template<typename T >
T const* edm::test::TestHandle< T >::product_
private

◆ whyFailedFactory_

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

Definition at line 59 of file TestHandle.h.

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