The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Macros
tracer.hpp File Reference

Contains code for tracing the code. More...

#include <boost/noncopyable.hpp>
#include <map>
#include <string>
Include dependency graph for tracer.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ttracer
 Helper structure for gathering the tracing statistics. More...
 
struct  ttracer::tprint
 Helper structure to print the tracing statistics. More...
 

Macros

#define TRACER_ENTRY(interval)
 The beginning of a traced scope. More...
 
#define TRACER_COUNT(marker)
 A trace count point. More...
 

Detailed Description

Contains code for tracing the code.

Definition in file tracer.hpp.

Macro Definition Documentation

#define TRACER_COUNT (   marker)
Value:
do { \
++tracer.counters[std::make_pair(__LINE__, marker)]; \
} while(0)

A trace count point.

When this macro is reached the counter for this marker is increased.

Parameters
markerA string with the name of the marker.

Definition at line 99 of file tracer.hpp.

#define TRACER_ENTRY (   interval)
Value:
static ttracer tracer(__FUNCTION__); \
ttracer::tprint print((++tracer.run % interval) == 0 ? &tracer : nullptr)
Helper structure for gathering the tracing statistics.
Definition: tracer.hpp:29
static void print(std::stringstream &sstr, const std::string &queue, const std::string &id)
Definition: fire_event.cpp:29

The beginning of a traced scope.

It is not intended that tracer scopes are nested, but it should work at the moment.

Parameters
intervalThe interval between printing the statistics.

Definition at line 87 of file tracer.hpp.