![]() |
Carousel
|
The abstract IBootloader class provides a basic bootstrapping sequence and hooks that specific implementations can override. More...
#include <IBootloader.h>
Inherits QObject.
Inherited by BootloaderBase.
Public Member Functions | |
virtual void | run ()=0 |
virtual IServiceLocator * | serviceLocator () const =0 |
![]() | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const QObject *receiver, const char *method) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () const |
Additional Inherited Members | |
![]() | |
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
![]() | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
![]() | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
![]() | |
objectName | |
The abstract IBootloader class provides a basic bootstrapping sequence and hooks that specific implementations can override.
The bootloader instance is one of the first instances who starts Carousel mechanism. Mainly, is starts a registration phase.
It creates and registers an IServiceLocator itself and common services, like LoggerFacade, IComponentManager and, optionally, QMainWindow for the GUI applications. QMainWindow is just a shell or frame for the application, it is absolutely empty, but then new components could populate it with menus, toolbars, dock widgets and the central widget.
Usually an IBootloader is implemented (in BootloaderBase or in more specific CarouselBootloader class) as a sequence of pairs create<smth>() - configure<smth>() methods, and each of them could be overridden to replace default instantiation or default configuration. For example, to use your own logger system it is just needed to override BootloaderBase::createLoggerEngine() method.
After bootloading process the configured IServiceLocator is available through serviceLocator() method. Later it will be injected to the all components and other elements during configuration phase, when they will start or initialize. It is needed to register/locate to common services and your components' services.
To start new application you also should to override BootloaderBase::createComponentProvider() or BootloaderBase::configureComponentProvider() method to determine way in which your application will be populated by the components. For example, here is a component provider which will load components from the "./components" directory at the start-time and which also has four built-in components, configured statically at the compile-time:
Then just pass bootloader to the application:
|
pure virtual |
Runs the bootloading process.
Implemented in BootloaderBase.
|
pure virtual |
Gets the service locator, which should contains base objects after bootloading.
Implemented in BootloaderBase.