18#if NEBULA_ENABLE_PROFILING
19#define _declare_counter(counter) Ptr<Debug::DebugCounter> counter;
20#define _setup_counter(counter) counter = Debug::DebugCounter::Create(); counter->Setup(Util::StringAtom(#counter));
21#define _setup_grouped_counter(counter, group) counter = Debug::DebugCounter::Create(); counter->Setup(Util::StringAtom(#counter), group);
22#define _discard_counter(counter) counter->Discard(); counter = nullptr;
23#define _begin_counter(counter) counter->Begin();
24#define _begin_counter_noreset(counter) counter->Begin(false);
25#define _reset_counter(counter) counter->Reset();
26#define _incr_counter(counter, val) counter->Incr(val);
27#define _decr_counter(counter, val) counter->Decr(val);
28#define _set_counter(counter, val) counter->Set(val);
29#define _end_counter(counter) counter->End();
31#define _declare_counter(counter)
32#define _setup_counter(counter)
33#define _setup_grouped_counter(counter, group)
34#define _discard_counter(counter)
35#define _begin_counter(counter)
36#define _begin_counter_noreset()
37#define _reset_counter(counter)
38#define _incr_counter(counter, val)
39#define _decr_counter(counter, val)
40#define _set_counter(counter, val)
41#define _end_counter(counter)
63 void Begin(
bool reset=
true);
67 void Incr(
int amount);
69 void Decr(
int amount);
128 this->
value += amount;
137 this->
value -= amount;
The common base class of Nebula.
Definition refcounted.h:38
A debug counter for counting events.
Definition debugcounter.h:47
DebugCounter()
constructor
Definition debugcounter.cc:19
void End()
end counting, write current value to history
Definition debugcounter.h:153
void Decr(int amount)
decrement the counter by a specific value
Definition debugcounter.h:135
void Incr(int amount)
increment the counter by a specific value
Definition debugcounter.h:126
void Reset()
manually reset the counter to zero
Definition debugcounter.h:117
__DeclareClass(DebugCounter)
void Setup(const Util::StringAtom &name, const Util::StringAtom &group=Util::StringAtom("Ungrouped"))
setup the counter
Definition debugcounter.cc:41
Threading::CriticalSection critSect
Definition debugcounter.h:85
void Discard()
discard the counter
Definition debugcounter.cc:60
Util::Array< int > GetHistory() const
get the counter's history
Definition debugcounter.cc:92
void Set(int val)
set the counter directly
Definition debugcounter.h:144
virtual ~DebugCounter()
destructor
Definition debugcounter.cc:29
Util::RingBuffer< int > history
Definition debugcounter.h:89
bool IsValid() const
return true if object has been setup
Definition debugcounter.h:96
void Begin(bool reset=true)
begin counting, optionally reset the counter
Definition debugcounter.h:105
Util::StringAtom name
Definition debugcounter.h:86
const Util::StringAtom & GetGroup() const
get the timer group
Definition debugcounter.h:173
Util::StringAtom group
Definition debugcounter.h:87
const Util::StringAtom & GetName() const
get the counter's name
Definition debugcounter.h:164
int value
Definition debugcounter.h:88
int GetSample() const
get the most recent sample
Definition debugcounter.cc:76
Critical section objects are used to protect a portion of code from parallel execution.
Nebula's dynamic array class.
Definition array.h:60
A ring buffer stores up to a maximum number of elements in a circular fashion.
Definition ringbuffer.h:21
void Add(const TYPE &elm)
add an element to the ring buffer
Definition ringbuffer.h:316
A StringAtom.
Definition stringatom.h:22
bool IsValid() const
return true if valid (contains a non-empty string)
Definition stringatom.h:353
Definition corepagehandler.cc:13