OpenVDB  11.0.0
Public Member Functions | Static Public Attributes | List of all members
GridChecksum 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/util/GridChecksum.h>

Public Member Functions

 GridChecksum ()
 default constructor initiates checksum to EMPTY More...
 
 GridChecksum (uint32_t head, uint32_t tail)
 Constructor that allows the two 32bit checksums to be initiated explicitly. More...
 
 GridChecksum (uint64_t checksum, ChecksumMode mode=ChecksumMode::Full)
 
uint64_t checksum () const
 return the 64 bit checksum of this instance More...
 
uint32_t & checksum (int i)
 return 32 bit (crc32) checksum of this instance More...
 
uint32_t checksum (int i) const
 return 32 bit (crc32) checksum of this instance More...
 
bool isPartial () const
 return true if the 64 bit checksum is partial, i.e. of head only More...
 
bool isFull () const
 return true if the 64 bit checksum is fill, i.e. of both had and nodes More...
 
bool isEmpty () const
 return true if the 64 bit checksum is disables (unset) More...
 
ChecksumMode mode () const
 return the mode of the 64 bit checksum More...
 
ChecksumMode operator() (const GridData &gridData, ChecksumMode mode=ChecksumMode::Full)
 compute checksum of gridData using a 4KB blocked approach More...
 
bool operator== (const GridChecksum &rhs) const
 return true if the checksums are identical More...
 
bool operator!= (const GridChecksum &rhs) const
 return true if the checksums are not identical More...
 

Static Public Attributes

static constexpr uint64_t EMPTY = ~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

GridChecksum ( )
inline

default constructor initiates checksum to EMPTY

GridChecksum ( 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
GridChecksum ( uint64_t  checksum,
ChecksumMode  mode = ChecksumMode::Full 
)
inline
Parameters
checksum
mode

Member Function Documentation

uint64_t checksum ( ) const
inline

return the 64 bit checksum of this instance

uint32_t& checksum ( int  i)
inline

return 32 bit (crc32) checksum of this instance

Parameters
iindex of value 0 or 1 indicated the 32 bit checksum of the head or nodes
Returns
non-const reference of the i'th 32bit checksum
uint32_t checksum ( int  i) const
inline

return 32 bit (crc32) checksum of this instance

Parameters
iindex of value 0 or 1 indicated the 32 bit checksum of the head or nodes
Returns
copy of the i'th 32bit checksum
bool isEmpty ( ) const
inline

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

bool isFull ( ) const
inline

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

bool isPartial ( ) const
inline

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

ChecksumMode mode ( ) const
inline

return the mode of the 64 bit checksum

bool operator!= ( const GridChecksum rhs) const
inline

return true if the checksums are not identical

Parameters
rhsother GridChecksum
ChecksumMode operator() ( const GridData gridData,
ChecksumMode  mode = ChecksumMode::Full 
)
inline

compute checksum of gridData using a 4KB blocked approach

Parameters
gridDataReference to GridData
modeMode of the checksum computation
bool operator== ( const GridChecksum rhs) const
inline

return true if the checksums are identical

Parameters
rhsother GridChecksum

Member Data Documentation

constexpr uint64_t EMPTY = ~uint64_t(0)
static
uint64_t mChecksum
uint32_t mCRC[2]