ad_map_access
include
ad
map
serialize
ChecksumCRC32.hpp
Go to the documentation of this file.
1
// ----------------- BEGIN LICENSE BLOCK ---------------------------------
2
//
3
// Copyright (C) 2018-2021 Intel Corporation
4
//
5
// SPDX-License-Identifier: MIT
6
//
7
// ----------------- END LICENSE BLOCK -----------------------------------
12
#pragma once
13
14
#include <cstdint>
15
16
#include "
ad/map/serialize/IChecksum.hpp
"
17
#include "
ad/map/serialize/IStorage.hpp
"
18
20
namespace
ad
{
22
namespace
map {
24
namespace
serialize {
25
29
uint32_t
calculateCRC32Checksum
(
const
void
*x,
size_t
bytes);
30
34
class
ChecksumCRC32
:
virtual
public
IChecksum
,
virtual
public
IStorage
35
{
36
protected
:
// Constructor/Destructor
37
ChecksumCRC32
();
38
virtual
~
ChecksumCRC32
();
39
40
public
:
// Overriden IChecksum
41
const
char
*getChecksumType()
override
42
{
43
return
"CRC-32"
;
44
}
45
46
protected
:
// Overriden IChecksum
47
void
initChecksum()
override
;
48
void
updateChecksum(
const
void
*x,
size_t
bytes)
override
;
49
bool
writeChecksum()
override
;
50
bool
checksumOK()
override
;
51
52
private
:
53
uint32_t mCrc;
54
};
55
56
}
// namespace serialize
57
}
// namespace map
58
}
// namespace ad
ad
namespace ad
Definition:
GeometryStoreItem.hpp:28
ad::map::serialize::IStorage
Storage Interface.
Definition:
IStorage.hpp:26
ad::map::serialize::IChecksum
Interface for Checksum.
Definition:
IChecksum.hpp:28
IChecksum.hpp
ad::map::serialize::ChecksumCRC32
Checksum CRC32 calculation implementation.
Definition:
ChecksumCRC32.hpp:34
ad::map::serialize::calculateCRC32Checksum
uint32_t calculateCRC32Checksum(const void *x, size_t bytes)
Standalone checksum CRC32 calculation.
IStorage.hpp
Generated by
1.8.17