1#ifndef NNGN_TIMING_STATS_H
2#define NNGN_TIMING_STATS_H
14template<
typename CRTP, std::
size_t N>
17 static constexpr std::size_t
size(
void);
23 static constexpr std::size_t
MAX = 2;
24 static std::array<pointer_flag<void>,
MAX>
v;
25 static std::size_t
check(std::size_t
i);
27 static void reserve(std::size_t
i,
void *p);
32 template<
typename T>
static auto *
u64_data(
void);
35template<
typename CRTP, std::
size_t N>
37 return CRTP::names.size() * N_EVENTS;
40template<
typename CRTP, std::
size_t N>
42 constexpr auto n = CRTP::size();
43 static_assert(
n ==
sizeof(CRTP) /
sizeof(
u64));
44 using T =
const std::array<u64, n>*;
45 return reinterpret_cast<T>(
static_cast<const CRTP&
>(*this).to_u64());
48template<
typename CRTP, std::
size_t N>
50 auto &ret = *
static_cast<const StatsBase*
>(
this)->to_u64_array();
51 return &
const_cast<std::decay_t<decltype(ret)
>&>(ret);
68 using S =
typename T::Stats;
69 constexpr auto I = T::STATS_IDX;
static constexpr std::size_t MAX
Definition stats.h:23
static bool active(std::size_t i)
Definition stats.h:29
static void * data(std::size_t i)
Definition stats.h:31
static std::size_t check(std::size_t i)
Definition stats.h:54
static void release(std::size_t i)
Definition stats.h:28
static std::array< pointer_flag< void >, MAX > v
Definition stats.h:24
static auto * u64_data(void)
Definition stats.h:67
static void reserve(std::size_t i, void *p)
Definition stats.h:60
static void set_active(std::size_t i, bool a)
Definition stats.h:30
Definition pointer_flag.h:9
assert
Definition debug.lua:3
for i
Definition font.lua:5
local n
Definition dump_lights.lua:5
local N
Definition gamma.lua:5
std::uint64_t u64
Definition def.h:15
get
Definition camera.lua:46
static constexpr auto N_EVENTS
Definition stats.h:16
auto * to_u64_array(void)
Definition stats.h:49
auto * to_u64_array(void) const
Definition stats.h:41
static constexpr std::size_t size(void)
Definition stats.h:36
#define S(v0, v1)
Definition vec2.h:16