LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
art::GroupQueryResult Class Reference

#include "GroupQueryResult.h"

Public Member Functions

 GroupQueryResult (group_ptr_t)
 
 GroupQueryResult (exception_ptr_t)
 
bool succeeded () const
 
bool failed () const
 
cet::exempt_ptr< Groupresult () const
 
std::shared_ptr< art::Exception const > whyFailed () const
 

Private Attributes

std::variant< group_ptr_t, exception_ptr_tgroupOrException_
 

Detailed Description

Definition at line 27 of file GroupQueryResult.h.

Constructor & Destructor Documentation

art::GroupQueryResult::GroupQueryResult ( group_ptr_t  g)
explicit

Definition at line 10 of file GroupQueryResult.cc.

10 : groupOrException_{g} {}
std::variant< group_ptr_t, exception_ptr_t > groupOrException_
art::GroupQueryResult::GroupQueryResult ( exception_ptr_t  e)
explicit

Definition at line 12 of file GroupQueryResult.cc.

14 {}
std::variant< group_ptr_t, exception_ptr_t > groupOrException_
Float_t e
Definition: plot.C:35

Member Function Documentation

bool art::GroupQueryResult::failed ( ) const
inline

Definition at line 39 of file GroupQueryResult.h.

References groupOrException_.

Referenced by art::ProductRetriever::getByLabel_().

40  {
41  return std::holds_alternative<exception_ptr_t>(groupOrException_);
42  }
std::variant< group_ptr_t, exception_ptr_t > groupOrException_
cet::exempt_ptr<Group> art::GroupQueryResult::result ( ) const
inline

Definition at line 46 of file GroupQueryResult.h.

References groupOrException_.

Referenced by art::ProductRetriever::getByLabel_(), art::ProductRetriever::getProductProvenance(), art::Handle< T >::Handle(), and whyFailed().

47  {
48  auto result = std::get_if<group_ptr_t>(&groupOrException_);
49  return result ? *result : nullptr;
50  }
std::variant< group_ptr_t, exception_ptr_t > groupOrException_
cet::exempt_ptr< Group > result() const
bool art::GroupQueryResult::succeeded ( ) const
inline

Definition at line 34 of file GroupQueryResult.h.

References groupOrException_.

Referenced by art::ProductRetriever::getByLabel_(), art::ProductRetriever::getByProductID_(), and art::ProductRetriever::getBySelector_().

35  {
36  return std::holds_alternative<group_ptr_t>(groupOrException_);
37  }
std::variant< group_ptr_t, exception_ptr_t > groupOrException_
std::shared_ptr<art::Exception const> art::GroupQueryResult::whyFailed ( ) const
inline

Definition at line 52 of file GroupQueryResult.h.

References groupOrException_, and result().

53  {
54  auto result = std::get_if<exception_ptr_t>(&groupOrException_);
55  return result ? *result : nullptr;
56  }
std::variant< group_ptr_t, exception_ptr_t > groupOrException_
cet::exempt_ptr< Group > result() const

Member Data Documentation

std::variant<group_ptr_t, exception_ptr_t> art::GroupQueryResult::groupOrException_
private

Definition at line 59 of file GroupQueryResult.h.

Referenced by failed(), result(), succeeded(), and whyFailed().


The documentation for this class was generated from the following files: