roviz  0.7
Code Documentation of roviz
Static Public Member Functions | List of all members
StartupHelper Class Reference

The StartupHelper class manages dependencies between global singletons and other components. It ensures that the singletons/components are constructed/deleted in the right order. More...

#include <startup_helper.h>

Collaboration diagram for StartupHelper:
Collaboration graph

Static Public Member Functions

template<class T >
static void addSingleton ()
 Adds a Singleton to the Helper. The Singleton will be constructed after it's dependencies.
Dependencies can be marked by adding a Q_CLASSINFO "dependsOn" or "optionallyDependsOn" to the class definition.
. More...
 
template<class T >
static void addComponent ()
 Adds a component to the Helper. The StartupHelper will call init() and deinit() on the component class.
Every class with at least a static void init() or void deinit() function can be specified.
Dependencies can be marked by adding a Q_CLASSINFO "dependsOn" or "optionallyDependsOn" to the class definition. (see addSingleton() ).
The components must use the Q_GADET or Q_OBJECT macro.
You must either call this function before running QCoreApplication::exec() or use STARTUP_ADD_COMPONENT().
 
static void ensureCoreGetsLinked ()
 This function does nothing. But you can call it if you want to make sure that this translation unit is not optimized out by the linker.
 

Detailed Description

The StartupHelper class manages dependencies between global singletons and other components. It ensures that the singletons/components are constructed/deleted in the right order.

Member Function Documentation

◆ addSingleton()

template<class T >
static void StartupHelper::addSingleton ( )
inlinestatic

Adds a Singleton to the Helper. The Singleton will be constructed after it's dependencies.
Dependencies can be marked by adding a Q_CLASSINFO "dependsOn" or "optionallyDependsOn" to the class definition.
.

Q_CLASSINFO("dependsOn","Livedoc")
Q_CLASSINFO("optionallyDependsOn","TType")

Singleton must use the Q_GADGET or Q_OBJECT macro and derive from AbstractSingleton.
You must either call this function before running QCoreApplication::exec() or use STARTUP_ADD_SINGLETON().


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