ATLAS Offline Software
Loading...
Searching...
No Matches
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 86 of file VP1Serialise.cxx.

87 : VP1HelperClassBase(sys,"VP1Serialise"), m_d(new Imp(this))
88{
90
91 m_d->byteArray.clear();
92 m_d->buffer = new QBuffer(&m_d->byteArray);
93 m_d->buffer->open(QIODevice::WriteOnly);
94 m_d->state = new QDataStream(m_d->buffer);
95 m_d->version = version;
97}
VP1HelperClassBase(IVP1System *sys=0, QString helpername="")
static unsigned numberOfInstantiations
void save(bool)
qint32 version() const

◆ ~VP1Serialise()

VP1Serialise::~VP1Serialise ( )
virtual

Definition at line 100 of file VP1Serialise.cxx.

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

Member Function Documentation

◆ decrementNumberOfInstantiations()

void VP1Serialise::decrementNumberOfInstantiations ( )
static

Definition at line 80 of file VP1Serialise.cxx.

81{
83}

◆ disableUnsavedChecks()

void VP1Serialise::disableUnsavedChecks ( )

Definition at line 474 of file VP1Serialise.cxx.

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

◆ 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 432 of file VP1Serialise.cxx.

433{
434 if(VP1Msg::debug()){
435 messageDebug("\nVP1Serialise::ignoreWidget(QWidget) - name: " + w->objectName());
436 }
437 if (w)
438 m_d->ignoredWidgets.insert(w);
439}
void messageDebug(const QString &) const
static bool debug()
Definition VP1Msg.h:32

◆ 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)
53 m_system->message(str);
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}
static const char * prefix_msg()
Definition VP1Msg.h:56
static QString str(const QString &s)
Definition VP1String.h:49

◆ 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}
static const char * prefix_debug()
Definition VP1Msg.h:57

◆ 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}
static bool verbose()
Definition VP1Msg.h:31
static const char * prefix_verbose()
Definition VP1Msg.h:59

◆ 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}
void messageVerbose(const QString &) const

◆ 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)
124 } else {
125 for (const QString& s : l)
126 messageVerbose(s+addtoend);
127 }
128}

◆ numberOfInstantiations()

unsigned VP1Serialise::numberOfInstantiations ( )
static

Definition at line 74 of file VP1Serialise.cxx.

75{
77}

◆ result()

const QByteArray & VP1Serialise::result ( )

Definition at line 128 of file VP1Serialise.cxx.

129{
130 return m_d->byteArray;
131}

◆ save() [1/25]

void VP1Serialise::save ( bool b)

Definition at line 206 of file VP1Serialise.cxx.

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

◆ save() [2/25]

void VP1Serialise::save ( const double & dbl)

Definition at line 224 of file VP1Serialise.cxx.

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

◆ save() [3/25]

void VP1Serialise::save ( const PhiSectionWidget * phi)

Definition at line 320 of file VP1Serialise.cxx.

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

◆ save() [4/25]

void VP1Serialise::save ( const QByteArray & ba)

Definition at line 242 of file VP1Serialise.cxx.

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

◆ save() [5/25]

void VP1Serialise::save ( const QColor & c)

Definition at line 298 of file VP1Serialise.cxx.

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

◆ save() [6/25]

void VP1Serialise::save ( const QString & s)

Definition at line 233 of file VP1Serialise.cxx.

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

◆ 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}
QDataStream * stream()

◆ save() [8/25]

void VP1Serialise::save ( const VP1CollectionSettingsButtonBase * jcb)

Definition at line 394 of file VP1Serialise.cxx.

395{
396 if(VP1Msg::debug()){
397 messageDebug("\nVP1Serialise::save(VP1CollectionSettingsButtonBase) - name: " + jcb->objectName());
398 messageDebug("VP1Serialise::save(VP1CollectionSettingsButtonBase)- start...");
399 }
400 m_d->handle(jcb);
401 ignoreWidget(jcb);//To ignore all children of the etaphicut widget.
402 save(jcb ? jcb->saveState() : QByteArray());
403 if(VP1Msg::debug()){
404 messageDebug("VP1Serialise::save(VP1CollectionSettingsButtonBase)- end.");
405 }
406}
QByteArray saveState() const
fill out with the state of the object (used for drag and drop etc)
void ignoreWidget(const QWidget *)

◆ save() [9/25]

void VP1Serialise::save ( const VP1CollectionWidget * cw)

Definition at line 365 of file VP1Serialise.cxx.

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

◆ save() [10/25]

void VP1Serialise::save ( const VP1DrawOptionsWidget * w)

Definition at line 421 of file VP1Serialise.cxx.

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

◆ save() [11/25]

void VP1Serialise::save ( const VP1EtaPhiCutWidget * w)

Definition at line 410 of file VP1Serialise.cxx.

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

◆ save() [12/25]

void VP1Serialise::save ( const VP1MaterialButton * mb)

Definition at line 287 of file VP1Serialise.cxx.

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

◆ save() [13/25]

void VP1Serialise::save ( QCheckBox * cb)

Definition at line 134 of file VP1Serialise.cxx.

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

◆ save() [14/25]

void VP1Serialise::save ( QComboBox * cb)

Definition at line 156 of file VP1Serialise.cxx.

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

◆ save() [15/25]

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

Definition at line 176 of file VP1Serialise.cxx.

177{
178 if(VP1Msg::debug()){
179 messageDebug("\nVP1Serialise::save(QDoubleSpinBox) - name: " + sb->objectName());
180 }
181 m_d->handle(sb);
182 save(unit==1.0 ? sb->value() : sb->value() * unit );
183}
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.

◆ save() [16/25]

void VP1Serialise::save ( QGroupBox * gb)

Definition at line 144 of file VP1Serialise.cxx.

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

◆ save() [17/25]

void VP1Serialise::save ( qint32 i)

Definition at line 215 of file VP1Serialise.cxx.

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

◆ save() [18/25]

void VP1Serialise::save ( QLineEdit * le)

Definition at line 166 of file VP1Serialise.cxx.

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

◆ 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 333 of file VP1Serialise.cxx.

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

◆ save() [20/25]

void VP1Serialise::save ( QSlider * s)

Definition at line 196 of file VP1Serialise.cxx.

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

◆ save() [21/25]

void VP1Serialise::save ( QSpinBox * sb)

Definition at line 186 of file VP1Serialise.cxx.

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

◆ save() [22/25]

void VP1Serialise::save ( QToolBox * tb)

Definition at line 251 of file VP1Serialise.cxx.

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

◆ save() [23/25]

void VP1Serialise::save ( SoMaterial * m)

Definition at line 272 of file VP1Serialise.cxx.

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

◆ save() [24/25]

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

Definition at line 136 of file VP1Serialise.h.

137{
138 save(const_cast<const T*>(t));
139}
unsigned long long T

◆ save() [25/25]

void VP1Serialise::save ( VP1ColorSelectButton * cb)

Definition at line 310 of file VP1Serialise.cxx.

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

◆ saveByTitle()

void VP1Serialise::saveByTitle ( QToolBox * tb)

Definition at line 261 of file VP1Serialise.cxx.

262{
263 if(VP1Msg::debug()){
264 messageDebug("\nVP1Serialise::save(QToolBox) - name: " + tb->objectName());
265 }
266 m_d->handle(tb);
267 int i = tb ? tb->currentIndex() : -1;
268 save( i>=0 && i<tb->count() ? tb->itemText(i) : QString() );
269}
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:146

◆ setHelperClassName()

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

Definition at line 59 of file VP1HelperClassBase.h.

◆ 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}
static std::map< VP1HelperClassBase *, QString > vp1helperclassbase_instanceMap

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

◆ stream()

QDataStream * VP1Serialise::stream ( )
private

Definition at line 114 of file VP1Serialise.cxx.

115{
116 return m_d->state;
117}

◆ systemBase()

IVP1System * VP1HelperClassBase::systemBase ( ) const
inlineinherited

Definition at line 50 of file VP1HelperClassBase.h.

50{ return m_system; }

◆ verbose()

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
static const bool s_vp1verbose

◆ version()

qint32 VP1Serialise::version ( ) const

Definition at line 121 of file VP1Serialise.cxx.

122{
123 return m_d->version;
124}

◆ warnUndeletedInstances()

void VP1HelperClassBase::warnUndeletedInstances ( )
staticinherited

Definition at line 183 of file VP1HelperClassBase.cxx.

184{
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 480 of file VP1Serialise.cxx.

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

◆ widgetHandled()

void VP1Serialise::widgetHandled ( const QWidget * w)

Definition at line 442 of file VP1Serialise.cxx.

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

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: