Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooTrace.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooTrace.h,v 1.16 2007/05/11 09:11:30 verkerke Exp $
5 * Authors: *
6 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8 * *
9 * Copyright (c) 2000-2005, Regents of the University of California *
10 * and Stanford University. All rights reserved. *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
14 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15 *****************************************************************************/
16#ifndef ROO_TRACE
17#define ROO_TRACE
18
19#include "RooLinkedList.h"
20#include <map>
21#include <string>
22
23#define TRACE_CREATE
24#define TRACE_DESTROY
25
26class RooTrace {
27public:
28 RooTrace() ;
29 virtual ~RooTrace() {} ;
30
31 static void create(const TObject* obj) ;
32 static void destroy(const TObject* obj) ;
33
34
35 static void createSpecial(const char* name, int size) ;
36 static void destroySpecial(const char* name) ;
37
38
39 static void active(bool flag) ;
40 static void verbose(bool flag) ;
41
42 static void dump() ;
43 static void dump(std::ostream& os, bool sinceMarked=false) ;
44 static void mark() ;
45
46 static void callgrind_zero() ;
47 static void callgrind_dump() ;
48
49
50 static RooTrace& instance() ;
51
52 static void printObjectCounts() ;
53
54
55protected:
56
58
59 void dump3(std::ostream&, bool sinceMarked) ;
60
61 void mark3() ;
62 void printObjectCounts3() ;
63
64 void create2(const TObject* obj) ;
65 void destroy2(const TObject* obj) ;
66
67 void create3(const TObject* obj) ;
68 void destroy3(const TObject* obj) ;
69
70 void createSpecial3(const char* name, int size) ;
71 void destroySpecial3(const char* name) ;
72
73 void addPad(const TObject* ref, bool doPad) ;
74 bool removePad(const TObject* ref) ;
75
76 bool _active ;
77 bool _verbose ;
80 std::map<TClass*,int> _objectCount ;
81 std::map<std::string,int> _specialCount ;
82 std::map<std::string,int> _specialSize ;
83
84 ClassDef(RooTrace,0) // Memory tracer utility for RooFit objects
85};
86
87
88#endif
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
#define ClassDef(name, id)
Definition Rtypes.h:337
char name[80]
Definition TGX11.cxx:110
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
Controls the memory tracing hooks in all RooFit objects.
Definition RooTrace.h:26
static void destroySpecial(const char *name)
Definition RooTrace.cxx:159
static void dump()
Dump contents of object registry to stdout.
Definition RooTrace.cxx:283
std::map< TClass *, int > _objectCount
Definition RooTrace.h:80
static void verbose(bool flag)
If flag is true, a message will be printed at each object creation or deletion.
Definition RooTrace.cxx:199
static RooTrace * _instance
Definition RooTrace.h:57
bool _active
Definition RooTrace.h:76
bool _verbose
Definition RooTrace.h:77
static void callgrind_zero()
Utility function to trigger zeroing of callgrind counters.
Definition RooTrace.cxx:354
std::map< std::string, int > _specialSize
Definition RooTrace.h:82
static void printObjectCounts()
Definition RooTrace.cxx:320
static void createSpecial(const char *name, int size)
Definition RooTrace.cxx:148
static void destroy(const TObject *obj)
Register deletion of object 'obj'.
Definition RooTrace.cxx:137
static RooTrace & instance()
Definition RooTrace.cxx:106
static void mark()
Put marker in object list, that allows to dump contents of list relative to this marker.
Definition RooTrace.cxx:262
bool removePad(const TObject *ref)
void mark3()
Put marker in object list, that allows to dump contents of list relative to this marker.
Definition RooTrace.cxx:273
void create2(const TObject *obj)
Back end function of create(), register creation of object 'obj'.
Definition RooTrace.cxx:211
void dump3(std::ostream &, bool sinceMarked)
Dump contents of object register to stream 'os'.
Definition RooTrace.cxx:301
virtual ~RooTrace()
Definition RooTrace.h:29
std::map< std::string, int > _specialCount
Definition RooTrace.h:81
void create3(const TObject *obj)
Definition RooTrace.cxx:239
void destroySpecial3(const char *name)
Definition RooTrace.cxx:179
static void create(const TObject *obj)
Register creation of object 'obj'.
Definition RooTrace.cxx:124
static void active(bool flag)
If flag is true, memory tracing is activated.
Definition RooTrace.cxx:189
void printObjectCounts3()
Definition RooTrace.cxx:327
RooLinkedList _markList
Definition RooTrace.h:79
void destroy2(const TObject *obj)
Back end function of destroy(), register deletion of object 'obj'.
Definition RooTrace.cxx:226
static void callgrind_dump()
Utility function to trigger dumping of callgrind counters.
Definition RooTrace.cxx:366
void addPad(const TObject *ref, bool doPad)
void destroy3(const TObject *obj)
Back end function of destroy(), register deletion of object 'obj'.
Definition RooTrace.cxx:251
void createSpecial3(const char *name, int size)
Definition RooTrace.cxx:170
RooLinkedList _list
Definition RooTrace.h:78
Mother of all ROOT objects.
Definition TObject.h:41