Public Member Functions | Private Attributes | Friends | List of all members
art::TypeLabel Class Reference

#include <TypeLabel.h>

Public Member Functions

 TypeLabel (TypeID const &itemtype, std::string const &instanceName, bool const supportsView, bool const transient=false)
 
 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::stringemulatedModule_
 

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 = false 
)

Definition at line 10 of file TypeLabel.cc.

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.

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
def move(depos, offset)
Definition: depos.py:107
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.

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

Definition at line 31 of file TypeLabel.cc.

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.

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

Definition at line 56 of file TypeLabel.h.

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.

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.

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.

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.

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  }
const double a
static bool * b
Definition: config.cpp:1043
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.

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

Definition at line 73 of file TypeLabel.h.

bool art::TypeLabel::supportsView_
private

Definition at line 74 of file TypeLabel.h.

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

Definition at line 75 of file TypeLabel.h.

TypeID art::TypeLabel::typeID_
private

Definition at line 72 of file TypeLabel.h.


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