#include <DataFormats/Provenance/interface/Hash.h>
Public Types | |
typedef std::string | value_type |
Public Member Functions | |
value_type | compactForm () const |
Hash (Hash< I > const &) | |
Hash (value_type const &v) | |
Hash () | |
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 | swap (Hash< I > &other) |
Private Member Functions | |
template<typename Op> | |
bool | compareUsing (Hash< I > const &iOther, Op op) const |
void | fixup () |
void | throwIfIllFormed () const |
Hexified version of data *must* contain a multiple of 2 bytes. | |
Private Attributes | |
value_type | hash_ |
Definition at line 32 of file Hash.h.
typedef std::string edm::Hash< I >::value_type |
edm::Hash< I >::Hash | ( | value_type const & | v | ) | [explicit] |
Hash< I >::value_type edm::Hash< I >::compactForm | ( | ) | const [inline] |
Definition at line 192 of file Hash.h.
References edm::Hash< I >::compactForm(), and edm::Hash< I >::hash_.
Referenced by edm::Hash< I >::compactForm(), and edm::StreamerOutputModuleBase::serializeRegistry().
00193 { 00194 if (this->isCompactForm()) { 00195 return hash_; 00196 } 00197 Hash<I> tMe(*this); 00198 return tMe.compactForm(); 00199 }
bool edm::Hash< I >::compareUsing | ( | Hash< I > const & | iOther, | |
Op | op | |||
) | const [inline, private] |
Definition at line 74 of file Hash.h.
References edm::Hash< I >::hash_, and edm::Hash< I >::isCompactForm().
Referenced by edm::Hash< I >::operator!=(), edm::Hash< I >::operator<(), edm::Hash< I >::operator==(), and edm::Hash< I >::operator>().
00074 { 00075 if(this->isCompactForm() == iOther.isCompactForm()) { 00076 return op(this->hash_,iOther.hash_); 00077 } 00078 Hash<I> tMe(*this); 00079 Hash<I> tOther(iOther); 00080 return op(tMe.hash_,tOther.hash_); 00081 }
Definition at line 220 of file Hash.h.
References cms::MD5Result::compactForm(), cms::MD5Result::fromHexifiedString(), edm::Hash< I >::hash_, edm::detail::InvalidHash(), edm::errors::LogicError, and pyDBSRunClass::temp.
Referenced by edm::Hash< I >::Hash(), edm::Hash< I >::operator=(), and edm::Hash< I >::swap().
00220 { 00221 switch (hash_.size()) { 00222 case 0: 00223 { 00224 hash_ = edm::detail::InvalidHash(); 00225 } 00226 case 16: 00227 { 00228 break; 00229 } 00230 case 32: 00231 { 00232 cms::MD5Result temp; 00233 temp.fromHexifiedString(hash_); 00234 hash_ = temp.compactForm(); 00235 break; 00236 } 00237 default: 00238 { 00239 throw edm::Exception(edm::errors::LogicError) 00240 << "edm::Hash<> instance with data in illegal state:\n" 00241 << hash_ 00242 << "\nPlease report this to the core framework developers"; 00243 } 00244 } 00245 }
Definition at line 249 of file Hash.h.
References edm::Hash< I >::hash_.
Referenced by edm::Hash< I >::compareUsing(), and edm::Hash< I >::isValid().
00249 { 00250 return 16 == hash_.size(); 00251 }
Definition at line 130 of file Hash.h.
References edm::Hash< I >::hash_, edm::detail::InvalidHash(), and edm::Hash< I >::isCompactForm().
Referenced by edm::ParameterSet::id(), edm::Principal::Principal(), and edm::BranchDescription::throwIfInvalid_().
00131 { 00132 return isCompactForm() ? (hash_ != edm::detail::InvalidHash()) : (hash_.size()!=0); 00133 }
Definition at line 162 of file Hash.h.
References edm::Hash< I >::compareUsing().
00163 { 00164 return this->compareUsing(other, std::not_equal_to<std::string >()); 00165 }
Definition at line 138 of file Hash.h.
References edm::Hash< I >::compareUsing().
00139 { 00140 return this->compareUsing(other, std::less<std::string >()); 00141 }
Definition at line 120 of file Hash.h.
References edm::Hash< I >::fixup(), and edm::Hash< I >::hash_.
Definition at line 154 of file Hash.h.
References edm::Hash< I >::compareUsing().
00155 { 00156 return this->compareUsing(other, std::equal_to<std::string >()); 00157 }
Definition at line 146 of file Hash.h.
References edm::Hash< I >::compareUsing().
00147 { 00148 return this->compareUsing(other, std::greater<std::string >()); 00149 }
std::ostream & edm::Hash< I >::print | ( | std::ostream & | os | ) | const [inline] |
Definition at line 170 of file Hash.h.
References cms::MD5Result::bytes, edm::copy_all(), edm::Hash< I >::hash_, pyDBSRunClass::temp, and cms::MD5Result::toString().
00171 { 00172 Hash<I> tMe(*this); 00173 cms::MD5Result temp; 00174 copy_all(tMe.hash_, temp.bytes); 00175 os << temp.toString(); 00176 return os; 00177 }
Definition at line 182 of file Hash.h.
References edm::Hash< I >::fixup(), and edm::Hash< I >::hash_.
Referenced by edm::ProcessHistory::id(), edm::swap(), edm::TriggerResults::swap(), and edm::ProcessHistory::swap().
Hexified version of data *must* contain a multiple of 2 bytes.
If it does not, throw an exception.
Definition at line 204 of file Hash.h.
References edm::Hash< I >::hash_, and edm::errors::LogicError.
00205 { 00206 // Fixup not needed here. 00207 if (hash_.size() % 2 == 1) 00208 { 00209 throw edm::Exception(edm::errors::LogicError) 00210 << "Ill-formed Hash instance. " 00211 << "Please report this to the core framework developers"; 00212 } 00213 }
value_type edm::Hash< I >::hash_ [private] |
Definition at line 83 of file Hash.h.
Referenced by edm::Hash< I >::compactForm(), edm::Hash< I >::compareUsing(), edm::Hash< I >::fixup(), edm::Hash< I >::isCompactForm(), edm::Hash< I >::isValid(), edm::Hash< I >::operator=(), edm::Hash< I >::print(), edm::Hash< I >::swap(), and edm::Hash< I >::throwIfIllFormed().