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

#include "BranchID.h"

Classes

struct  Hash
 

Public Types

using value_type = unsigned int
 

Public Member Functions

 BranchID ()=default
 
 BranchID (std::string const &branchName)
 
 BranchID (value_type const id)
 
void setID (std::string const &branchName)
 
unsigned int id () const
 
bool isValid () const
 
 operator std::size_t () const
 
bool operator< (BranchID const &rh) const
 
bool operator> (BranchID const &rh) const
 
bool operator== (BranchID const &rh) const
 
bool operator!= (BranchID const &rh) const
 

Static Private Member Functions

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

Private Attributes

value_type id_ {}
 

Detailed Description

Definition at line 16 of file BranchID.h.

Member Typedef Documentation

using art::BranchID::value_type = unsigned int

Definition at line 18 of file BranchID.h.

Constructor & Destructor Documentation

art::BranchID::BranchID ( )
default
art::BranchID::BranchID ( std::string const &  branchName)
inlineexplicit

Definition at line 21 of file BranchID.h.

References toID().

22  : BranchID{toID(branchName)}
23  {}
static value_type toID(std::string const &branchName)
Definition: BranchID.cc:9
BranchID()=default
art::BranchID::BranchID ( value_type const  id)
inlineexplicit

Definition at line 24 of file BranchID.h.

24 : id_{id} {}
value_type id_
Definition: BranchID.h:81

Member Function Documentation

unsigned int art::BranchID::id ( ) const
inline

Definition at line 32 of file BranchID.h.

References id_.

Referenced by art::BranchID::Hash::operator()().

33  {
34  return id_;
35  }
value_type id_
Definition: BranchID.h:81
bool art::BranchID::isValid ( ) const
inline

Definition at line 37 of file BranchID.h.

References id_.

38  {
39  return id_ != 0;
40  }
value_type id_
Definition: BranchID.h:81
art::BranchID::operator std::size_t ( ) const
inlineexplicit

Definition at line 44 of file BranchID.h.

References id_.

45  {
46  return static_cast<std::size_t>(id_);
47  }
value_type id_
Definition: BranchID.h:81
bool art::BranchID::operator!= ( BranchID const &  rh) const
inline

Definition at line 65 of file BranchID.h.

References id_.

66  {
67  return id_ != rh.id_;
68  }
value_type id_
Definition: BranchID.h:81
bool art::BranchID::operator< ( BranchID const &  rh) const
inline

Definition at line 50 of file BranchID.h.

References id_.

51  {
52  return id_ < rh.id_;
53  }
value_type id_
Definition: BranchID.h:81
bool art::BranchID::operator== ( BranchID const &  rh) const
inline

Definition at line 60 of file BranchID.h.

References id_.

61  {
62  return id_ == rh.id_;
63  }
value_type id_
Definition: BranchID.h:81
bool art::BranchID::operator> ( BranchID const &  rh) const
inline

Definition at line 55 of file BranchID.h.

References id_.

56  {
57  return id_ > rh.id_;
58  }
value_type id_
Definition: BranchID.h:81
void art::BranchID::setID ( std::string const &  branchName)
inline

Definition at line 27 of file BranchID.h.

References id_, and toID().

28  {
29  id_ = toID(branchName);
30  }
value_type id_
Definition: BranchID.h:81
static value_type toID(std::string const &branchName)
Definition: BranchID.cc:9
BranchID::value_type art::BranchID::toID ( std::string const &  branchName)
staticprivate

Definition at line 9 of file BranchID.cc.

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

10  {
11  auto const check = cet::crc32{branchName}.digest();
12  mf::LogDebug("BranchID") << "Product created with branch id: "
13  << "[" << check << "] "
14  << "from branch name: "
15  << "\"" << branchName << "\"";
16  return check;
17  }
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug

Member Data Documentation

value_type art::BranchID::id_ {}
private

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