The Battle for Wesnoth  1.15.0+dev
Classes | Public Member Functions | Public Attributes | List of all members
tracer Struct Reference

Helper structure for gathering the tracing statistics. More...

#include <tracer.hpp>

Classes

struct  printer
 Helper structure to print the tracing statistics. More...
 

Public Member Functions

 tracer (const tracer &)=delete
 
traceroperator= (const tracer &)=delete
 
 tracer (const char *const function__)
 

Public Attributes

int run
 The total number of runs. More...
 
const char *const function
 The function being traced. More...
 
std::map< std::pair< int, std::string >, int > counters
 The tracer counters. More...
 

Detailed Description

Helper structure for gathering the tracing statistics.

Definition at line 26 of file tracer.hpp.

Constructor & Destructor Documentation

◆ tracer() [1/2]

tracer::tracer ( const tracer )
delete

◆ tracer() [2/2]

tracer::tracer ( const char *const  function__)
explicit

Definition at line 57 of file tracer.cpp.

Member Function Documentation

◆ operator=()

tracer& tracer::operator= ( const tracer )
delete

Member Data Documentation

◆ counters

std::map<std::pair<int, std::string>, int> tracer::counters

The tracer counters.

The first pair contains a line number and a name of the marker. This has two advantages:

  • A line number is always unique, thus if using markers with the same name, they are not the same marker.
  • The markers are sorted in order of appearance and not in order of their names.

The second pair contains the number of times a marker is hit.

Definition at line 72 of file tracer.hpp.

Referenced by tracer::printer::~printer().

◆ function

const char* const tracer::function

The function being traced.

Definition at line 58 of file tracer.hpp.

Referenced by tracer::printer::~printer().

◆ run

int tracer::run

The total number of runs.

Definition at line 55 of file tracer.hpp.

Referenced by tracer::printer::~printer().


The documentation for this struct was generated from the following files: