Files
plotter/include/plot/data/detail/cover_count.hpp
T
Martino Ferrari ed3a8ce645 licence: MIT LICENSE and SPDX identifiers in every first-party file
The repository had no licence at all, so every source was all-rights-reserved
by default. Add the verbatim MIT text at LICENSE (Copyright (c) 2026 Martino
Ferrari) and a two-line SPDX header to each of the 113 first-party sources --
48 include/plot, 26 src, 10 adapters, 5 examples, 21 tests, 3 tools -- so the
grant travels with each file rather than relying on the root document alone.

Scripts keep their shebang on line 1; the SPDX lines follow it. Genuinely
vendored code is untouched: third_party/stb_truetype.h carries no header of
ours. src/render/embedded_mono_font.cpp is generated, so tools/fonts/gen_atlas.py
emit() now writes the two lines into its header comment and the file was
regenerated -- gen_atlas.py --check passes and the regeneration adds only those
comment lines to the previously committed file.

README's provenance section now states MIT and links LICENSE.

No code, test or public API change.
2026-09-28 22:13:40 +02:00

33 lines
1.0 KiB
C++

// SPDX-License-Identifier: MIT
// SPDX-FileCopyrightText: 2026 Martino Ferrari
#pragma once
#ifdef PLOT_PYRAMID_COUNT_COVERS
#include <atomic>
#include <plot/core/types.hpp>
namespace plot::data::detail {
/// Test-only instrumentation. Counts the pyramid entries the covering
/// decomposition has emitted since the counter was last reset.
///
/// The decomposition's *cost* is invisible in every answer -- a decomposition
/// that walks the range one level-0 bucket at a time returns exactly the same
/// min/max/sum as the O(log n) one -- so a test that wants to pin "at most two
/// entries per level" has to count entries. The counter exists only when
/// PLOT_PYRAMID_COUNT_COVERS is defined (the test build defines it), so every
/// normal build carries no counter and no increment on the query path.
///
/// Not part of the query surface and not meant for production use.
inline std::atomic<u64>& cover_entry_count() {
static std::atomic<u64> count{0};
return count;
}
} // namespace plot::data::detail
#endif // PLOT_PYRAMID_COUNT_COVERS