OpenVDB 11.0.0
Loading...
Searching...
No Matches
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
 
 GridChecksum (uint32_t head, uint32_t tail)
 Constructor that allows the two 32bit checksums to be initiated explicitly.
 
 GridChecksum (uint64_t checksum, ChecksumMode mode=ChecksumMode::Full)
 
uint64_t checksum () const
 return the 64 bit checksum of this instance
 
uint32_t & checksum (int i)
 return 32 bit (crc32) checksum of this instance
 
uint32_t checksum (int i) const
 return 32 bit (crc32) checksum of this instance
 
bool isPartial () const
 return true if the 64 bit checksum is partial, i.e. of head only
 
bool isFull () const
 return true if the 64 bit checksum is fill, i.e. of both had and nodes
 
bool isEmpty () const
 return true if the 64 bit checksum is disables (unset)
 
ChecksumMode mode () const
 return the mode of the 64 bit checksum
 
ChecksumMode operator() (const GridData &gridData, ChecksumMode mode=ChecksumMode::Full)
 compute checksum of gridData using a 4KB blocked approach
 
bool operator== (const GridChecksum &rhs) const
 return true if the checksums are identical
 
bool operator!= (const GridChecksum &rhs) const
 return true if the checksums are not identical
 

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() [1/3]

GridChecksum ( )
inline

default constructor initiates checksum to EMPTY

◆ GridChecksum() [2/3]

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() [3/3]

GridChecksum ( uint64_t checksum,
ChecksumMode mode = ChecksumMode::Full )
inline
Parameters
checksum
mode

Member Function Documentation

◆ checksum() [1/3]

uint64_t checksum ( ) const
inline

return the 64 bit checksum of this instance

◆ checksum() [2/3]

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

◆ checksum() [3/3]

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

◆ isEmpty()

bool isEmpty ( ) const
inline

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

◆ isFull()

bool isFull ( ) const
inline

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

◆ isPartial()

bool isPartial ( ) const
inline

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

◆ mode()

ChecksumMode mode ( ) const
inline

return the mode of the 64 bit checksum

◆ operator!=()

bool operator!= ( const GridChecksum & rhs) const
inline

return true if the checksums are not identical

Parameters
rhsother GridChecksum

◆ operator()()

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

◆ operator==()

bool operator== ( const GridChecksum & rhs) const
inline

return true if the checksums are identical

Parameters
rhsother GridChecksum

Member Data Documentation

◆ EMPTY

constexpr uint64_t EMPTY = ~uint64_t(0)
staticconstexpr

◆ mChecksum

uint64_t mChecksum

◆ mCRC

uint32_t mCRC[2]