ATLAS Offline Software
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
VP1Serialise Class Reference

#include <VP1Serialise.h>

Inheritance diagram for VP1Serialise:
Collaboration diagram for VP1Serialise:

Classes

class  Imp
 

Public Member Functions

 VP1Serialise (qint32 version, IVP1System *sys=0)
 
virtual ~VP1Serialise ()
 
const QByteArray & result ()
 
qint32 version () const
 
void ignoreWidget (const QWidget *)
 
void widgetHandled (const QWidget *)
 
void warnUnsaved (const QObject *)
 
void disableUnsavedChecks ()
 
void save (bool)
 
void save (QCheckBox *)
 
void save (QGroupBox *)
 
void save (const QString &)
 
void save (QComboBox *)
 
void save (QLineEdit *)
 
void saveByTitle (QToolBox *)
 
void save (const double &)
 
void save (QDoubleSpinBox *, const double &unit=1.0)
 
void save (qint32)
 
void save (QSpinBox *)
 
void save (QSlider *)
 
void save (QToolBox *)
 
void save (QRadioButton *rb0, QRadioButton *rb1, QRadioButton *rb2=0, QRadioButton *rb3=0, QRadioButton *rb4=0, QRadioButton *rb5=0, QRadioButton *rb6=0, QRadioButton *rb7=0, QRadioButton *rb8=0, QRadioButton *rb9=0)
 
void save (const QByteArray &)
 
void save (const VP1MaterialButton *)
 
void save (SoMaterial *)
 
void save (const VP1CollectionWidget *)
 
void save (const VP1CollectionSettingsButtonBase *jcb)
 
void save (const VP1EtaPhiCutWidget *)
 
void save (const VP1DrawOptionsWidget *)
 
void save (const PhiSectionWidget *)
 
void save (const QColor &)
 
void save (VP1ColorSelectButton *)
 
template<class T >
void save (const T &t)
 
template<class T >
void save (T *t)
 
void setSystemBasePointer (IVP1System *sys)
 
void message (const QString &) const
 
void message (const QStringList &, const QString &addtoend="") const
 
void message (const QString &addtostart, const QStringList &, const QString &addtoend="") const
 
void messageDebug (const QString &) const
 
void messageDebug (const QStringList &, const QString &addtoend="") const
 
void messageDebug (const QString &addtostart, const QStringList &, const QString &addtoend="") const
 
void messageVerbose (const QString &) const
 
void messageVerbose (const QStringList &, const QString &addtoend="") const
 
void messageVerbose (const QString &addtostart, const QStringList &, const QString &addtoend="") const
 
IVP1SystemsystemBase () const
 
const QString & helperClassName () const
 

Static Public Member Functions

static unsigned numberOfInstantiations ()
 
static void decrementNumberOfInstantiations ()
 
static bool verbose ()
 
static void warnUndeletedInstances ()
 
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)
 

Protected Member Functions

void setHelperClassName (const QString &n)
 

Private Member Functions

QDataStream * stream ()
 

Private Attributes

Impm_d
 
QString m_helpername
 
IVP1Systemm_system
 

Static Private Attributes

static const bool s_vp1verbose = VP1QtUtils::environmentVariableIsOn("VP1_VERBOSE_OUTPUT")
 

Detailed Description

Definition at line 45 of file VP1Serialise.h.

Constructor & Destructor Documentation

◆ VP1Serialise()

VP1Serialise::VP1Serialise ( qint32  version,
IVP1System sys = 0 
)

Definition at line 87 of file VP1Serialise.cxx.

88  : VP1HelperClassBase(sys,"VP1Serialise"), m_d(new Imp(this))
89 {
91 
92  m_d->byteArray.clear();
93  m_d->buffer = new QBuffer(&m_d->byteArray);
94  m_d->buffer->open(QIODevice::WriteOnly);
95  m_d->state = new QDataStream(m_d->buffer);
96  m_d->version = version;
97  save(version);
98 }

◆ ~VP1Serialise()

VP1Serialise::~VP1Serialise ( )
virtual

Definition at line 101 of file VP1Serialise.cxx.

102 {
103  if (!m_d->checkedUnused)
104  message("WARNING: warnUnsaved(..) was never called!");
105 
106  m_d->buffer->close();
107  delete m_d->state;
108  m_d->state = 0;
109  delete m_d->buffer;
110  m_d->buffer = 0;
111  delete m_d;
112 }

Member Function Documentation

◆ decrementNumberOfInstantiations()

void VP1Serialise::decrementNumberOfInstantiations ( )
static

Definition at line 81 of file VP1Serialise.cxx.

82 {
84 }

◆ disableUnsavedChecks()

void VP1Serialise::disableUnsavedChecks ( )

Definition at line 475 of file VP1Serialise.cxx.

476 {
477  m_d->checkedUnused = true;
478 }

◆ helperClassName()

const QString& VP1HelperClassBase::helperClassName ( ) const
inlineinherited

Definition at line 51 of file VP1HelperClassBase.h.

51 { return m_helpername; }

◆ ignoreWidget()

void VP1Serialise::ignoreWidget ( const QWidget *  w)

Definition at line 433 of file VP1Serialise.cxx.

434 {
435  if(VP1Msg::debug()){
436  messageDebug("\nVP1Serialise::ignoreWidget(QWidget) - name: " + w->objectName());
437  }
438  if (w)
439  m_d->ignoredWidgets.insert(w);
440 }

◆ message() [1/3]

void VP1HelperClassBase::message ( const QString &  str) const
inherited

Definition at line 49 of file VP1HelperClassBase.cxx.

50 {
51  if (m_helpername.isEmpty()) {
52  if (m_system)
54  else
55  std::cout<<VP1Msg::prefix_msg()<<" [nameless helper class]: "<<str.toStdString()<<std::endl;
56  } else {
57  if (m_system)
58  m_system->message("["+m_helpername+"] " + str);
59  else
60  std::cout<<VP1Msg::prefix_msg()<<" ["<<m_helpername.toStdString()<<"]: "<<str.toStdString()<<std::endl;
61  }
62 }

◆ message() [2/3]

void VP1HelperClassBase::message ( const QString &  addtostart,
const QStringList &  l,
const QString &  addtoend = "" 
) const
inherited

Definition at line 131 of file VP1HelperClassBase.cxx.

132 {
133  if (addtostart.isEmpty()) {
134  message(l,addtoend);
135  return;
136  }
137  if (addtoend.isEmpty()) {
138  for (const QString& s : l)
139  message(addtostart+s);
140  } else {
141  for (const QString& s : l)
142  message(addtostart+s+addtoend);
143  }
144 }

◆ message() [3/3]

void VP1HelperClassBase::message ( const QStringList &  l,
const QString &  addtoend = "" 
) const
inherited

Definition at line 91 of file VP1HelperClassBase.cxx.

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

◆ messageDebug() [1/3]

void VP1HelperClassBase::messageDebug ( const QString &  str) const
inherited

Definition at line 65 of file VP1HelperClassBase.cxx.

66 {
67  if (!VP1Msg::debug())
68  return;
69  std::string sysstring(m_system ? " in "+m_system->name().toStdString() : std::string(""));
70  if (m_helpername.isEmpty()) {
71  std::cout<<VP1Msg::prefix_debug()<<" [helper"<<sysstring<<"]: "<<str.toStdString()<<std::endl;
72  } else {
73  std::cout<<VP1Msg::prefix_debug()<<" ["<<m_helpername.toStdString()<<sysstring<<"]: "<<str.toStdString()<<std::endl;
74  }
75 }

◆ messageDebug() [2/3]

void VP1HelperClassBase::messageDebug ( const QString &  addtostart,
const QStringList &  l,
const QString &  addtoend = "" 
) const
inherited

Definition at line 147 of file VP1HelperClassBase.cxx.

148 {
149  if (!VP1Msg::debug())
150  return;
151  if (addtostart.isEmpty()) {
152  messageDebug(l,addtoend);
153  return;
154  }
155  if (addtoend.isEmpty()) {
156  for (const QString& s : l)
157  messageDebug(addtostart+s);
158  } else {
159  for (const QString& s : l)
160  messageDebug(addtostart+s+addtoend);
161  }
162 }

◆ messageDebug() [3/3]

void VP1HelperClassBase::messageDebug ( const QStringList &  l,
const QString &  addtoend = "" 
) const
inherited

Definition at line 103 of file VP1HelperClassBase.cxx.

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

◆ messageVerbose() [1/3]

void VP1HelperClassBase::messageVerbose ( const QString &  str) const
inherited

Definition at line 78 of file VP1HelperClassBase.cxx.

79 {
80  if (!VP1Msg::verbose())
81  return;
82  std::string sysstring(m_system ? " in "+m_system->name().toStdString() : std::string(""));
83  if (m_helpername.isEmpty()) {
84  std::cout<<VP1Msg::prefix_verbose()<<" [helper"<<sysstring<<"]: "<<str.toStdString()<<std::endl;
85  } else {
86  std::cout<<VP1Msg::prefix_verbose()<<" ["<<m_helpername.toStdString()<<sysstring<<"]: "<<str.toStdString()<<std::endl;
87  }
88 }

◆ messageVerbose() [2/3]

void VP1HelperClassBase::messageVerbose ( const QString &  addtostart,
const QStringList &  l,
const QString &  addtoend = "" 
) const
inherited

Definition at line 165 of file VP1HelperClassBase.cxx.

166 {
167  if (!VP1Msg::verbose())
168  return;
169  if (addtostart.isEmpty()) {
170  messageVerbose(l,addtoend);
171  return;
172  }
173  if (addtoend.isEmpty()) {
174  for (const QString& s : l)
175  messageVerbose(addtostart+s);
176  } else {
177  for (const QString& s : l)
178  messageVerbose(addtostart+s+addtoend);
179  }
180 }

◆ messageVerbose() [3/3]

void VP1HelperClassBase::messageVerbose ( const QStringList &  l,
const QString &  addtoend = "" 
) const
inherited

Definition at line 117 of file VP1HelperClassBase.cxx.

118 {
119  if (!VP1Msg::verbose())
120  return;
121  if (addtoend.isEmpty()) {
122  for (const QString& s : l)
123  messageVerbose(s);
124  } else {
125  for (const QString& s : l)
126  messageVerbose(s+addtoend);
127  }
128 }

◆ numberOfInstantiations()

unsigned VP1Serialise::numberOfInstantiations ( )
static

Definition at line 75 of file VP1Serialise.cxx.

76 {
78 }

◆ result()

const QByteArray & VP1Serialise::result ( )

Definition at line 129 of file VP1Serialise.cxx.

130 {
131  return m_d->byteArray;
132 }

◆ save() [1/25]

void VP1Serialise::save ( bool  b)

Definition at line 207 of file VP1Serialise.cxx.

208 {
209  if (VP1Msg::verbose()){
210  messageVerbose("Saving bool "+str(b));
211  }
212  (*m_d->state) << b;
213 }

◆ save() [2/25]

void VP1Serialise::save ( const double &  dbl)

Definition at line 225 of file VP1Serialise.cxx.

226 {
227  if (VP1Msg::verbose()){
228  messageVerbose("Saving double "+str(dbl));
229  }
230  (*(m_d->state)) << dbl;
231 }

◆ save() [3/25]

void VP1Serialise::save ( const PhiSectionWidget phi)

Definition at line 321 of file VP1Serialise.cxx.

322 {
323  if(VP1Msg::debug()){
324  messageDebug("\nVP1Serialise::save(PhiSectionWidget) - name: " + phi->objectName());
325  }
326  m_d->handle(phi);
327  if (VP1Msg::verbose()){
328  messageVerbose("Saving phisection widget state");
329  }
330  (*(m_d->state)) << (phi ? phi->state() : QByteArray());
331 }

◆ save() [4/25]

void VP1Serialise::save ( const QByteArray &  ba)

Definition at line 243 of file VP1Serialise.cxx.

244 {
245  if (VP1Msg::verbose()){
246  messageVerbose("Saving byte array (length = "+QString::number(ba.count())+")");
247  }
248  (*(m_d->state)) << ba;
249 }

◆ save() [5/25]

void VP1Serialise::save ( const QColor &  c)

Definition at line 299 of file VP1Serialise.cxx.

300 {
301  if(VP1Msg::debug()){
302  messageDebug("\nVP1Serialise::save(QColor) - name: " + c.name());
303  }
304  if (VP1Msg::verbose()){
305  messageVerbose("Saving color "+str(c));
306  }
307  (*m_d->state) << c;
308 }

◆ save() [6/25]

void VP1Serialise::save ( const QString &  s)

Definition at line 234 of file VP1Serialise.cxx.

235 {
236  if (VP1Msg::verbose()){
237  messageVerbose("Saving string "+s);
238  }
239  (*(m_d->state)) << s;
240 }

◆ save() [7/25]

template<class T >
void VP1Serialise::save ( const T &  t)

Definition at line 129 of file VP1Serialise.h.

129  {//Fallback template method
130  if (VP1Msg::verbose())
131  messageVerbose("Saving "+QString(typeid(T).name())+" via datastream operator");
132  *(stream()) << t;
133 }

◆ save() [8/25]

void VP1Serialise::save ( const VP1CollectionSettingsButtonBase jcb)

Definition at line 395 of file VP1Serialise.cxx.

396 {
397  if(VP1Msg::debug()){
398  messageDebug("\nVP1Serialise::save(VP1CollectionSettingsButtonBase) - name: " + jcb->objectName());
399  messageDebug("VP1Serialise::save(VP1CollectionSettingsButtonBase)- start...");
400  }
401  m_d->handle(jcb);
402  ignoreWidget(jcb);//To ignore all children of the etaphicut widget.
403  save(jcb ? jcb->saveState() : QByteArray());
404  if(VP1Msg::debug()){
405  messageDebug("VP1Serialise::save(VP1CollectionSettingsButtonBase)- end.");
406  }
407 }

◆ save() [9/25]

void VP1Serialise::save ( const VP1CollectionWidget cw)

Definition at line 366 of file VP1Serialise.cxx.

367 {
368  if(VP1Msg::debug()){
369  messageDebug("\nVP1Serialise::save(VP1CollectionWidget) - name: " + cw->objectName());
370  messageDebug("VP1Serialise::save(VP1CollectionWidget)- start...");
371  }
372  m_d->handle(cw);
373  ignoreWidget(cw);//To ignore all children of the collection widget.
374  QByteArray ba;
375  QBuffer buffer(&ba);
376  buffer.open(QIODevice::WriteOnly);
377  QDataStream out(&buffer);
378  out << (qint32)0;//version
379  out << cw->states();
380  buffer.close();
381  save(ba);
382  if(VP1Msg::debug()){
383  messageDebug("VP1Serialise::save(VP1CollectionWidget)- end.");
384  }
385 }

◆ save() [10/25]

void VP1Serialise::save ( const VP1DrawOptionsWidget w)

Definition at line 422 of file VP1Serialise.cxx.

423 {
424  if(VP1Msg::debug()){
425  messageDebug("\nVP1Serialise::save(VP1DrawOptionsWidget) - name: " + w->objectName());
426  }
427  m_d->handle(w);
428  ignoreWidget(w);//To ignore all children of the draw options widget.
429  save(w ? w->state() : QByteArray());
430 }

◆ save() [11/25]

void VP1Serialise::save ( const VP1EtaPhiCutWidget w)

Definition at line 411 of file VP1Serialise.cxx.

412 {
413  if(VP1Msg::debug()){
414  messageDebug("\nVP1Serialise::save(VP1EtaPhiCutWidget) - name: " + w->objectName());
415  }
416  m_d->handle(w);
417  ignoreWidget(w);//To ignore all children of the etaphicut widget.
418  save(w ? w->saveState() : QByteArray());
419 }

◆ save() [12/25]

void VP1Serialise::save ( const VP1MaterialButton mb)

Definition at line 288 of file VP1Serialise.cxx.

289 {
290  if(VP1Msg::debug()){
291  messageDebug("\nVP1Serialise::save(VP1MaterialButton) - name: " + mb->objectName());
292  }
293  m_d->handle(mb);
294  QList<SoMaterial*> mats = mb ? mb->handledMaterials() : QList<SoMaterial*>();
295  save(mats.isEmpty() ? 0 : mats.at(0));
296 }

◆ save() [13/25]

void VP1Serialise::save ( QCheckBox *  cb)

Definition at line 135 of file VP1Serialise.cxx.

136 {
137  if(VP1Msg::debug()){
138  messageDebug("VP1Serialise::save(QCheckBox) - name: " + cb->objectName());
139  }
140  m_d->handle(cb);
141  save(cb->isChecked());
142 }

◆ save() [14/25]

void VP1Serialise::save ( QComboBox *  cb)

Definition at line 157 of file VP1Serialise.cxx.

158 {
159  if(VP1Msg::debug()){
160  messageDebug("VP1Serialise::save(QComboBox) - name: " + cb->objectName());
161  }
162  m_d->handle(cb);
163  save( cb->count() > 0 ? cb->currentText() : QString() );
164 }

◆ save() [15/25]

void VP1Serialise::save ( QDoubleSpinBox *  sb,
const double &  unit = 1.0 
)

Definition at line 177 of file VP1Serialise.cxx.

178 {
179  if(VP1Msg::debug()){
180  messageDebug("\nVP1Serialise::save(QDoubleSpinBox) - name: " + sb->objectName());
181  }
182  m_d->handle(sb);
183  save(unit==1.0 ? sb->value() : sb->value() * unit );
184 }

◆ save() [16/25]

void VP1Serialise::save ( QGroupBox *  gb)

Definition at line 145 of file VP1Serialise.cxx.

146 {
147  if(VP1Msg::debug()){
148  messageDebug("VP1Serialise::save(QGroupBox) - name: " + gb->objectName());
149  }
150  if (!gb->isCheckable())
151  message("WARNING: Asked to handled GroupBox which is not checkable: "+gb->objectName());
152  m_d->handle(gb);
153  save(gb->isChecked());
154 }

◆ save() [17/25]

void VP1Serialise::save ( qint32  i)

Definition at line 216 of file VP1Serialise.cxx.

217 {
218  if (VP1Msg::verbose()){
219  messageVerbose("Saving int "+str(i));
220  }
221  (*m_d->state) << i;
222 }

◆ save() [18/25]

void VP1Serialise::save ( QLineEdit *  le)

Definition at line 167 of file VP1Serialise.cxx.

168 {
169  if(VP1Msg::debug()){
170  messageDebug("\nVP1Serialise::save(QLineEdit) - name: " + le->objectName());
171  }
172  m_d->handle(le);
173  save( le->text() );
174 }

◆ save() [19/25]

void VP1Serialise::save ( QRadioButton *  rb0,
QRadioButton *  rb1,
QRadioButton *  rb2 = 0,
QRadioButton *  rb3 = 0,
QRadioButton *  rb4 = 0,
QRadioButton *  rb5 = 0,
QRadioButton *  rb6 = 0,
QRadioButton *  rb7 = 0,
QRadioButton *  rb8 = 0,
QRadioButton *  rb9 = 0 
)

Definition at line 334 of file VP1Serialise.cxx.

344 {
345  QList<QRadioButton *> l;
346  l << rb0 << rb1 << rb2 << rb3 << rb4 << rb5 << rb6 << rb7 << rb8 << rb9;
347  for (qint32 i = 0; i < l.count(); ++i) {
348  if (l.at(i)) {
349  if(VP1Msg::debug()){
350  messageDebug("\nVP1Serialise::save(QRadioButton) - name: " + l.at(i)->objectName());
351  }
352  m_d->handle(l.at(i));
353  }
354  }
355  qint32 ichecked(-1);
356  for (qint32 i = 0; i < l.count(); ++i) {
357  if (l.at(i)&&l.at(i)->isChecked()) {
358  ichecked = i;
359  break;
360  }
361  }
362  save(ichecked);
363 }

◆ save() [20/25]

void VP1Serialise::save ( QSlider *  s)

Definition at line 197 of file VP1Serialise.cxx.

198 {
199  if(VP1Msg::debug()){
200  messageDebug("\nVP1Serialise::save(QSlider) - name: " + s->objectName());
201  }
202  m_d->handle(s);
203  save(s->value());
204 }

◆ save() [21/25]

void VP1Serialise::save ( QSpinBox *  sb)

Definition at line 187 of file VP1Serialise.cxx.

188 {
189  if(VP1Msg::debug()){
190  messageDebug("\nVP1Serialise::save(QSpinBox) - name: " + sb->objectName());
191  }
192  m_d->handle(sb);
193  save(sb->value());
194 }

◆ save() [22/25]

void VP1Serialise::save ( QToolBox *  tb)

Definition at line 252 of file VP1Serialise.cxx.

253 {
254  if(VP1Msg::debug()){
255  messageDebug("\nVP1Serialise::save(QToolBox) - name: " + tb->objectName());
256  }
257  m_d->handle(tb);
258  save( tb && tb->count() > 0 ? tb->currentIndex() : -1 );
259 }

◆ save() [23/25]

void VP1Serialise::save ( SoMaterial *  m)

Definition at line 273 of file VP1Serialise.cxx.

274 {
275  if(VP1Msg::debug()){
276  messageDebug("\nVP1Serialise::save(SoMaterial)");
277  }
278  if (!m) {
279  save(QByteArray());
280  return;
281  }
282  m->ref();
284  m->unrefNoDelete();
285 }

◆ save() [24/25]

template<class T >
void VP1Serialise::save ( T *  t)

Definition at line 136 of file VP1Serialise.h.

137 {
138  save((const T*)t);
139 }

◆ save() [25/25]

void VP1Serialise::save ( VP1ColorSelectButton cb)

Definition at line 311 of file VP1Serialise.cxx.

312 {
313  if(VP1Msg::debug()){
314  messageDebug("\nVP1Serialise::save(VP1ColorSelectButton) - name: " + cb->objectName());
315  }
316  m_d->handle(cb);
317  save(cb ? cb->color() : QColor());
318 }

◆ saveByTitle()

void VP1Serialise::saveByTitle ( QToolBox *  tb)

Definition at line 262 of file VP1Serialise.cxx.

263 {
264  if(VP1Msg::debug()){
265  messageDebug("\nVP1Serialise::save(QToolBox) - name: " + tb->objectName());
266  }
267  m_d->handle(tb);
268  int i = tb ? tb->currentIndex() : -1;
269  save( i>=0 && i<tb->count() ? tb->itemText(i) : QString() );
270 }

◆ setHelperClassName()

void VP1HelperClassBase::setHelperClassName ( const QString &  n)
inlineprotectedinherited

Definition at line 59 of file VP1HelperClassBase.h.

59 { m_helpername = n; }

◆ setSystemBasePointer()

void VP1HelperClassBase::setSystemBasePointer ( IVP1System sys)
inherited

Definition at line 197 of file VP1HelperClassBase.cxx.

198 {
199  m_system = sys;
200  if (VP1Msg::verbose()){
201  vp1helperclassbase_instanceMap[this] = (m_system?m_system->name():QString(""));
202  }
203 }

◆ str() [1/30]

static 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]

static QString VP1String::str ( const bool  b)
inlinestaticinherited

Definition at line 53 of file VP1String.h.

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

◆ str() [3/30]

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

Definition at line 50 of file VP1String.h.

50 { return c; }

◆ str() [4/30]

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

Definition at line 81 of file VP1String.h.

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

◆ str() [5/30]

static 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 >
static 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 >
static 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 >
static 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]

static 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 }

◆ 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)+")"; }

◆ 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)+")"; }

◆ 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 >
static 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]

static QString VP1String::str ( int  n)
inlinestaticinherited

Definition at line 77 of file VP1String.h.

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

◆ str() [24/30]

static QString VP1String::str ( long  n)
inlinestaticinherited

Definition at line 75 of file VP1String.h.

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

◆ str() [25/30]

static QString VP1String::str ( qlonglong  n)
inlinestaticinherited

Definition at line 79 of file VP1String.h.

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

◆ str() [26/30]

static QString VP1String::str ( qulonglong  n)
inlinestaticinherited

Definition at line 80 of file VP1String.h.

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

◆ str() [27/30]

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

Definition at line 73 of file VP1String.h.

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

◆ str() [28/30]

static QString VP1String::str ( uint  n)
inlinestaticinherited

Definition at line 78 of file VP1String.h.

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

◆ str() [29/30]

static QString VP1String::str ( ulong  n)
inlinestaticinherited

Definition at line 76 of file VP1String.h.

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

◆ str() [30/30]

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

Definition at line 74 of file VP1String.h.

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

◆ stream()

QDataStream * VP1Serialise::stream ( )
private

Definition at line 115 of file VP1Serialise.cxx.

116 {
117  return m_d->state;
118 }

◆ systemBase()

IVP1System* VP1HelperClassBase::systemBase ( ) const
inlineinherited

Definition at line 50 of file VP1HelperClassBase.h.

50 { return m_system; }

◆ verbose()

static bool VP1HelperClassBase::verbose ( )
inlinestaticinherited

Definition at line 32 of file VP1HelperClassBase.h.

32 { return s_vp1verbose; } // Returns true if env var VP1_VERBOSE_OUTPUT=1

◆ version()

qint32 VP1Serialise::version ( ) const

Definition at line 122 of file VP1Serialise.cxx.

123 {
124  return m_d->version;
125 }

◆ warnUndeletedInstances()

void VP1HelperClassBase::warnUndeletedInstances ( )
staticinherited

Definition at line 183 of file VP1HelperClassBase.cxx.

184 {
185  if (vp1helperclassbase_instanceMap.empty())
186  return;
187  std::cout << "WARNING: Detected "<<vp1helperclassbase_instanceMap.size()<<" undeleted helper class instances:"<<std::endl;
188 
189  std::map<VP1HelperClassBase*,QString>::iterator it,itE(vp1helperclassbase_instanceMap.end());
190  for (it = vp1helperclassbase_instanceMap.begin();it!=itE;++it) {
191  std::cout << " ==> "<<it->first<<": "<<it->first->m_helpername.toStdString()
192  << (it->second.isEmpty()?QString(""):" (in system "+it->second+")").toStdString()<<std::endl;
193  }
194 }

◆ warnUnsaved()

void VP1Serialise::warnUnsaved ( const QObject *  object)

Definition at line 481 of file VP1Serialise.cxx.

482 {
483  //NB: Same code as in VP1Deserialise::warnUnrestored
484 
485  if (!m_d->checkedUnused)
486  m_d->checkedUnused = true;
487 
488  if (!object)
489  return;
490 
491  if (object->isWidgetType()&&m_d->ignoredWidgets.contains(static_cast<const QWidget*>(object)))
492  return;
493 
494  if (object->isWidgetType()&&!object->objectName().startsWith("qt_")) {
495  const QWidget * wid = static_cast<const QWidget*>(object);
496  if (!m_d->handledWidgets.contains(wid)&&m_d->expectsPersistification(wid)) {
497  QString s("WARNING Unsaved widget of type: "+QString(wid->metaObject()->className())+" and object name = "+wid->objectName());
498  if (VP1Msg::verbose()){
499  message(s);
500  }
501  if(VP1Msg::debug()){
502  messageDebug(s);
503  }
504  }
505  }
506  //Call recursively on all "children":
507  for (const QObject* o : object->children())
508  warnUnsaved(static_cast<const QWidget*>(o));
509 }

◆ widgetHandled()

void VP1Serialise::widgetHandled ( const QWidget *  w)

Definition at line 443 of file VP1Serialise.cxx.

444 {
445  m_d->handle(w);
446 }

Member Data Documentation

◆ m_d

Imp* VP1Serialise::m_d
private

Definition at line 119 of file VP1Serialise.h.

◆ m_helpername

QString VP1HelperClassBase::m_helpername
privateinherited

Definition at line 67 of file VP1HelperClassBase.h.

◆ m_system

IVP1System* VP1HelperClassBase::m_system
privateinherited

Definition at line 68 of file VP1HelperClassBase.h.

◆ s_vp1verbose

const bool VP1HelperClassBase::s_vp1verbose = VP1QtUtils::environmentVariableIsOn("VP1_VERBOSE_OUTPUT")
staticprivateinherited

Definition at line 69 of file VP1HelperClassBase.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
VP1Serialise::Imp::version
qint32 version
Definition: VP1Serialise.cxx:50
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
hist_file_dump.d
d
Definition: hist_file_dump.py:137
VP1Serialise::Imp::state
QDataStream * state
Definition: VP1Serialise.cxx:48
VP1HelperClassBase::m_helpername
QString m_helpername
Definition: VP1HelperClassBase.h:67
VP1HelperClassBase::messageVerbose
void messageVerbose(const QString &) const
Definition: VP1HelperClassBase.cxx:78
VP1HelperClassBase::s_vp1verbose
static const bool s_vp1verbose
Definition: VP1HelperClassBase.h:69
skel.it
it
Definition: skel.GENtoEVGEN.py:396
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
VP1Serialise::warnUnsaved
void warnUnsaved(const QObject *)
Definition: VP1Serialise.cxx:481
VP1Msg::debug
static bool debug()
Definition: VP1Msg.h:32
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
VP1HelperClassBase::m_system
IVP1System * m_system
Definition: VP1HelperClassBase.h:68
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
VP1Serialise::m_d
Imp * m_d
Definition: VP1Serialise.h:118
x
#define x
VP1String::str
static QString str(const QString &s)
Definition: VP1String.h:49
VP1HelperClassBase::messageDebug
void messageDebug(const QString &) const
Definition: VP1HelperClassBase.cxx:65
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
TruthTest.itE
itE
Definition: TruthTest.py:25
Execution.tb
tb
Definition: Execution.py:15
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
createCoolChannelIdFile.buffer
buffer
Definition: createCoolChannelIdFile.py:12
VP1Msg::prefix_msg
static const char * prefix_msg()
Definition: VP1Msg.h:56
VP1Serialise::Imp::byteArray
QByteArray byteArray
Definition: VP1Serialise.cxx:46
lumiFormat.i
int i
Definition: lumiFormat.py:85
z
#define z
beamspotman.n
n
Definition: beamspotman.py:731
VP1Serialise::save
void save(bool)
Definition: VP1Serialise.cxx:207
VP1Serialise::Imp::handledWidgets
QSet< const QWidget * > handledWidgets
Definition: VP1Serialise.cxx:52
VP1QtInventorUtils::serialiseSoMaterial
static QByteArray serialiseSoMaterial(SoMaterial *)
Definition: VP1QtInventorUtils.cxx:1150
IVP1System::name
const QString & name() const
Definition: IVP1System.cxx:50
VP1Serialise::Imp::numberOfInstantiations
static unsigned numberOfInstantiations
Definition: VP1Serialise.cxx:70
VP1CollectionWidget::states
VP1CollStates states() const
Definition: VP1CollectionWidget.cxx:304
hist_file_dump.f
f
Definition: hist_file_dump.py:135
VP1Serialise::Imp::ignoredWidgets
QSet< const QWidget * > ignoredWidgets
Definition: VP1Serialise.cxx:53
VP1ColorSelectButton::color
QColor color() const
Definition: VP1ColorSelectButton.cxx:108
VP1Serialise::Imp::checkedUnused
bool checkedUnused
Definition: VP1Serialise.cxx:49
VP1QtInventorUtils::sbcol2qcol
static QColor sbcol2qcol(const SbColor &)
Definition: VP1QtInventorUtils.cxx:1142
keylayer_zslicemap.sb
sb
Definition: keylayer_zslicemap.py:192
VP1Serialise::Imp::buffer
QBuffer * buffer
Definition: VP1Serialise.cxx:47
python.selection.number
number
Definition: selection.py:20
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
VP1Msg::prefix_debug
static const char * prefix_debug()
Definition: VP1Msg.h:57
VP1Serialise::ignoreWidget
void ignoreWidget(const QWidget *)
Definition: VP1Serialise.cxx:433
python.PyAthena.v
v
Definition: PyAthena.py:154
VP1Msg::prefix_verbose
static const char * prefix_verbose()
Definition: VP1Msg.h:59
y
#define y
TRT_PAI_physicsConstants::mb
const double mb
1mb to cm2
Definition: TRT_PAI_physicsConstants.h:15
unit
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
Definition: AmgMatrixBasePlugin.h:21
VP1Serialise::Imp::expectsPersistification
bool expectsPersistification(const QWidget *w)
Definition: VP1Serialise.cxx:449
VP1HelperClassBase::message
void message(const QString &) const
Definition: VP1HelperClassBase.cxx:49
pickleTool.object
object
Definition: pickleTool.py:30
str
Definition: BTagTrackIpAccessor.cxx:11
VP1Msg::verbose
static bool verbose()
Definition: VP1Msg.h:31
VP1HelperClassBase::VP1HelperClassBase
VP1HelperClassBase(IVP1System *sys=0, QString helpername="")
Definition: VP1HelperClassBase.cxx:28
VP1Serialise::stream
QDataStream * stream()
Definition: VP1Serialise.cxx:115
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
python.compressB64.c
def c
Definition: compressB64.py:93
VP1CollectionSettingsButtonBase::saveState
QByteArray saveState() const
fill out with the state of the object (used for drag and drop etc)
Definition: VP1CollectionSettingsButtonBase.cxx:78
VP1Serialise::Imp::handle
void handle(QWidget *w)
Definition: VP1Serialise.cxx:54
IVP1System::message
void message(const QString &) const
Definition: IVP1System.cxx:336
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
VP1Serialise::version
qint32 version() const
Definition: VP1Serialise.cxx:122