CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Typedefs | Functions
edm::hash_detail Namespace Reference

Typedefs

typedef std::string value_type
 

Functions

value_type compactForm_ (value_type const &hash)
 
void fixup_ (value_type &hash)
 
bool isCompactForm_ (value_type const &hash)
 
bool isValid_ (value_type const &hash)
 
std::ostream & print_ (std::ostream &os, value_type const &hash)
 
void throwIfIllFormed (value_type const &hash)
 
void toDigest_ (cms::Digest &digest, value_type const &hash)
 
void toString_ (std::string &result, value_type const &hash)
 

Typedef Documentation

typedef std::string edm::hash_detail::value_type

Definition at line 29 of file Hash.h.

Function Documentation

value_type edm::hash_detail::compactForm_ ( value_type const &  hash)

Definition at line 17 of file Hash.cc.

References fixup_(), cond::hash, isCompactForm_(), and groupFilesInBlocks::temp.

Referenced by edm::Hash< I >::compactForm().

17  {
18  if (isCompactForm_(hash)) {
19  return hash;
20  }
22  fixup_(temp);
23  return temp;
24  }
bool isCompactForm_(value_type const &hash)
Definition: Hash.cc:55
void fixup_(value_type &hash)
Definition: Hash.cc:30
Container::value_type value_type
void edm::hash_detail::fixup_ ( value_type &  hash)

Definition at line 30 of file Hash.cc.

References cms::MD5Result::compactForm(), edm::hlt::Exception, cms::MD5Result::fromHexifiedString(), edm::errors::LogicError, and groupFilesInBlocks::temp.

Referenced by compactForm_(), edm::Hash< I >::Hash(), edm::Hash< I >::operator=(), print_(), toDigest_(), and toString_().

30  {
31  switch (hash.size()) {
32  case 16: {
33  break;
34  }
35  case 32: {
38  hash = temp.compactForm();
39  break;
40  }
41  case 0: {
43  << "Empty edm::Hash<> instance:\n" << "\nPlease report this to the core framework developers";
44  }
45  default: {
47  << "edm::Hash<> instance with data in illegal state:\n"
48  << hash
49  << "\nPlease report this to the core framework developers";
50  }
51  }
52  }
void fromHexifiedString(std::string const &s)
Definition: Digest.cc:111
std::string compactForm() const
Definition: Digest.cc:102
bool edm::hash_detail::isCompactForm_ ( value_type const &  hash)

Definition at line 55 of file Hash.cc.

Referenced by compactForm_(), edm::Hash< EntryDescriptionType >::compareUsing(), edm::Hash< I >::isCompactForm(), and isValid_().

55  {
56  return 16 == hash.size();
57  }
bool edm::hash_detail::isValid_ ( value_type const &  hash)

Definition at line 60 of file Hash.cc.

References edm::detail::InvalidHash(), and isCompactForm_().

Referenced by edm::Hash< I >::isValid().

60  {
61  return isCompactForm_(hash) ? (hash != detail::InvalidHash()) : (!hash.empty());
62  }
bool isCompactForm_(value_type const &hash)
Definition: Hash.cc:55
std::string const & InvalidHash()
Definition: Hash.cc:9
std::ostream & edm::hash_detail::print_ ( std::ostream &  os,
value_type const &  hash 
)

Definition at line 94 of file Hash.cc.

References cms::MD5Result::bytes, edm::copy_all(), fixup_(), groupFilesInBlocks::temp, and cms::MD5Result::toString().

Referenced by EcalTPGAnalyzer::analyze(), EcalTPGAnalyzer::EcalTPGAnalyzer(), and edm::Hash< I >::print().

94  {
95  value_type temp1(hash);
96  fixup_(temp1);
98  copy_all(temp1, temp.bytes);
99  os << temp.toString();
100  return os;
101  }
void fixup_(value_type &hash)
Definition: Hash.cc:30
unsigned char bytes[16]
Definition: Digest.h:21
Container::value_type value_type
std::string toString() const
Definition: Digest.cc:87
Func copy_all(ForwardSequence &s, Func f)
wrappers for copy
Definition: Algorithms.h:24
void edm::hash_detail::throwIfIllFormed ( value_type const &  hash)

Definition at line 65 of file Hash.cc.

References edm::hlt::Exception, and edm::errors::LogicError.

65  {
66  // Fixup not needed here.
67  if (hash.size() % 2 == 1) {
69  << "Ill-formed Hash instance. "
70  << "Please report this to the core framework developers";
71  }
72  }
void edm::hash_detail::toDigest_ ( cms::Digest digest,
value_type const &  hash 
)

Definition at line 84 of file Hash.cc.

References cms::Digest::append(), cms::MD5Result::bytes, edm::copy_all(), fixup_(), groupFilesInBlocks::temp, and cms::MD5Result::toString().

Referenced by edm::Hash< I >::toDigest().

84  {
85  // FIXME: do we really need to go through a temporary value_type???
86  value_type temp1(hash);
87  fixup_(temp1);
89  copy_all(temp1, temp.bytes);
90  digest.append(temp.toString());
91  }
void fixup_(value_type &hash)
Definition: Hash.cc:30
unsigned char bytes[16]
Definition: Digest.h:21
Container::value_type value_type
std::string toString() const
Definition: Digest.cc:87
Func copy_all(ForwardSequence &s, Func f)
wrappers for copy
Definition: Algorithms.h:24
void append(std::string const &s)
Definition: Digest.cc:182
void edm::hash_detail::toString_ ( std::string &  result,
value_type const &  hash 
)

Definition at line 75 of file Hash.cc.

References cms::MD5Result::bytes, edm::copy_all(), fixup_(), groupFilesInBlocks::temp, and cms::MD5Result::toString().

Referenced by edm::Hash< I >::toString().

75  {
76  value_type temp1(hash);
77  fixup_(temp1);
79  copy_all(temp1, temp.bytes);
80  result += temp.toString();
81  }
void fixup_(value_type &hash)
Definition: Hash.cc:30
unsigned char bytes[16]
Definition: Digest.h:21
tuple result
Definition: query.py:137
Container::value_type value_type
std::string toString() const
Definition: Digest.cc:87
Func copy_all(ForwardSequence &s, Func f)
wrappers for copy
Definition: Algorithms.h:24