OpenVDB  12.0.0
Public Member Functions | Static Public Attributes | List of all members
Checksum Class Reference

Class that encapsulates two CRC32 checksums, one for the Grid, Tree and Root node meta data and one for the remaining grid nodes. More...

#include <nanovdb/NanoVDB.h>

Public Member Functions

__hostdev__ Checksum ()
 default constructor initiates checksum to EMPTY More...
 
__hostdev__ Checksum (uint32_t head, uint32_t tail)
 Constructor that allows the two 32bit checksums to be initiated explicitly. More...
 
__hostdev__ Checksum (uint64_t checksum, CheckMode mode=CheckMode::Full)
 
__hostdev__ uint64_t checksum () const
 return the 64 bit checksum of this instance More...
 
__hostdev__ uint32_t & checksum (int i)
 
__hostdev__ uint32_t checksum (int i) const
 
__hostdev__ uint64_t full () const
 
__hostdev__ uint64_t & full ()
 
__hostdev__ uint32_t head () const
 
__hostdev__ uint32_t & head ()
 
__hostdev__ uint32_t tail () const
 
__hostdev__ uint32_t & tail ()
 
__hostdev__ bool isPartial () const
 return true if the 64 bit checksum is partial, i.e. of head only More...
 
__hostdev__ bool isHalf () const
 
__hostdev__ bool isFull () const
 return true if the 64 bit checksum is fill, i.e. of both had and nodes More...
 
__hostdev__ bool isEmpty () const
 return true if the 64 bit checksum is disables (unset) More...
 
__hostdev__ void disable ()
 
__hostdev__ CheckMode mode () const
 return the mode of the 64 bit checksum More...
 
__hostdev__ bool operator== (const Checksum &rhs) const
 return true if the checksums are identical More...
 
__hostdev__ bool operator!= (const Checksum &rhs) const
 return true if the checksums are not identical More...
 

Static Public Attributes

static constexpr uint32_t EMPTY32 = ~uint32_t{0}
 
static constexpr uint64_t EMPTY64 = ~uint64_t(0)
 

Detailed Description

Class that encapsulates two CRC32 checksums, one for the Grid, Tree and Root node meta data and one for the remaining grid nodes.

Constructor & Destructor Documentation

__hostdev__ Checksum ( )
inline

default constructor initiates checksum to EMPTY

__hostdev__ Checksum ( uint32_t  head,
uint32_t  tail 
)
inline

Constructor that allows the two 32bit checksums to be initiated explicitly.

Parameters
headInitial 32bit CRC checksum of grid, tree and root data
tailInitial 32bit CRC checksum of all the nodes and blind data
__hostdev__ Checksum ( uint64_t  checksum,
CheckMode  mode = CheckMode::Full 
)
inline
Parameters
checksum
mode

Member Function Documentation

__hostdev__ uint64_t checksum ( ) const
inline

return the 64 bit checksum of this instance

__hostdev__ uint32_t& checksum ( int  i)
inline
__hostdev__ uint32_t checksum ( int  i) const
inline
__hostdev__ void disable ( )
inline
__hostdev__ uint64_t full ( ) const
inline
__hostdev__ uint64_t& full ( )
inline
__hostdev__ uint32_t head ( ) const
inline
__hostdev__ uint32_t& head ( )
inline
__hostdev__ bool isEmpty ( ) const
inline

return true if the 64 bit checksum is disables (unset)

__hostdev__ bool isFull ( ) const
inline

return true if the 64 bit checksum is fill, i.e. of both had and nodes

__hostdev__ bool isHalf ( ) const
inline
__hostdev__ bool isPartial ( ) const
inline

return true if the 64 bit checksum is partial, i.e. of head only

__hostdev__ CheckMode mode ( ) const
inline

return the mode of the 64 bit checksum

__hostdev__ bool operator!= ( const Checksum rhs) const
inline

return true if the checksums are not identical

Parameters
rhsother Checksum
__hostdev__ bool operator== ( const Checksum rhs) const
inline

return true if the checksums are identical

Parameters
rhsother Checksum
__hostdev__ uint32_t tail ( ) const
inline
__hostdev__ uint32_t& tail ( )
inline

Member Data Documentation

constexpr uint32_t EMPTY32 = ~uint32_t{0}
static
constexpr uint64_t EMPTY64 = ~uint64_t(0)
static
uint32_t mCRC32[2]
uint64_t mCRC64