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 | 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 > const & 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 toString (std::string &result) const
 

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 36 of file Hash.h.

Member Typedef Documentation

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

Definition at line 38 of file Hash.h.

Constructor & Destructor Documentation

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

Definition at line 103 of file Hash.h.

value_type hash_
Definition: Hash.h:91
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 113 of file Hash.h.

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

113  : hash_(iOther.hash_) {
115  }
value_type hash_
Definition: Hash.h:91
void fixup_(value_type &hash)
Definition: Hash.cc:30

Member Function Documentation

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

Definition at line 192 of file Hash.h.

References edm::hash_detail::compactForm_().

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

192  {
194  }
value_type hash_
Definition: Hash.h:91
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 76 of file Hash.h.

76  {
78  bool otherCF = hash_detail::isCompactForm_(iOther.hash_);
79  if(meCF == otherCF) {
80  return op(this->hash_,iOther.hash_);
81  }
82  //copy constructor will do compact form conversion
83  if(meCF) {
84  Hash<I> temp(iOther);
85  return op(this->hash_,temp.hash_);
86  }
87  Hash<I> temp(*this);
88  return op(temp.hash_,iOther.hash_);
89  }
value_type hash_
Definition: Hash.h:91
bool isCompactForm_(value_type const &hash)
Definition: Hash.cc:55
template<int I>
bool edm::Hash< I >::isCompactForm ( ) const
inline

Definition at line 201 of file Hash.h.

References edm::hash_detail::isCompactForm_().

201  {
203  }
value_type hash_
Definition: Hash.h:91
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 164 of file Hash.h.

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

Definition at line 143 of file Hash.h.

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

Definition at line 120 of file Hash.h.

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

120  {
121  hash_ = iRHS.hash_;
123  return *this;
124  }
value_type hash_
Definition: Hash.h:91
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 157 of file Hash.h.

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

Definition at line 150 of file Hash.h.

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

Definition at line 171 of file Hash.h.

References edm::hash_detail::print_().

171  {
172  return hash_detail::print_(os, hash_);
173  }
value_type hash_
Definition: Hash.h:91
std::ostream & print_(std::ostream &os, value_type const &hash)
Definition: Hash.cc:84
template<int I>
void edm::Hash< I >::reset ( void  )
inline

Definition at line 129 of file Hash.h.

References edm::detail::InvalidHash().

129  {
131  }
value_type hash_
Definition: Hash.h:91
std::string const & InvalidHash()
Definition: Hash.cc:9
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 >::toString ( std::string &  result) const
inline

Definition at line 178 of file Hash.h.

References edm::hash_detail::toString_().

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

178  {
180  }
value_type hash_
Definition: Hash.h:91
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