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 647 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

◆ cast()

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 653 of file query_backend.h.

◆ operator!=()

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

Definition at line 703 of file query_backend.h.

◆ operator<()

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

Definition at line 666 of file query_backend.h.

◆ operator<<()

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

Definition at line 661 of file query_backend.h.

◆ operator<=()

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

Definition at line 684 of file query_backend.h.

◆ operator==()

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

Definition at line 692 of file query_backend.h.

◆ operator>()

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

Definition at line 680 of file query_backend.h.

◆ operator>=()

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

Definition at line 688 of file query_backend.h.

Member Data Documentation

◆ val

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

Definition at line 649 of file query_backend.h.


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