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 (std::shared_ptr< HandleExceptionFactory const > iFailed)
 
 TestHandle (T const *product)
 

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.

35 : product_{product} {}

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

◆ 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)} {}

Member Function Documentation

◆ isValid()

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

Definition at line 42 of file TestHandle.h.

42 { return product_ != nullptr; }

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

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

◆ operator bool()

template<typename T >
edm::test::TestHandle< T >::operator bool ( )
inline

Definition at line 40 of file TestHandle.h.

40 { return product_ != nullptr; }

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

◆ operator*()

template<typename T >
T const& edm::test::TestHandle< T >::operator* ( void  ) const
inline

Definition at line 48 of file TestHandle.h.

48 { return *product(); }

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

◆ operator->()

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

Definition at line 46 of file TestHandle.h.

46 { return product(); }

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

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

51  {
52  if (product_) {
53  return product_;
54  }
55  throw *(whyFailedFactory_->make());
56  }

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

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

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().

edm::test::TestHandle::productStorage
T const * productStorage() const
Definition: TestHandle.h:51
edm::test::TestHandle::product
T const * product() const
Definition: TestHandle.h:44
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::test::TestHandle::whyFailedFactory_
std::shared_ptr< HandleExceptionFactory const > whyFailedFactory_
Definition: TestHandle.h:59
edm::test::TestHandle::product_
T const * product_
Definition: TestHandle.h:58