class CrcCordState

Defined at line 41 of file ../../third_party/abseil-cpp/absl/crc/internal/crc_cord_state.h

CrcCordState is a copy-on-write class that holds the chunked CRC32C data

that allows CrcCord to perform efficient substring operations. CrcCordState

is used as a member variable in CrcCord. When a CrcCord is converted to a

Cord, the CrcCordState is shallow-copied into the root node of the Cord. If

the converted Cord is modified outside of CrcCord, the CrcCordState is

discarded from the Cord. If the Cord is converted back to a CrcCord, and the

Cord is still carrying the CrcCordState in its root node, the CrcCord can

re-use the CrcCordState, making the construction of the CrcCord cheap.

CrcCordState does not try to encapsulate the CRC32C state (CrcCord requires

knowledge of how CrcCordState represents the CRC32C state). It does

encapsulate the copy-on-write nature of the state.

Public Methods

void CrcCordState ()

Constructors.

void CrcCordState (const CrcCordState & )
void CrcCordState (CrcCordState && )
void ~CrcCordState ()

Destructor. Atomically unreferences the data.

CrcCordState & operator= (const CrcCordState & )

Copy and move operators.

CrcCordState & operator= (CrcCordState && )
absl::crc32c_t Checksum ()

Returns the CRC32C of the entire Cord.

const Rep & rep ()

Returns a reference to the representation of the chunked CRC32C data.

Defined at line 90 of file ../../third_party/abseil-cpp/absl/crc/internal/crc_cord_state.h

Rep * mutable_rep ()

Returns a mutable reference to the representation of the chunked CRC32C

data. Calling this function will copy the data if another instance also

holds a reference to the data, so it is important to call rep() instead if

the data may not be mutated.

Defined at line 96 of file ../../third_party/abseil-cpp/absl/crc/internal/crc_cord_state.h

bool IsNormalized ()

Returns true if the chunked CRC32C cached is normalized.

Defined at line 110 of file ../../third_party/abseil-cpp/absl/crc/internal/crc_cord_state.h

void Normalize ()

Normalizes the chunked CRC32C checksum cache by subtracting any removed

prefix from the chunks.

PrefixCrc NormalizedPrefixCrcAtNthChunk (size_t n)

Helper that returns the (length, crc) of the `n`-th cached chunked.

size_t NumChunks ()

Returns the number of cached chunks.

Defined at line 117 of file ../../third_party/abseil-cpp/absl/crc/internal/crc_cord_state.h

void Poison ()

Poisons all chunks to so that Checksum() will likely be incorrect with high

probability.

Records