CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Typedefs | Functions
DataFormats_MuonReco::dictionary::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)
 
size_t smallHash_ (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

Definition at line 30 of file classes.h.

Function Documentation

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

Definition at line 19 of file Hash.cc.

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

Referenced by edm::Hash< I >::compactForm(), and edm::hash_detail::smallHash_().

19  {
20  if (isCompactForm_(hash)) {
21  return hash;
22  }
24  fixup_(temp);
25  return temp;
26  }
Container::value_type value_type
bool isCompactForm_(value_type const &hash)
Definition: Hash.cc:67
void DataFormats_MuonReco::dictionary::edm::hash_detail::fixup_ ( value_type &  hash)

Definition at line 32 of file Hash.cc.

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

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

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

Definition at line 72 of file Hash.cc.

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

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

72  {
73  return isCompactForm_(hash) ? (hash != detail::InvalidHash()) : (!hash.empty());
74  }
bool isCompactForm_(value_type const &hash)
Definition: Hash.cc:67
std::ostream& DataFormats_MuonReco::dictionary::edm::hash_detail::print_ ( std::ostream &  os,
value_type const &  hash 
)

Definition at line 106 of file Hash.cc.

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

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

106  {
107  value_type temp1(hash);
108  fixup_(temp1);
110  copy_all(temp1, temp.bytes);
111  os << temp.toString();
112  return os;
113  }
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
size_t DataFormats_MuonReco::dictionary::edm::hash_detail::smallHash_ ( value_type const &  hash)

Definition at line 57 of file Hash.cc.

References edm::hash_detail::compactForm_(), and h.

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

57  {
58  //NOTE: In future we could try to xor the first 8bytes into the second 8bytes of the string to make the hash
59  std::hash<std::string> h;
60  if (hash.size()==16) {
61  return h(hash);
62  }
63  return h(compactForm_(hash));
64  }
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
value_type compactForm_(value_type const &hash)
Definition: Hash.cc:19
void DataFormats_MuonReco::dictionary::edm::hash_detail::throwIfIllFormed ( value_type const &  hash)

Definition at line 77 of file Hash.cc.

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

77  {
78  // Fixup not needed here.
79  if (hash.size() % 2 == 1) {
81  << "Ill-formed Hash instance. "
82  << "Please report this to the core framework developers";
83  }
84  }
void DataFormats_MuonReco::dictionary::edm::hash_detail::toDigest_ ( cms::Digest digest,
value_type const &  hash 
)

Definition at line 96 of file Hash.cc.

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

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

96  {
97  // FIXME: do we really need to go through a temporary value_type???
98  value_type temp1(hash);
99  fixup_(temp1);
101  copy_all(temp1, temp.bytes);
102  digest.append(temp.toString());
103  }
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 DataFormats_MuonReco::dictionary::edm::hash_detail::toString_ ( std::string &  result,
value_type const &  hash 
)

Definition at line 87 of file Hash.cc.

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

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

87  {
88  value_type temp1(hash);
89  fixup_(temp1);
91  copy_all(temp1, temp.bytes);
92  result += temp.toString();
93  }
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