CMS 3D CMS Logo

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 toString_ (std::string &result, value_type const &hash)

Typedef Documentation

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

Definition at line 25 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 cond::rpcobtemp::temp.

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

                                         {
      if (isCompactForm_(hash)) {
        return hash;
      }
      value_type temp(hash);
      fixup_(temp);
      return temp;
    }
void edm::hash_detail::fixup_ ( value_type &  hash)

Definition at line 30 of file Hash.cc.

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

Referenced by compactForm_(), edm::Hash< I >::Hash(), edm::Hash< I >::operator=(), print_(), edm::OwnVector< T, P >::swap(), edm::Vector< T >::swap(), and toString_().

                             {
      switch (hash.size()) {
        case 16: {
          break;
        }
        case 32: {
          cms::MD5Result temp;
          temp.fromHexifiedString(hash);
          hash = temp.compactForm();
          break;
        }
        case 0: {
          throw Exception(errors::LogicError)
            << "Empty edm::Hash<> instance:\n" << "\nPlease report this to the core framework developers";
        }       
        default: {
          throw Exception(errors::LogicError)
            << "edm::Hash<> instance with data in illegal state:\n"
            << hash
            << "\nPlease report this to the core framework developers";
        }
      }
    }
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_().

                                           {
      return 16 == hash.size();
    }
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().

                                     {
      return isCompactForm_(hash) ? (hash != detail::InvalidHash()) : (!hash.empty());
    }
std::ostream & edm::hash_detail::print_ ( std::ostream &  os,
value_type const &  hash 
)
void edm::hash_detail::throwIfIllFormed ( value_type const &  hash)

Definition at line 65 of file Hash.cc.

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

                                             {
      // Fixup not needed here.
      if (hash.size() % 2 == 1) {
        throw Exception(errors::LogicError)
          << "Ill-formed Hash instance. "
          << "Please report this to the core framework developers";
      }
    }
void edm::hash_detail::toString_ ( std::string &  result,
value_type const &  hash 
)