1//
2// Checksum.cpp
3//
4// Library: Foundation
5// Package: Core
6// Module: Checksum
7//
8// Copyright (c) 2007, Applied Informatics Software Engineering GmbH.
9// and Contributors.
10//
11// SPDX-License-Identifier: BSL-1.0
12//
13
14
15#include "Poco/Checksum.h"
16#include "Poco/Checksum32.h"
17#include "Poco/Checksum64.h"
18
19
20namespace Poco {
21
22
23Checksum::Checksum(): _pImpl(new Checksum32)
24{
25}
26
27
28Checksum::Checksum(Type t) :
29 _pImpl(t == TYPE_CRC64 ?
30 (ChecksumImpl*)new Checksum64() :
31 (ChecksumImpl*)new Checksum32(static_cast<ChecksumImpl::Type>(t)))
32{
33}
34
35
36Checksum::~Checksum()
37{
38 delete _pImpl;
39}
40
41
42} // namespace Poco
43