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

#include "ProductID.h"

Classes

struct  Hash
 

Public Types

using value_type = unsigned int
 

Public Member Functions

constexpr ProductID ()=default
 
 ProductID (std::string const &canonicalProductName)
 
constexpr ProductID (value_type const value) noexcept
 
void setID (std::string const &canonicalProductName)
 
constexpr bool isValid () const noexcept
 
constexpr auto value () const noexcept
 
constexpr operator std::size_t () const noexcept
 
constexpr bool operator< (ProductID const rh) const noexcept
 
constexpr bool operator> (ProductID const rh) const noexcept
 
constexpr bool operator== (ProductID const rh) const noexcept
 
constexpr bool operator!= (ProductID const rh) const noexcept
 

Static Public Member Functions

static constexpr ProductID invalid () noexcept
 

Static Private Member Functions

static value_type toID (std::string const &branchName)
 

Private Attributes

value_type value_ {0u}
 

Friends

class ProductIDStreamer
 

Detailed Description

Definition at line 15 of file ProductID.h.

Member Typedef Documentation

using art::ProductID::value_type = unsigned int

Definition at line 17 of file ProductID.h.

Constructor & Destructor Documentation

constexpr art::ProductID::ProductID ( )
default
art::ProductID::ProductID ( std::string const &  canonicalProductName)
explicit

Definition at line 8 of file ProductID.cc.

References toID().

10  {}
constexpr ProductID()=default
std::string canonicalProductName(std::string const &friendlyClassName, std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName)
static value_type toID(std::string const &branchName)
Definition: ProductID.cc:19
constexpr art::ProductID::ProductID ( value_type const  value)
inlineexplicitnoexcept

Definition at line 21 of file ProductID.h.

References value().

22  : value_{value}
23  {}
constexpr auto value() const noexcept
Definition: ProductID.h:40
value_type value_
Definition: ProductID.h:86

Member Function Documentation

static constexpr ProductID art::ProductID::invalid ( )
inlinestaticnoexcept

Definition at line 26 of file ProductID.h.

References art::canonicalProductName(), and setID().

Referenced by art::ProductInserter::put().

27  {
28  return ProductID{};
29  }
constexpr ProductID()=default
constexpr bool art::ProductID::isValid ( ) const
inlinenoexcept

Definition at line 34 of file ProductID.h.

References value_.

Referenced by art::BranchDescription::initProductID_(), art::RefCore::isAvailable(), and art::RefCore::isNonnull().

35  {
36  return value_ != 0u;
37  }
value_type value_
Definition: ProductID.h:86
constexpr art::ProductID::operator std::size_t ( ) const
inlinenoexcept

Definition at line 45 of file ProductID.h.

References value_.

46  {
47  return static_cast<std::size_t>(value_);
48  }
value_type value_
Definition: ProductID.h:86
constexpr bool art::ProductID::operator!= ( ProductID const  rh) const
inlinenoexcept

Definition at line 66 of file ProductID.h.

67  {
68  return !(*this == rh);
69  }
constexpr bool art::ProductID::operator< ( ProductID const  rh) const
inlinenoexcept

Definition at line 51 of file ProductID.h.

References value_.

52  {
53  return value_ < rh.value_;
54  }
value_type value_
Definition: ProductID.h:86
constexpr bool art::ProductID::operator== ( ProductID const  rh) const
inlinenoexcept

Definition at line 61 of file ProductID.h.

References value_.

62  {
63  return value_ == rh.value_;
64  }
value_type value_
Definition: ProductID.h:86
constexpr bool art::ProductID::operator> ( ProductID const  rh) const
inlinenoexcept

Definition at line 56 of file ProductID.h.

57  {
58  return rh < *this;
59  }
void art::ProductID::setID ( std::string const &  canonicalProductName)

Definition at line 13 of file ProductID.cc.

References toID(), and value_.

Referenced by art::BranchDescription::initProductID_(), and invalid().

14  {
16  }
std::string canonicalProductName(std::string const &friendlyClassName, std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName)
static value_type toID(std::string const &branchName)
Definition: ProductID.cc:19
value_type value_
Definition: ProductID.h:86
ProductID::value_type art::ProductID::toID ( std::string const &  branchName)
staticprivate

Definition at line 19 of file ProductID.cc.

Referenced by art::ProductID::Hash::operator()(), ProductID(), and setID().

20  {
21  return cet::crc32{canonicalProductName}.digest();
22  }
std::string canonicalProductName(std::string const &friendlyClassName, std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName)
constexpr auto art::ProductID::value ( ) const
inlinenoexcept

Definition at line 40 of file ProductID.h.

References value_.

Referenced by ProductID().

41  {
42  return value_;
43  }
value_type value_
Definition: ProductID.h:86

Friends And Related Function Documentation

friend class ProductIDStreamer
friend

Definition at line 82 of file ProductID.h.

Member Data Documentation

value_type art::ProductID::value_ {0u}
private

Definition at line 86 of file ProductID.h.

Referenced by isValid(), operator std::size_t(), operator<(), operator==(), setID(), and value().


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