LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
art::TypeLabel Class Reference

#include "TypeLabel.h"

Public Member Functions

 TypeLabel (TypeID const &itemtype, std::string const &instanceName, bool const supportsView, bool const transient)
 
 TypeLabel (TypeID const &itemtype, std::string const &instanceName, bool const supportsView, std::string emulatedModule)
 
auto const & typeID () const
 
std::string className () const
 
std::string friendlyClassName () const
 
std::string const & emulatedModule () const
 
std::string const & productInstanceName () const
 
bool hasEmulatedModule () const
 
bool supportsView () const
 
bool transient () const
 

Private Attributes

TypeID typeID_
 
std::string productInstanceName_
 
bool supportsView_
 
bool transient_ {false}
 
std::shared_ptr< std::string > emulatedModule_
 

Friends

bool operator< (TypeLabel const &a, TypeLabel const &b)
 
std::ostream & operator<< (std::ostream &os, TypeLabel const &tl)
 

Detailed Description

Definition at line 22 of file TypeLabel.h.

Constructor & Destructor Documentation

art::TypeLabel::TypeLabel ( TypeID const &  itemtype,
std::string const &  instanceName,
bool const  supportsView,
bool const  transient 
)

Definition at line 10 of file TypeLabel.cc.

References productInstanceName_, supportsView(), supportsView_, and transient_.

14  : typeID_{itemtype}
15  , productInstanceName_{instanceName}
17  , transient_{transient}
18  {}
bool supportsView() const
Definition: TypeLabel.h:61
TypeID typeID_
Definition: TypeLabel.h:72
bool transient_
Definition: TypeLabel.h:75
std::string productInstanceName_
Definition: TypeLabel.h:73
bool supportsView_
Definition: TypeLabel.h:74
art::TypeLabel::TypeLabel ( TypeID const &  itemtype,
std::string const &  instanceName,
bool const  supportsView,
std::string  emulatedModule 
)

Definition at line 20 of file TypeLabel.cc.

References emulatedModule(), emulatedModule_, productInstanceName_, supportsView(), and supportsView_.

24  : typeID_{itemtype}
25  , productInstanceName_{instanceName}
27  , emulatedModule_{std::make_unique<std::string>(std::move(emulatedModule))}
28  {}
std::string const & emulatedModule() const
Definition: TypeLabel.cc:31
std::shared_ptr< std::string > emulatedModule_
Definition: TypeLabel.h:76
bool supportsView() const
Definition: TypeLabel.h:61
TypeID typeID_
Definition: TypeLabel.h:72
std::string productInstanceName_
Definition: TypeLabel.h:73
bool supportsView_
Definition: TypeLabel.h:74

Member Function Documentation

std::string art::TypeLabel::className ( ) const
inline

Definition at line 40 of file TypeLabel.h.

References art::TypeID::className(), and typeID_.

Referenced by art::operator<(), and art::operator<<().

41  {
42  return typeID_.className();
43  }
TypeID typeID_
Definition: TypeLabel.h:72
std::string className() const
Definition: TypeID.cc:21
std::string const & art::TypeLabel::emulatedModule ( ) const

Definition at line 31 of file TypeLabel.cc.

References emulatedModule_, and art::errors::NullPointerError.

Referenced by friendlyClassName(), art::operator<<(), and TypeLabel().

32  {
33  if (!emulatedModule_) {
35  "TypeLabel::emulatedModule\n")
36  << "Attempt to retrieve an emulated module name when one does not "
37  "exist.\n";
38  }
39  return *emulatedModule_;
40  }
std::shared_ptr< std::string > emulatedModule_
Definition: TypeLabel.h:76
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::string art::TypeLabel::friendlyClassName ( ) const
inline

Definition at line 45 of file TypeLabel.h.

References emulatedModule(), art::TypeID::friendlyClassName(), and typeID_.

Referenced by art::ProductRegistryHelper::insertOrThrow().

46  {
47  return typeID_.friendlyClassName();
48  }
std::string friendlyClassName() const
Definition: TypeID.cc:33
TypeID typeID_
Definition: TypeLabel.h:72
bool art::TypeLabel::hasEmulatedModule ( ) const
inline

Definition at line 56 of file TypeLabel.h.

References emulatedModule_.

Referenced by art::operator<(), and art::operator<<().

57  {
58  return static_cast<bool>(emulatedModule_);
59  }
std::shared_ptr< std::string > emulatedModule_
Definition: TypeLabel.h:76
std::string const& art::TypeLabel::productInstanceName ( ) const
inline

Definition at line 51 of file TypeLabel.h.

References productInstanceName_.

Referenced by art::ProductRegistryHelper::insertOrThrow(), and art::operator<<().

52  {
53  return productInstanceName_;
54  }
std::string productInstanceName_
Definition: TypeLabel.h:73
bool art::TypeLabel::supportsView ( ) const
inline

Definition at line 61 of file TypeLabel.h.

References supportsView_.

Referenced by art::operator<<(), and TypeLabel().

62  {
63  return supportsView_;
64  }
bool supportsView_
Definition: TypeLabel.h:74
bool art::TypeLabel::transient ( ) const
inline

Definition at line 66 of file TypeLabel.h.

References transient_.

Referenced by art::operator<<().

67  {
68  return transient_;
69  }
bool transient_
Definition: TypeLabel.h:75
auto const& art::TypeLabel::typeID ( ) const
inline

Definition at line 35 of file TypeLabel.h.

References typeID_.

36  {
37  return typeID_;
38  }
TypeID typeID_
Definition: TypeLabel.h:72

Friends And Related Function Documentation

bool operator< ( TypeLabel const &  a,
TypeLabel const &  b 
)
friend

Definition at line 45 of file TypeLabel.cc.

46  {
47  auto const& a_class_name = a.className();
48  auto const& b_class_name = b.className();
49  auto const& a_emulated_module =
50  a.hasEmulatedModule() ? *a.emulatedModule_ : "<none>";
51  auto const& b_emulated_module =
52  b.hasEmulatedModule() ? *b.emulatedModule_ : "<none>";
53  return std::tie(a_emulated_module, a.productInstanceName_, a_class_name) <
54  std::tie(b_emulated_module, b.productInstanceName_, b_class_name);
55  }
std::ostream& operator<< ( std::ostream &  os,
TypeLabel const &  tl 
)
friend

Definition at line 58 of file TypeLabel.cc.

59  {
60  os << "Emulated module: '"
61  << (tl.hasEmulatedModule() ? tl.emulatedModule() : "<none>") << "'\n"
62  << "Product instance name: '" << tl.productInstanceName() << "'\n"
63  << "Class name: '" << tl.className() << "'\n"
64  << "Supports views: '" << std::boolalpha << tl.supportsView()
65  << '\n'
66  << "Transient: '" << tl.transient();
67  return os;
68  }

Member Data Documentation

std::shared_ptr<std::string> art::TypeLabel::emulatedModule_
private
Initial value:
{
nullptr}

Definition at line 76 of file TypeLabel.h.

Referenced by emulatedModule(), hasEmulatedModule(), art::operator<(), and TypeLabel().

std::string art::TypeLabel::productInstanceName_
private

Definition at line 73 of file TypeLabel.h.

Referenced by art::operator<(), productInstanceName(), and TypeLabel().

bool art::TypeLabel::supportsView_
private

Definition at line 74 of file TypeLabel.h.

Referenced by supportsView(), and TypeLabel().

bool art::TypeLabel::transient_ {false}
private

Definition at line 75 of file TypeLabel.h.

Referenced by transient(), and TypeLabel().

TypeID art::TypeLabel::typeID_
private

Definition at line 72 of file TypeLabel.h.

Referenced by className(), friendlyClassName(), and typeID().


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