CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 &)
 
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)
 
bool operator== (Hash< I > const &other) const
 
bool operator> (Hash< I > const &other) const
 
std::ostream & print (std::ostream &os) const
 
void reset ()
 
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 41 of file Hash.h.

Member Typedef Documentation

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

Definition at line 43 of file Hash.h.

Constructor & Destructor Documentation

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

Definition at line 113 of file Hash.h.

value_type hash_
Definition: Hash.h:101
std::string const & InvalidHash()
Definition: Hash.cc:9
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 123 of file Hash.h.

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

123  : hash_(iOther.hash_) {
125  }
value_type hash_
Definition: Hash.h:101
void fixup_(value_type &hash)
Definition: Hash.cc:30

Member Function Documentation

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

Definition at line 76 of file Hash.h.

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

Definition at line 209 of file Hash.h.

References edm::hash_detail::compactForm_().

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

209  {
211  }
value_type hash_
Definition: Hash.h:101
value_type compactForm_(value_type const &hash)
Definition: Hash.cc:17
template<int I>
template<typename Op >
bool edm::Hash< I >::compareUsing ( Hash< I > const &  iOther,
Op  op 
) const
inlineprivate

Definition at line 86 of file Hash.h.

86  {
88  bool otherCF = hash_detail::isCompactForm_(iOther.hash_);
89  if(meCF == otherCF) {
90  return op(this->hash_,iOther.hash_);
91  }
92  //copy constructor will do compact form conversion
93  if(meCF) {
94  Hash<I> temp(iOther);
95  return op(this->hash_,temp.hash_);
96  }
97  Hash<I> temp(*this);
98  return op(temp.hash_,iOther.hash_);
99  }
value_type hash_
Definition: Hash.h:101
bool isCompactForm_(value_type const &hash)
Definition: Hash.cc:55
template<int I>
bool edm::Hash< I >::isCompactForm ( ) const
inline

Definition at line 218 of file Hash.h.

References edm::hash_detail::isCompactForm_().

218  {
220  }
value_type hash_
Definition: Hash.h:101
bool isCompactForm_(value_type const &hash)
Definition: Hash.cc:55
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 174 of file Hash.h.

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

Definition at line 153 of file Hash.h.

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

Definition at line 130 of file Hash.h.

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

130  {
131  hash_ = iRHS.hash_;
133  return *this;
134  }
value_type hash_
Definition: Hash.h:101
void fixup_(value_type &hash)
Definition: Hash.cc:30
template<int I>
bool edm::Hash< I >::operator== ( Hash< I > const &  other) const
inline

Definition at line 167 of file Hash.h.

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

Definition at line 160 of file Hash.h.

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

Definition at line 181 of file Hash.h.

References edm::hash_detail::print_().

181  {
182  return hash_detail::print_(os, hash_);
183  }
value_type hash_
Definition: Hash.h:101
std::ostream & print_(std::ostream &os, value_type const &hash)
Definition: Hash.cc:94
template<int I>
void edm::Hash< I >::reset ( void  )
inline
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 195 of file Hash.h.

References edm::hash_detail::toDigest_().

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

195  {
196  hash_detail::toDigest_(digest, hash_);
197  }
value_type hash_
Definition: Hash.h:101
void toDigest_(cms::Digest &digest, value_type const &hash)
Definition: Hash.cc:84
template<int I>
void edm::Hash< I >::toString ( std::string &  result) const
inline

Definition at line 188 of file Hash.h.

References edm::hash_detail::toString_().

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

188  {
190  }
value_type hash_
Definition: Hash.h:101
void toString_(std::string &result, value_type const &hash)
Definition: Hash.cc:75
tuple result
Definition: query.py:137

Member Data Documentation

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