mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
unit_test/preamble/preamble_fixture.h -> common/fixtures unit_test/source_level_debugger -> common/ unit_test/utilities/base_object_utils.h -> common/utilities unit_test/utilities/destructor_counted.h -> common/utilities unit_test/utilities/logger_tests.h -> common/utilities Related-To: NEO-6524 Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
27 lines
614 B
C++
27 lines
614 B
C++
/*
|
|
* Copyright (C) 2018-2022 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
namespace NEO {
|
|
|
|
template <typename BaseType, uint32_t ordinal>
|
|
struct DestructorCounted : public BaseType {
|
|
template <typename... Args>
|
|
DestructorCounted(uint32_t &destructorId, Args &&...args) : BaseType(std::forward<Args>(args)...),
|
|
destructorId(destructorId) {}
|
|
|
|
~DestructorCounted() override {
|
|
EXPECT_EQ(ordinal, destructorId);
|
|
destructorId++;
|
|
}
|
|
|
|
private:
|
|
uint32_t &destructorId;
|
|
};
|
|
} // namespace NEO
|