Public Member Functions | Private Member Functions | Private Attributes | List of all members
gallery::AssnsBranchData Class Reference

#include <AssnsBranchData.h>

Inheritance diagram for gallery::AssnsBranchData:
gallery::BranchData art::EDProductGetter

Public Member Functions

virtual ~AssnsBranchData ()
 
 AssnsBranchData (art::TypeID const &type, TClass *iTClass, TBranch *branch, EventNavigator const *eventNavigator, art::PrincipalBase const *finder, std::string &&iBranchName, art::TypeID const &infoType, art::TypeID const &infoPartnerType)
 
- Public Member Functions inherited from gallery::BranchData
virtual ~BranchData ()
 
 BranchData ()=default
 
 BranchData (art::TypeID const &type, TClass *iTClass, TBranch *branch, EventNavigator const *eventNavigator, art::PrincipalBase const *finder, std::string &&iBranchName)
 
 BranchData (BranchData const &)=delete
 
 BranchData (BranchData &&)=delete
 
BranchDataoperator= (BranchData const &)=delete
 
BranchDataoperator= (BranchData &&)=delete
 
TClass * tClass () const noexcept
 
void * address () const noexcept
 
TBranch * branch () const noexcept
 
std::string const & branchName () const noexcept
 
long long lastProduct () const noexcept
 
- Public Member Functions inherited from art::EDProductGetter
virtual ~EDProductGetter ()
 
 EDProductGetter ()
 
 EDProductGetter (EDProductGetter const &)=delete
 
 EDProductGetter (EDProductGetter &&)=delete
 
EDProductGetteroperator= (EDProductGetter const &)=delete
 
EDProductGetteroperator= (EDProductGetter &&)=delete
 
EDProduct const * getIt () const
 

Private Member Functions

void updateFile (TBranch *iBranch) override
 
art::EDProduct const * getIt_ () const override
 
art::EDProduct const * uniqueProduct_ () const override
 
art::EDProduct const * uniqueProduct_ (art::TypeID const &wanted_wrapper_type) const override
 

Private Attributes

art::TypeID secondary_wrapper_type_ {}
 
std::unique_ptr< art::EDProductsecondaryProduct_ {nullptr}
 
long long secondaryLastProduct_ {-1}
 

Detailed Description

Definition at line 23 of file AssnsBranchData.h.

Constructor & Destructor Documentation

gallery::AssnsBranchData::~AssnsBranchData ( )
virtualdefault
gallery::AssnsBranchData::AssnsBranchData ( art::TypeID const &  type,
TClass *  iTClass,
TBranch *  branch,
EventNavigator const *  eventNavigator,
art::PrincipalBase const *  finder,
std::string &&  iBranchName,
art::TypeID const &  infoType,
art::TypeID const &  infoPartnerType 
)

Definition at line 15 of file AssnsBranchData.cc.

23  : BranchData{type,
24  iTClass,
25  iBranch,
26  eventNavigator,
27  finder,
28  move(iBranchName)}
29  {
30  if (type == infoType) {
31  secondary_wrapper_type_ = infoPartnerType;
32  } else {
33  secondary_wrapper_type_ = infoType;
34  }
35  }
art::TypeID secondary_wrapper_type_
def move(depos, offset)
Definition: depos.py:107
static QCString type
Definition: declinfo.cpp:672

Member Function Documentation

art::EDProduct const * gallery::AssnsBranchData::getIt_ ( ) const
overrideprivatevirtual

Reimplemented from gallery::BranchData.

Definition at line 46 of file AssnsBranchData.cc.

47  {
48  throw art::Exception(art::errors::LogicError, "AmbiguousProduct")
49  << "AssnsBranchData uniqueProduct() called without specifying which type "
50  "was wanted.\n"
51  << "branch name is " << branchName() << "\n"
52  << "Possibly you tried to use a Ptr that points into an Assns, which is "
53  "not allowed and does not work\n";
54  }
std::string const & branchName() const noexcept
Definition: BranchData.h:66
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
art::EDProduct const * gallery::AssnsBranchData::uniqueProduct_ ( ) const
overrideprivatevirtual

Reimplemented from gallery::BranchData.

Definition at line 57 of file AssnsBranchData.cc.

58  {
59  throw art::Exception(art::errors::LogicError, "AmbiguousProduct")
60  << "AssnsBranchData uniqueProduct() called without specifying which type "
61  "was wanted.\n"
62  << "branch name is " << branchName() << "\n"
63  << "Possibly you tried to use a Ptr that points into an Assns, which is "
64  "not allowed and does not work\n";
65  }
std::string const & branchName() const noexcept
Definition: BranchData.h:66
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
art::EDProduct const * gallery::AssnsBranchData::uniqueProduct_ ( art::TypeID const &  wanted_wrapper_type) const
overrideprivatevirtual

Reimplemented from gallery::BranchData.

Definition at line 68 of file AssnsBranchData.cc.

69  {
70  art::EDProduct const* primaryAssns = BranchData::getIt_();
71  if (primaryAssns && (wanted_wrapper_type == secondary_wrapper_type_)) {
74  primaryAssns->makePartner(wanted_wrapper_type.typeInfo());
76  }
77  return secondaryProduct_.get();
78  }
79  return primaryAssns;
80  }
art::TypeID secondary_wrapper_type_
std::unique_ptr< EDProduct > makePartner(std::type_info const &wanted_type) const
Definition: EDProduct.h:70
std::unique_ptr< art::EDProduct > secondaryProduct_
virtual art::EDProduct const * getIt_() const
Definition: BranchData.cc:79
long long lastProduct() const noexcept
Definition: BranchData.h:72
void gallery::AssnsBranchData::updateFile ( TBranch *  iBranch)
overrideprivatevirtual

Reimplemented from gallery::BranchData.

Definition at line 38 of file AssnsBranchData.cc.

39  {
41  secondaryProduct_.reset();
42  BranchData::updateFile(iBranch);
43  }
std::unique_ptr< art::EDProduct > secondaryProduct_
virtual void updateFile(TBranch *iBranch)
Definition: BranchData.cc:69

Member Data Documentation

art::TypeID gallery::AssnsBranchData::secondary_wrapper_type_ {}
private

Definition at line 44 of file AssnsBranchData.h.

long long gallery::AssnsBranchData::secondaryLastProduct_ {-1}
mutableprivate

Definition at line 46 of file AssnsBranchData.h.

std::unique_ptr<art::EDProduct> gallery::AssnsBranchData::secondaryProduct_ {nullptr}
mutableprivate

Definition at line 45 of file AssnsBranchData.h.


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