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

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

Definition at line 45 of file Hash.h.

Constructor & Destructor Documentation

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

Definition at line 121 of file Hash.h.

References edm::hash_detail::fixup_(), edm::Hash< I >::hash_, and findQualityFiles::v.

value_type hash_
Definition: Hash.h:109
std::string const & InvalidHash()
Definition: Hash.cc:11
template<int I>
edm::Hash< I >::Hash ( value_type const &  v)
explicit
template<int I>
edm::Hash< I >::Hash ( Hash< I > const &  iOther)
inline

Definition at line 131 of file Hash.h.

References edm::hash_detail::fixup_(), and edm::Hash< I >::hash_.

131  : hash_(iOther.hash_) {
133  }
value_type hash_
Definition: Hash.h:109
void fixup_(value_type &hash)
Definition: Hash.cc:32
template<int I>
edm::Hash< I >::Hash ( Hash< I > &&  )
default

Member Function Documentation

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

Definition at line 84 of file Hash.h.

84 {return 11;}
template<int I>
Hash< I >::value_type edm::Hash< I >::compactForm ( ) const
inline

Definition at line 217 of file Hash.h.

References edm::hash_detail::compactForm_(), and edm::Hash< I >::hash_.

Referenced by edm::StreamerOutputModuleCommon::serializeRegistry().

217  {
219  }
value_type hash_
Definition: Hash.h:109
value_type compactForm_(value_type const &hash)
Definition: Hash.cc:19
template<int I>
template<typename Op >
bool edm::Hash< I >::compareUsing ( Hash< I > const &  iOther,
Op  op 
) const
inlineprivate

Definition at line 94 of file Hash.h.

Referenced by edm::Hash< I >::operator!=(), edm::Hash< I >::operator<(), edm::Hash< I >::operator==(), and edm::Hash< I >::operator>().

94  {
96  bool otherCF = hash_detail::isCompactForm_(iOther.hash_);
97  if(meCF == otherCF) {
98  return op(this->hash_,iOther.hash_);
99  }
100  //copy constructor will do compact form conversion
101  if(meCF) {
102  Hash<I> temp(iOther);
103  return op(this->hash_,temp.hash_);
104  }
105  Hash<I> temp(*this);
106  return op(temp.hash_,iOther.hash_);
107  }
value_type hash_
Definition: Hash.h:109
bool isCompactForm_(value_type const &hash)
Definition: Hash.cc:67
template<int I>
bool edm::Hash< I >::isCompactForm ( ) const
inline

Definition at line 233 of file Hash.h.

References edm::Hash< I >::hash_, and edm::hash_detail::isCompactForm_().

233  {
235  }
value_type hash_
Definition: Hash.h:109
bool isCompactForm_(value_type const &hash)
Definition: Hash.cc:67
template<int I>
bool edm::Hash< I >::isValid ( void  ) const
inline
template<int I>
bool edm::Hash< I >::operator!= ( Hash< I > const &  other) const
inline

Definition at line 182 of file Hash.h.

References edm::Hash< I >::compareUsing().

182  {
183  return this->compareUsing(other, std::not_equal_to<std::string>());
184  }
bool compareUsing(Hash< I > const &iOther, Op op) const
Definition: Hash.h:94
template<int I>
bool edm::Hash< I >::operator< ( Hash< I > const &  other) const
inline

Definition at line 161 of file Hash.h.

References edm::Hash< I >::compareUsing().

161  {
162  return this->compareUsing(other, std::less<std::string>());
163  }
bool compareUsing(Hash< I > const &iOther, Op op) const
Definition: Hash.h:94
template<int I>
Hash< I > & edm::Hash< I >::operator= ( Hash< I > const &  iRHS)
inline

Definition at line 138 of file Hash.h.

References edm::hash_detail::fixup_(), and edm::Hash< I >::hash_.

138  {
139  hash_ = iRHS.hash_;
141  return *this;
142  }
value_type hash_
Definition: Hash.h:109
void fixup_(value_type &hash)
Definition: Hash.cc:32
template<int I>
Hash<I>& edm::Hash< I >::operator= ( Hash< I > &&  )
default
template<int I>
bool edm::Hash< I >::operator== ( Hash< I > const &  other) const
inline

Definition at line 175 of file Hash.h.

References edm::Hash< I >::compareUsing().

175  {
176  return this->compareUsing(other, std::equal_to<std::string>());
177  }
bool compareUsing(Hash< I > const &iOther, Op op) const
Definition: Hash.h:94
template<int I>
bool edm::Hash< I >::operator> ( Hash< I > const &  other) const
inline

Definition at line 168 of file Hash.h.

References edm::Hash< I >::compareUsing().

168  {
169  return this->compareUsing(other, std::greater<std::string>());
170  }
bool compareUsing(Hash< I > const &iOther, Op op) const
Definition: Hash.h:94
template<int I>
std::ostream & edm::Hash< I >::print ( std::ostream &  os) const
inline

Definition at line 189 of file Hash.h.

References edm::Hash< I >::hash_, and edm::hash_detail::print_().

189  {
190  return hash_detail::print_(os, hash_);
191  }
value_type hash_
Definition: Hash.h:109
std::ostream & print_(std::ostream &os, value_type const &hash)
Definition: Hash.cc:106
template<int I>
void edm::Hash< I >::reset ( void  )
inline

Definition at line 147 of file Hash.h.

References edm::Hash< I >::hash_, and edm::detail::InvalidHash().

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

147  {
149  }
value_type hash_
Definition: Hash.h:109
std::string const & InvalidHash()
Definition: Hash.cc:11
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 224 of file Hash.h.

References edm::Hash< I >::hash_, and edm::hash_detail::smallHash_().

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

224  {
226  }
value_type hash_
Definition: Hash.h:109
size_t smallHash_(value_type const &hash)
Definition: Hash.cc:57
template<int I>
void edm::Hash< I >::swap ( Hash< I > &  other)
inline
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.

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

Definition at line 203 of file Hash.h.

References edm::Hash< I >::hash_, and edm::hash_detail::toDigest_().

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

203  {
204  hash_detail::toDigest_(digest, hash_);
205  }
value_type hash_
Definition: Hash.h:109
void toDigest_(cms::Digest &digest, value_type const &hash)
Definition: Hash.cc:96
template<int I>
void edm::Hash< I >::toString ( std::string &  result) const
inline

Definition at line 196 of file Hash.h.

References edm::Hash< I >::hash_, and edm::hash_detail::toString_().

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

196  {
198  }
value_type hash_
Definition: Hash.h:109
void toString_(std::string &result, value_type const &hash)
Definition: Hash.cc:87

Member Data Documentation

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