Xonotic
stats.qh File Reference
#include "registry.qh"
#include "sort.qh"
+ Include dependency graph for stats.qh:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define EVAL_REGISTER_STAT(...)   __VA_ARGS__
 
#define MAGIC_STATS(_, x)
 
#define MAGIC_STATS_FIX(it)
 
#define MAGIC_STATS_FIX_AUTO(it, var, id)   if (it.m_id == id) { ++g_magic_stats_hole; ++it.m_id; }
 
#define MAGIC_STATS_FIX_MANUAL(it, var, id)   if (it.registered_id == "STAT_" #var) { --g_magic_stats_hole; it.m_id = id; } else
 
#define REGISTER_STAT(...)   EVAL_REGISTER_STAT(OVERLOAD(REGISTER_STAT, __VA_ARGS__))
 
#define REGISTER_STAT_2(id, type)
 
#define REGISTER_STAT_3(id, T, expr)
 

Typedefs

using vectori = vector
 

Functions

 STATIC_INIT (Stats_renumber)
 

Variables

int g_magic_stats_hole = 0
 
int m_id
 
const int STATS_ENGINE_RESERVE = 32
 

Macro Definition Documentation

◆ EVAL_REGISTER_STAT

#define EVAL_REGISTER_STAT (   ...)    __VA_ARGS__

Definition at line 65 of file stats.qh.

◆ MAGIC_STATS

#define MAGIC_STATS (   _,
 
)

Definition at line 13 of file stats.qh.

◆ MAGIC_STATS_FIX

#define MAGIC_STATS_FIX (   it)
Value:
it.m_id += g_magic_stats_hole; \
#define MAGIC_STATS_FIX_AUTO(it, var, id)
Definition: stats.qh:57
#define MAGIC_STATS_FIX_MANUAL(it, var, id)
Definition: stats.qh:54
int g_magic_stats_hole
Definition: stats.qh:52
#define MAGIC_STATS(_, x)
Definition: stats.qh:13

Definition at line 60 of file stats.qh.

Referenced by STATIC_INIT().

◆ MAGIC_STATS_FIX_AUTO

#define MAGIC_STATS_FIX_AUTO (   it,
  var,
  id 
)    if (it.m_id == id) { ++g_magic_stats_hole; ++it.m_id; }

Definition at line 57 of file stats.qh.

◆ MAGIC_STATS_FIX_MANUAL

#define MAGIC_STATS_FIX_MANUAL (   it,
  var,
  id 
)    if (it.registered_id == "STAT_" #var) { --g_magic_stats_hole; it.m_id = id; } else

Definition at line 54 of file stats.qh.

◆ REGISTER_STAT

#define REGISTER_STAT (   ...)    EVAL_REGISTER_STAT(OVERLOAD(REGISTER_STAT, __VA_ARGS__))

Definition at line 64 of file stats.qh.

◆ REGISTER_STAT_2

#define REGISTER_STAT_2 (   id,
  type 
)

Definition at line 163 of file stats.qh.

◆ REGISTER_STAT_3

#define REGISTER_STAT_3 (   id,
  T,
  expr 
)

Definition at line 164 of file stats.qh.

Typedef Documentation

◆ vectori

using vectori = vector

Definition at line 9 of file stats.qh.

Function Documentation

◆ STATIC_INIT()

STATIC_INIT ( Stats_renumber  )

Definition at line 173 of file stats.qh.

References FOREACH, MAGIC_STATS_FIX, and STATS_ENGINE_RESERVE.

174 {
175  FOREACH(Stats, true, {
176  it.m_id = STATS_ENGINE_RESERVE + i;
177  MAGIC_STATS_FIX(it);
178  });
179 }
#define MAGIC_STATS_FIX(it)
Definition: stats.qh:60
const int STATS_ENGINE_RESERVE
Definition: stats.qh:11
#define FOREACH(list, cond, body)
Definition: iter.qh:19

Variable Documentation

◆ g_magic_stats_hole

int g_magic_stats_hole = 0

Definition at line 52 of file stats.qh.

◆ m_id

int m_id

Definition at line 8 of file stats.qh.

◆ STATS_ENGINE_RESERVE

const int STATS_ENGINE_RESERVE = 32

Definition at line 11 of file stats.qh.

Referenced by STATIC_INIT().