ATLAS Offline Software
Loading...
Searching...
No Matches
VP1Msg Class Reference

#include <VP1Msg.h>

Inheritance diagram for VP1Msg:
Collaboration diagram for VP1Msg:

Static Public Member Functions

static bool verbose ()
static bool debug ()
static void enableMsg (const QString &)
static void message (const QString &, IVP1System *sys=0)
static void messageDebug (const QString &)
static void messageWarning (const QString &, IVP1System *sys=0)
static void messageVerbose (const QString &)
static void messageWarningRed (const QString &str, IVP1System *sys=0)
static void messageWarningAllRed (const QString &str, IVP1System *sys=0)
static void message (const QStringList &, const QString &addtoend="", IVP1System *sys=0)
static void messageDebug (const QStringList &, const QString &addtoend="")
static void messageVerbose (const QStringList &, const QString &addtoend="")
static void message (const QString &addtostart, const QStringList &, const QString &addtoend="", IVP1System *sys=0)
static void messageDebug (const QString &addtostart, const QStringList &, const QString &addtoend="")
static void messageVerbose (const QString &addtostart, const QStringList &, const QString &addtoend="")
static const char * prefix_msg ()
static const char * prefix_debug ()
static const char * prefix_warning ()
static const char * prefix_verbose ()
static QString str (const QString &s)
static QString str (const char *c)
static QString str (const bool b)
static QString str (const QColor &)
static QString str (const SbColor &)
static QString str (const VP1Interval &)
static QString str (const SbVec2d &)
static QString str (const SbVec2f &)
static QString str (const SbVec2s &)
static QString str (const SbVec3d &)
static QString str (const SbVec3f &)
static QString str (const SbVec3s &)
static QString str (const SbVec4d &)
static QString str (const SbVec4f &)
static QString str (short int n)
static QString str (unsigned short int n)
static QString str (long n)
static QString str (ulong n)
static QString str (int n)
static QString str (uint n)
static QString str (qlonglong n)
static QString str (qulonglong n)
static QString str (const double &d)
static QString str (const float &f)
static QString str (const void *)
template<class T>
static QString str (const T *t)
template<class T>
static QString str (const QFlags< T > &f)
template<class T>
static QString str (const HepGeom::BasicVector3D< T > &t)
static QString str (const Amg::Vector3D &t)
template<class T>
static QString str (const QList< T > &t)

Private Member Functions

 VP1Msg ()
 ~VP1Msg ()

Static Private Attributes

static std::atomic< bool > m_verbose = VP1QtUtils::environmentVariableIsOn("VP1_VERBOSE_OUTPUT")
static std::atomic< bool > m_debug = VP1QtUtils::environmentVariableIsOn("VP1_DEBUG_OUTPUT")

Detailed Description

Definition at line 29 of file VP1Msg.h.

Constructor & Destructor Documentation

◆ VP1Msg()

VP1Msg::VP1Msg ( )
inlineprivate

Definition at line 62 of file VP1Msg.h.

62{}

◆ ~VP1Msg()

VP1Msg::~VP1Msg ( )
inlineprivate

Definition at line 63 of file VP1Msg.h.

63{}

Member Function Documentation

◆ debug()

bool VP1Msg::debug ( )
inlinestatic

Definition at line 32 of file VP1Msg.h.

32{ return m_debug; } // Returns true if env var VP1_DEBUG_OUTPUT=1
static std::atomic< bool > m_debug
Definition VP1Msg.h:65

◆ enableMsg()

void VP1Msg::enableMsg ( const QString & name)
static

Definition at line 198 of file VP1Msg.cxx.

198 {
199 if( name == "VP1_VERBOSE_OUTPUT"){
201 } else {
203 }
204}
static std::atomic< bool > m_verbose
Definition VP1Msg.h:64
static bool environmentVariableIsSet(const QString &name)

◆ message() [1/3]

void VP1Msg::message ( const QString & str,
IVP1System * sys = 0 )
static

Definition at line 30 of file VP1Msg.cxx.

31{
32 if (sys)
33 sys->message(str);
34 else
35 std::cout << prefix_msg() << ": "<< str.toStdString()<<std::endl;
36}
static const char * prefix_msg()
Definition VP1Msg.h:56
static QString str(const QString &s)
Definition VP1String.h:49

◆ message() [2/3]

void VP1Msg::message ( const QString & addtostart,
const QStringList & l,
const QString & addtoend = "",
IVP1System * sys = 0 )
static

Definition at line 135 of file VP1Msg.cxx.

137{
138 if (addtostart.isEmpty()) {
139 message(l,addtoend,sys);
140 return;
141 }
142 if (addtoend.isEmpty()) {
143 for (const QString& s : l)
144 message(addtostart+s,sys);
145 } else {
146 for (const QString& s : l)
147 message(addtostart+s+addtoend,sys);
148 }
149}
static void message(const QString &, IVP1System *sys=0)
Definition VP1Msg.cxx:30

◆ message() [3/3]

void VP1Msg::message ( const QStringList & l,
const QString & addtoend = "",
IVP1System * sys = 0 )
static

Definition at line 93 of file VP1Msg.cxx.

94{
95 if (addtoend.isEmpty()) {
96 for (const QString& s : l)
97 message(s,sys);
98 } else {
99 for (const QString& s : l)
100 message(s+addtoend,sys);
101 }
102}

◆ messageDebug() [1/3]

void VP1Msg::messageDebug ( const QString & str)
static

Definition at line 39 of file VP1Msg.cxx.

40{
41 if (!debug()){
42 return;
43 }
44 std::cout << prefix_debug() << ": "<< str.toStdString()<<std::endl;
45}
static bool debug()
Definition VP1Msg.h:32
static const char * prefix_debug()
Definition VP1Msg.h:57

◆ messageDebug() [2/3]

void VP1Msg::messageDebug ( const QString & addtostart,
const QStringList & l,
const QString & addtoend = "" )
static

Definition at line 152 of file VP1Msg.cxx.

153{
154 if (!debug()){
155 return;
156 }
157 if (addtostart.isEmpty()) {
158 messageDebug(l,addtoend);
159 return;
160 }
161 if (addtoend.isEmpty()) {
162 for (const QString& s : l)
163 messageDebug(addtostart+s);
164 } else {
165 for (const QString& s : l)
166 messageDebug(addtostart+s+addtoend);
167 }
168}
static void messageDebug(const QString &)
Definition VP1Msg.cxx:39

◆ messageDebug() [3/3]

void VP1Msg::messageDebug ( const QStringList & l,
const QString & addtoend = "" )
static

Definition at line 105 of file VP1Msg.cxx.

106{
107 if (!debug()){
108 return;
109 }
110 if (addtoend.isEmpty()) {
111 for (const QString& s : l)
112 messageDebug(s);
113 } else {
114 for (const QString& s : l)
115 messageDebug(s+addtoend);
116 }
117}

◆ messageVerbose() [1/3]

void VP1Msg::messageVerbose ( const QString & str)
static

Definition at line 84 of file VP1Msg.cxx.

85{
86 if (!verbose()){
87 return;
88 }
89 std::cout<<prefix_verbose()<<": "<<str.toStdString()<<std::endl;
90}
static bool verbose()
Definition VP1Msg.h:31
static const char * prefix_verbose()
Definition VP1Msg.h:59

◆ messageVerbose() [2/3]

void VP1Msg::messageVerbose ( const QString & addtostart,
const QStringList & l,
const QString & addtoend = "" )
static

Definition at line 171 of file VP1Msg.cxx.

172{
173 if (!verbose()){
174 return;
175 }
176 if (addtostart.isEmpty()) {
177 messageVerbose(l,addtoend);
178 return;
179 }
180 if (addtoend.isEmpty()) {
181 for (const QString& s : l)
182 messageVerbose(addtostart+s);
183 } else {
184 for (const QString& s : l)
185 messageVerbose(addtostart+s+addtoend);
186 }
187}
static void messageVerbose(const QString &)
Definition VP1Msg.cxx:84

◆ messageVerbose() [3/3]

void VP1Msg::messageVerbose ( const QStringList & l,
const QString & addtoend = "" )
static

Definition at line 120 of file VP1Msg.cxx.

121{
122 if (!verbose()){
123 return;
124 }
125 if (addtoend.isEmpty()) {
126 for (const QString& s : l)
128 } else {
129 for (const QString& s : l)
130 messageVerbose(s+addtoend);
131 }
132}

◆ messageWarning()

void VP1Msg::messageWarning ( const QString & str,
IVP1System * sys = 0 )
static

Definition at line 48 of file VP1Msg.cxx.

49{
50 if (sys)
51 sys->message(str);
52 std::cout << prefix_warning() << ": "<< str.toStdString()<<std::endl;
53}
static const char * prefix_warning()
Definition VP1Msg.h:58

◆ messageWarningAllRed()

void VP1Msg::messageWarningAllRed ( const QString & str,
IVP1System * sys = 0 )
static

Definition at line 70 of file VP1Msg.cxx.

71{
72 if (sys)
73 sys->message(str);
74
75 // colors, see:
76 // - http://brianmilco.blogspot.ch/2011/11/color-debug-output-with-qt-and-qdebug.html
77 // - http://misc.flogisoft.com/bash/tip_colors_and_formatting
78 std::string msg = str.toStdString();
79 fprintf(stderr, "\033[1m\033[31mWarning:\033[21m %s\033[0m\n", msg.c_str() );
80}
MsgStream & msg
Definition testRead.cxx:32

◆ messageWarningRed()

void VP1Msg::messageWarningRed ( const QString & str,
IVP1System * sys = 0 )
static

Definition at line 57 of file VP1Msg.cxx.

58{
59 if (sys)
60 sys->message(str);
61
62 // colors, see:
63 // - http://brianmilco.blogspot.ch/2011/11/color-debug-output-with-qt-and-qdebug.html
64 // - http://misc.flogisoft.com/bash/tip_colors_and_formatting
65 std::string msg = str.toStdString();
66 fprintf(stderr, "\033[1m\033[31mWarning:\033[21m\033[0m: %s\n", msg.c_str() );
67}

◆ prefix_debug()

const char * VP1Msg::prefix_debug ( )
inlinestatic

Definition at line 57 of file VP1Msg.h.

57{ return "VP1MSG_DEBUG";}

◆ prefix_msg()

const char * VP1Msg::prefix_msg ( )
inlinestatic

Definition at line 56 of file VP1Msg.h.

56{ return "VP1MESSAGE";}

◆ prefix_verbose()

const char * VP1Msg::prefix_verbose ( )
inlinestatic

Definition at line 59 of file VP1Msg.h.

59{ return "VP1MSG_VERBOSE";}

◆ prefix_warning()

const char * VP1Msg::prefix_warning ( )
inlinestatic

Definition at line 58 of file VP1Msg.h.

58{ return "VP1MSG_WARNING";}

◆ str() [1/30]

QString VP1String::str ( const Amg::Vector3D & t)
inlinestaticinherited

Definition at line 98 of file VP1String.h.

98{ return "("+str(t.x())+", "+str(t.y())+", "+str(t.z())+")"; }

◆ str() [2/30]

QString VP1String::str ( const bool b)
inlinestaticinherited

Definition at line 53 of file VP1String.h.

53{ return b?"True":"False"; }

◆ str() [3/30]

QString VP1String::str ( const char * c)
inlinestaticinherited

Definition at line 50 of file VP1String.h.

50{ return c; }

◆ str() [4/30]

QString VP1String::str ( const double & d)
inlinestaticinherited

Definition at line 81 of file VP1String.h.

81{ return QString::number(d); }

◆ str() [5/30]

QString VP1String::str ( const float & f)
inlinestaticinherited

Definition at line 82 of file VP1String.h.

82{ return QString::number(f); }

◆ str() [6/30]

template<class T>
QString VP1String::str ( const HepGeom::BasicVector3D< T > & t)
inlinestaticinherited

Definition at line 95 of file VP1String.h.

95{ return "("+str(t.x())+", "+str(t.y())+", "+str(t.z())+")"; }

◆ str() [7/30]

QString VP1String::str ( const QColor & c)
staticinherited

Definition at line 30 of file VP1String.cxx.

31{
32 return c.isValid() ? c.name() : "Invalid";
33}

◆ str() [8/30]

template<class T>
QString VP1String::str ( const QFlags< T > & f)
inlinestaticinherited

Definition at line 91 of file VP1String.h.

91{ return "0x"+QString::number(f, 16).toUpper().rightJustified(8,'0'); }

◆ str() [9/30]

template<class T>
QString VP1String::str ( const QList< T > & t)
inlinestaticinherited

Definition at line 102 of file VP1String.h.

102{ return "QList of size"+QString::number(t.size()); }

◆ str() [10/30]

QString VP1String::str ( const QString & s)
inlinestaticinherited

Definition at line 49 of file VP1String.h.

49{ return s; }

◆ str() [11/30]

QString VP1String::str ( const SbColor & c)
staticinherited

Definition at line 36 of file VP1String.cxx.

37{
39}
static QColor sbcol2qcol(const SbColor &)

◆ str() [12/30]

QString VP1String::str ( const SbVec2d & v)
staticinherited

Definition at line 61 of file VP1String.cxx.

61{ double x,y; v.getValue(x,y); return "("+str(x)+", "+str(y)+")"; }
#define y
#define x

◆ str() [13/30]

QString VP1String::str ( const SbVec2f & v)
staticinherited

Definition at line 62 of file VP1String.cxx.

62{ float x,y; v.getValue(x,y); return "("+str(x)+", "+str(y)+")"; }

◆ str() [14/30]

QString VP1String::str ( const SbVec2s & v)
staticinherited

Definition at line 63 of file VP1String.cxx.

63{ short x,y; v.getValue(x,y); return "("+str(x)+", "+str(y)+")"; }

◆ str() [15/30]

QString VP1String::str ( const SbVec3d & v)
staticinherited

Definition at line 64 of file VP1String.cxx.

64{ double x,y,z; v.getValue(x,y,z); return "("+str(x)+", "+str(y)+", "+str(z)+")"; }
#define z

◆ str() [16/30]

QString VP1String::str ( const SbVec3f & v)
staticinherited

Definition at line 65 of file VP1String.cxx.

65{ float x,y,z; v.getValue(x,y,z); return "("+str(x)+", "+str(y)+", "+str(z)+")"; }

◆ str() [17/30]

QString VP1String::str ( const SbVec3s & v)
staticinherited

Definition at line 66 of file VP1String.cxx.

66{ short x,y,z; v.getValue(x,y,z); return "("+str(x)+", "+str(y)+", "+str(z)+")"; }

◆ str() [18/30]

QString VP1String::str ( const SbVec4d & v)
staticinherited

Definition at line 67 of file VP1String.cxx.

67{ double x,y,z,t; v.getValue(x,y,z,t); return "("+str(x)+", "+str(y)+", "+str(z)+", "+str(t)+")"; }

◆ str() [19/30]

QString VP1String::str ( const SbVec4f & v)
staticinherited

Definition at line 68 of file VP1String.cxx.

68{ float x,y,z,t; v.getValue(x,y,z,t); return "("+str(x)+", "+str(y)+", "+str(z)+", "+str(t)+")"; }

◆ str() [20/30]

template<class T>
QString VP1String::str ( const T * t)
inlinestaticinherited

Definition at line 87 of file VP1String.h.

87{ return str(static_cast<const void* >(t)); }

◆ str() [21/30]

QString VP1String::str ( const void * p)
staticinherited

Definition at line 48 of file VP1String.cxx.

49{
50 if (p) {
51 std::ostringstream s;
52 s << p;
53 // Explicitly naming QString here avoids a cppcheck warning.
54 return QString (s.str().c_str());
55 } else {
56 return "NULL";
57 }
58}

◆ str() [22/30]

QString VP1String::str ( const VP1Interval & i)
staticinherited

Definition at line 42 of file VP1String.cxx.

43{
44 return i.toString();
45}

◆ str() [23/30]

QString VP1String::str ( int n)
inlinestaticinherited

Definition at line 77 of file VP1String.h.

77{ return QString::number(n); }

◆ str() [24/30]

QString VP1String::str ( long n)
inlinestaticinherited

Definition at line 75 of file VP1String.h.

75{ return QString::number(n); }

◆ str() [25/30]

QString VP1String::str ( qlonglong n)
inlinestaticinherited

Definition at line 79 of file VP1String.h.

79{ return QString::number(n); }

◆ str() [26/30]

QString VP1String::str ( qulonglong n)
inlinestaticinherited

Definition at line 80 of file VP1String.h.

80{ return QString::number(n); }

◆ str() [27/30]

QString VP1String::str ( short int n)
inlinestaticinherited

Definition at line 73 of file VP1String.h.

73{ return QString::number(n); }

◆ str() [28/30]

QString VP1String::str ( uint n)
inlinestaticinherited

Definition at line 78 of file VP1String.h.

78{ return QString::number(n); }

◆ str() [29/30]

QString VP1String::str ( ulong n)
inlinestaticinherited

Definition at line 76 of file VP1String.h.

76{ return QString::number(n); }

◆ str() [30/30]

QString VP1String::str ( unsigned short int n)
inlinestaticinherited

Definition at line 74 of file VP1String.h.

74{ return QString::number(n); }

◆ verbose()

bool VP1Msg::verbose ( )
inlinestatic

Definition at line 31 of file VP1Msg.h.

31{ return m_verbose; } // Returns true if env var VP1_VERBOSE_OUTPUT=1

Member Data Documentation

◆ m_debug

std::atomic< bool > VP1Msg::m_debug = VP1QtUtils::environmentVariableIsOn("VP1_DEBUG_OUTPUT")
staticprivate

Definition at line 65 of file VP1Msg.h.

◆ m_verbose

std::atomic< bool > VP1Msg::m_verbose = VP1QtUtils::environmentVariableIsOn("VP1_VERBOSE_OUTPUT")
staticprivate

Definition at line 64 of file VP1Msg.h.


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