CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

edm::Hash< I > Class Template Reference

#include <Hash.h>

List of all members.

Public Types

typedef hash_detail::value_type value_type

Public Member Functions

value_type compactForm () const
 Hash (value_type const &v)
 Hash ()
 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.

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_.

                                     : hash_(iOther.hash_) {
     hash_detail::fixup_(hash_);
  }

Member Function Documentation

template<int I>
Hash< I >::value_type edm::Hash< I >::compactForm ( ) const [inline]
template<int I>
template<typename Op >
bool edm::Hash< I >::compareUsing ( Hash< I > const &  iOther,
Op  op 
) const [inline, private]

Definition at line 76 of file Hash.h.

                                                       {
        bool meCF = hash_detail::isCompactForm_(hash_);
        bool otherCF = hash_detail::isCompactForm_(iOther.hash_);
        if(meCF == otherCF) {
          return op(this->hash_,iOther.hash_);
        }
        //copy constructor will do compact form conversion
        if(meCF) {
           Hash<I> temp(iOther);
           return op(this->hash_,temp.hash_);
        } 
        Hash<I> temp(*this);
        return op(temp.hash_,iOther.hash_);
      }
template<int I>
bool edm::Hash< I >::isCompactForm ( ) const [inline]

Definition at line 201 of file Hash.h.

References edm::hash_detail::isCompactForm_().

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.

                                                {
    return this->compareUsing(other, std::not_equal_to<std::string>());
  }
template<int I>
bool edm::Hash< I >::operator< ( Hash< I > const &  other) const [inline]

Definition at line 143 of file Hash.h.

                                               {
    return this->compareUsing(other, std::less<std::string>());
  }
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_.

                                        {
    hash_ = iRHS.hash_;
    hash_detail::fixup_(hash_);
    return *this;
  }
template<int I>
bool edm::Hash< I >::operator== ( Hash< I > const &  other) const [inline]

Definition at line 157 of file Hash.h.

                                                {
    return this->compareUsing(other, std::equal_to<std::string>());
  }
template<int I>
bool edm::Hash< I >::operator> ( Hash< I > const &  other) const [inline]

Definition at line 150 of file Hash.h.

                                               {
    return this->compareUsing(other, std::greater<std::string>());
  }
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_().

                                     {
    return hash_detail::print_(os, hash_);
  }
template<int I>
void edm::Hash< I >::reset ( void  ) [inline]

Definition at line 129 of file Hash.h.

References edm::detail::InvalidHash().

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]

Member Data Documentation

template<int I>
value_type edm::Hash< I >::hash_ [private]