Initial revision
[ardour.git] / libs / cassowary / cassowary / debug.h
1 // $Id$
2 //
3 // Cassowary Incremental Constraint Solver
4 // Original Smalltalk Implementation by Alan Borning
5 // This C++ Implementation by Greg J. Badros, <gjb@cs.washington.edu>
6 // http://www.cs.washington.edu/homes/gjb
7 // (C) 1998, 1999 Greg J. Badros and Alan Borning
8 // See ../LICENSE for legal details regarding this software
9 //
10 // debug.h
11
12 #ifndef CASSOWARY_DEBUG_H_
13 #define CASSOWARY_DEBUG_H_
14
15 #if defined(HAVE_CONFIG_H) && !defined(CONFIG_H_INCLUDED) && !defined(CONFIG_INLINE_H_INCLUDED)
16 #include <cassowary/config-inline.h>
17 #define CONFIG_INLINE_H_INCLUDED
18 #endif
19
20 #include <vector>
21 #include "Cassowary.h"
22
23 #ifdef CL_TRACE
24 class Tracer {
25  public:
26   Tracer(const char *const sz) : sz_(sz) { cerr << "* " << sz; }
27   ~Tracer() { cerr << "x " << sz_ << " exited." << endl; }
28  private:
29   const char *const sz_;
30 };
31
32 inline void CtrTracer(const char *const sz, const void *pv) 
33 { cerr << "@+ " << sz << " ctrnew@ " << pv << endl; }
34
35 inline void DtrTracer(const char *const sz, const void *pv)
36 { cerr << "@- " << sz << " dtrnew@ " << pv << endl; }
37
38 #else
39 class Tracer {
40  public:
41   Tracer(const char *const) { }
42 };
43
44 inline void CtrTracer(const char *const, const void *) { }
45 inline void DtrTracer(const char *const, const void *) { }
46 #endif // CL_TRACE  
47
48 #endif