1 #ifndef STARTUP_HELPER_P_H 2 #define STARTUP_HELPER_P_H 5 #include <QSharedPointer> 25 ObjectState(
const QMetaObject& metaobj, internal::VoidFnPtr initFunc, internal::VoidFnPtr deinitFunc);
79 const QMetaObject _metaObject;
82 QStringList _dependencies;
83 QStringList _optionalDependencies;
84 const bool _isSingleton;
86 internal::VoidFnPtr _initFunc;
87 internal::VoidFnPtr _deinitFunc;
113 static void registerHandlers();
122 static bool getClassesRecursive(QStringList backtrace, QStringList& globalDependencies,
const ObjectState&
object);
130 static void addComponentHelper(
const QMetaObject& metaobj, internal::VoidFnPtr initFunc, internal::VoidFnPtr deinitFunc);
136 static void addSingletonHelper(
const QMetaObject& metaobj);
146 static QVector<QSharedPointer<ObjectState>> _classes;
147 static bool _initalized;
148 static QStringList _orderedClasses;
149 static QMutex _registredMutex;
150 static bool _registred;
153 #endif // STARTUP_HELPER_P_H bool guiModule() const
Whether or not the represented class is a gui module (= it requires a Q(Gui)Application to run) ...
Definition: startup_helper.cpp:300
QString className() const
Returns the name of the class represented by the ObjectState.
Definition: startup_helper.cpp:280
bool initialized() const
Whether or not the represented class has already been initialized.
Definition: startup_helper.cpp:295
bool init()
Tries to construct the represented singleton or call init() on the represented component.
Definition: startup_helper.cpp:305
bool destroy()
Tries to delete the represented singleton or call deinit() on the represented component.
Definition: startup_helper.cpp:365
bool preDestroy()
Tries to call preDestroy() on the represented singleton. Does nothing if the represented class is a c...
Definition: startup_helper.cpp:352
bool postInit()
Tries to call postInit() on the represented singleton. Does nothing if the represented class is a com...
Definition: startup_helper.cpp:339
The ObjectState class represents the State of a Singleton or Component and helps calling create/delet...
Definition: startup_helper_p.h:11
The AbstractSingleton class defines functions that every singleton must implement Every Singleton mus...
Definition: singleton.h:12
ObjectState(const QMetaObject &metaobj)
Constructs a ObjectState for a Singleton.
Definition: startup_helper.cpp:233
QStringList dependencies() const
Returns a list of all dependencies of the represented class.
Definition: startup_helper.cpp:285
Definition: startup_helper_p.h:91
QStringList optionalDependencies() const
Returns a list of all optional dependencies of the represented class.
Definition: startup_helper.cpp:290