comparison base/Debug.h @ 871:0b15c9328003 tonioni

Debug out operator for real time
author Chris Cannam
date Thu, 09 Jan 2014 21:43:33 +0000
parents e802e550a1f2
children 16dc7307d43a
comparison
equal deleted inserted replaced
870:284851a784fa 871:0b15c9328003
17 #define _DEBUG_H_ 17 #define _DEBUG_H_
18 18
19 #include <QDebug> 19 #include <QDebug>
20 #include <QTextStream> 20 #include <QTextStream>
21 21
22 #include <vamp-hostsdk/RealTime.h>
23
22 #include <string> 24 #include <string>
23 #include <iostream> 25 #include <iostream>
24 26
25 class QString; 27 class QString;
26 class QUrl; 28 class QUrl;
36 #ifndef NDEBUG 38 #ifndef NDEBUG
37 39
38 extern QDebug &getSVDebug(); 40 extern QDebug &getSVDebug();
39 41
40 #define SVDEBUG getSVDebug() 42 #define SVDEBUG getSVDebug()
43
44 inline QDebug &operator<<(QDebug &d, const Vamp::RealTime &rt) {
45 d << rt.toString();
46 return d;
47 }
41 48
42 template <typename T> 49 template <typename T>
43 inline QDebug &operator<<(QDebug &d, const T &t) { 50 inline QDebug &operator<<(QDebug &d, const T &t) {
44 QString s; 51 QString s;
45 QTextStream ts(&s); 52 QTextStream ts(&s);