CYCLUS
Public Member Functions | Public Attributes | List of all members
cyclus::Digest Class Reference

Detailed Description

The digest type for SHA1s.

This class is a hack around a language deficiency in C++. You cannot pass around an array (unsinged int[5]) between function calls. You can only pass pointers, which would involve lost of new/free and heap shenanigans that are not needed for a dumb container. Therefore Sha1::Digest() cannot return what would be most natural. The second most natural thing would be a std::array<unsigned int, 5>. However, std::array is a C++11 feature and we are not yet ready to go down that road.

To pass an array into and out of a function it has to be inside of struct or a class. I chose a class here since there are many member functions.

The reason why this is public is that it needs to be directly writable from buffers coming from HDF5. In the future, this really should just be a std::array.

Definition at line 558 of file query_backend.h.

#include <query_backend.h>

Public Member Functions

template<typename T >
std::vector< T > cast () const
 
bool operator!= (const cyclus::Digest &rhs) const
 
bool operator< (const cyclus::Digest &rhs) const
 
std::ostream & operator<< (std::ostream &out) const
 
bool operator<= (const cyclus::Digest &rhs) const
 
bool operator== (const cyclus::Digest &rhs) const
 
bool operator> (const cyclus::Digest &rhs) const
 
bool operator>= (const cyclus::Digest &rhs) const
 

Public Attributes

unsigned int val [CYCLUS_SHA1_NINT]
 

Member Function Documentation

template<typename T >
std::vector<T> cyclus::Digest::cast ( ) const
inline

Casts the value of this digest to a vector of the templated type.

Definition at line 564 of file query_backend.h.

bool cyclus::Digest::operator!= ( const cyclus::Digest rhs) const
inline

Definition at line 614 of file query_backend.h.

bool cyclus::Digest::operator< ( const cyclus::Digest rhs) const
inline

Definition at line 577 of file query_backend.h.

std::ostream& cyclus::Digest::operator<< ( std::ostream &  out) const
inline

Definition at line 572 of file query_backend.h.

bool cyclus::Digest::operator<= ( const cyclus::Digest rhs) const
inline

Definition at line 595 of file query_backend.h.

bool cyclus::Digest::operator== ( const cyclus::Digest rhs) const
inline

Definition at line 603 of file query_backend.h.

bool cyclus::Digest::operator> ( const cyclus::Digest rhs) const
inline

Definition at line 591 of file query_backend.h.

bool cyclus::Digest::operator>= ( const cyclus::Digest rhs) const
inline

Definition at line 599 of file query_backend.h.

Member Data Documentation

unsigned int cyclus::Digest::val[CYCLUS_SHA1_NINT]

Definition at line 560 of file query_backend.h.


The documentation for this class was generated from the following file: