CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
edm::Hash< I > Class Template Reference

#include <Hash.h>

Public Types

typedef hash_detail::value_type value_type
 

Public Member Functions

value_type compactForm () const
 
 Hash ()
 
 Hash (value_type const &v)
 
 Hash (Hash< I > const &)
 
 Hash (Hash< I > &&)=default
 
bool isCompactForm () const
 
bool isValid () const
 
bool operator!= (Hash< I > const &other) const
 
bool operator< (Hash< I > const &other) const
 
Hash< I > & operator= (Hash< I > const &iRHS)
 
Hash< I > & operator= (Hash< I > &&)=default
 
bool operator== (Hash< I > const &other) const
 
bool operator> (Hash< I > const &other) const
 
std::ostream & print (std::ostream &os) const
 
void reset ()
 
size_t smallHash () const
 returns a short hash which can be used with hashing containers More...
 
void swap (Hash< I > &other)
 
void toDigest (cms::Digest &digest) const
 
void toString (std::string &result) const
 

Static Public Member Functions

static short Class_Version ()
 

Private Member Functions

template<typename Op >
bool compareUsing (Hash< I > const &iOther, Op op) const
 
void throwIfIllFormed () const
 

Private Attributes

value_type hash_
 

Detailed Description

template<int I>
class edm::Hash< I >

Definition at line 43 of file Hash.h.

Member Typedef Documentation

◆ value_type

template<int I>
typedef hash_detail::value_type edm::Hash< I >::value_type

Definition at line 45 of file Hash.h.

Constructor & Destructor Documentation

◆ Hash() [1/4]

template<int I>
edm::Hash< I >::Hash ( )
inline

Definition at line 116 of file Hash.h.

value_type hash_
Definition: Hash.h:107
std::string const & InvalidHash()
Definition: Hash.cc:11

◆ Hash() [2/4]

template<int I>
edm::Hash< I >::Hash ( value_type const &  v)
explicit

◆ Hash() [3/4]

template<int I>
edm::Hash< I >::Hash ( Hash< I > const &  iOther)
inline

Definition at line 124 of file Hash.h.

124  : hash_(iOther.hash_) {
126  }
value_type hash_
Definition: Hash.h:107
void fixup_(value_type &hash)
Definition: Hash.cc:30

◆ Hash() [4/4]

template<int I>
edm::Hash< I >::Hash ( Hash< I > &&  )
default

Member Function Documentation

◆ Class_Version()

template<int I>
static short edm::Hash< I >::Class_Version ( )
inlinestatic

Definition at line 84 of file Hash.h.

84 { return 11; }

◆ compactForm()

template<int I>
Hash< I >::value_type edm::Hash< I >::compactForm ( ) const
inline

Definition at line 186 of file Hash.h.

Referenced by edm::streamer::StreamerOutputMsgBuilders::serializeRegistry().

186  {
188  }
value_type hash_
Definition: Hash.h:107
value_type compactForm_(value_type const &hash)
Definition: Hash.cc:18

◆ compareUsing()

template<int I>
template<typename Op >
bool edm::Hash< I >::compareUsing ( Hash< I > const &  iOther,
Op  op 
) const
inlineprivate

Definition at line 92 of file Hash.h.

92  {
94  bool otherCF = hash_detail::isCompactForm_(iOther.hash_);
95  if (meCF == otherCF) {
96  return op(this->hash_, iOther.hash_);
97  }
98  //copy constructor will do compact form conversion
99  if (meCF) {
100  Hash<I> temp(iOther); // NOLINT(performance-unnecessary-copy-initialization)
101  return op(this->hash_, temp.hash_);
102  }
103  Hash<I> temp(*this);
104  return op(temp.hash_, iOther.hash_);
105  }
value_type hash_
Definition: Hash.h:107
bool isCompactForm_(value_type const &hash)
Definition: Hash.cc:61

◆ isCompactForm()

template<int I>
bool edm::Hash< I >::isCompactForm ( ) const
inline

Definition at line 199 of file Hash.h.

199  {
201  }
value_type hash_
Definition: Hash.h:107
bool isCompactForm_(value_type const &hash)
Definition: Hash.cc:61

◆ isValid()

template<int I>
bool edm::Hash< I >::isValid ( void  ) const
inline

◆ operator!=()

template<int I>
bool edm::Hash< I >::operator!= ( Hash< I > const &  other) const
inline

Definition at line 161 of file Hash.h.

161  {
162  return this->compareUsing(other, std::not_equal_to<std::string>());
163  }
bool compareUsing(Hash< I > const &iOther, Op op) const
Definition: Hash.h:92

◆ operator<()

template<int I>
bool edm::Hash< I >::operator< ( Hash< I > const &  other) const
inline

Definition at line 146 of file Hash.h.

146  {
147  return this->compareUsing(other, std::less<std::string>());
148  }
bool compareUsing(Hash< I > const &iOther, Op op) const
Definition: Hash.h:92

◆ operator=() [1/2]

template<int I>
Hash< I > & edm::Hash< I >::operator= ( Hash< I > const &  iRHS)
inline

Definition at line 129 of file Hash.h.

129  {
130  hash_ = iRHS.hash_;
132  return *this;
133  }
value_type hash_
Definition: Hash.h:107
void fixup_(value_type &hash)
Definition: Hash.cc:30

◆ operator=() [2/2]

template<int I>
Hash<I>& edm::Hash< I >::operator= ( Hash< I > &&  )
default

◆ operator==()

template<int I>
bool edm::Hash< I >::operator== ( Hash< I > const &  other) const
inline

Definition at line 156 of file Hash.h.

156  {
157  return this->compareUsing(other, std::equal_to<std::string>());
158  }
bool compareUsing(Hash< I > const &iOther, Op op) const
Definition: Hash.h:92

◆ operator>()

template<int I>
bool edm::Hash< I >::operator> ( Hash< I > const &  other) const
inline

Definition at line 151 of file Hash.h.

151  {
152  return this->compareUsing(other, std::greater<std::string>());
153  }
bool compareUsing(Hash< I > const &iOther, Op op) const
Definition: Hash.h:92

◆ print()

template<int I>
std::ostream & edm::Hash< I >::print ( std::ostream &  os) const
inline

Definition at line 166 of file Hash.h.

166  {
167  return hash_detail::print_(os, hash_);
168  }
value_type hash_
Definition: Hash.h:107
std::ostream & print_(std::ostream &os, value_type const &hash)
Definition: Hash.cc:92

◆ reset()

template<int I>
void edm::Hash< I >::reset ( void  )
inline

Definition at line 136 of file Hash.h.

Referenced by edm::EventSelector::acceptEvent(), edm::ProcessConfiguration::Transients::reset(), and edm::ProcessHistory::Transients::reset().

136  {
138  }
value_type hash_
Definition: Hash.h:107
std::string const & InvalidHash()
Definition: Hash.cc:11

◆ smallHash()

template<int I>
size_t edm::Hash< I >::smallHash ( ) const
inline

returns a short hash which can be used with hashing containers

Definition at line 191 of file Hash.h.

Referenced by edm::dqh::parentage_hash::operator()(), edm::ParentageRegistry::key_hash::operator()(), and edm::pset::Registry::key_hash::operator()().

191  {
193  }
value_type hash_
Definition: Hash.h:107
size_t smallHash_(value_type const &hash)
Definition: Hash.cc:52

◆ swap()

template<int I>
void edm::Hash< I >::swap ( Hash< I > &  other)
inline

◆ throwIfIllFormed()

template<int I>
void edm::Hash< I >::throwIfIllFormed ( ) const
private

Hexified version of data must contain a multiple of 2 bytes. If it does not, throw an exception.

◆ toDigest()

template<int I>
void edm::Hash< I >::toDigest ( cms::Digest digest) const
inline

Definition at line 176 of file Hash.h.

Referenced by edm::ParameterSetEntry::toDigest().

176  {
177  hash_detail::toDigest_(digest, hash_);
178  }
value_type hash_
Definition: Hash.h:107
void toDigest_(cms::Digest &digest, value_type const &hash)
Definition: Hash.cc:83

◆ toString()

template<int I>
void edm::Hash< I >::toString ( std::string &  result) const
inline

Definition at line 171 of file Hash.h.

Referenced by edm::ParameterSetConverter::convertParameterSets(), and edm::ParameterSetEntry::toString().

171  {
173  }
value_type hash_
Definition: Hash.h:107
void toString_(std::string &result, value_type const &hash)
Definition: Hash.cc:75

Member Data Documentation

◆ hash_

template<int I>
value_type edm::Hash< I >::hash_
private