Carousel
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
BootloaderBase Class Referenceabstract

The abstract BootloaderBase class provides a basic bootstrapping sequence and hooks that specific implementations can override. More...

#include <BootloaderBase.h>

Inherits IBootloader.

Inherited by CarouselBootloader.

Public Member Functions

void run ()
 
IServiceLocatorserviceLocator () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
bool blockSignals (bool block)
 
QObjectchild (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< QByteArraydynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) 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 QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObjectparent () 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)
 
QThreadthread () const
 

Protected Member Functions

 BootloaderBase ()
 
virtual void configureComponentManager ()
 
virtual void configureComponentProvider ()
 
virtual void configureServiceLocator ()=0
 
virtual IComponentManagercreateComponentManager ()
 
virtual IComponentProvidercreateComponentProvider ()
 
virtual LoggerFacadecreateLoggerEngine ()
 
virtual QMainWindowcreateMainWindow ()
 
virtual IServiceLocatorcreateServiceLocator ()
 
virtual void initialiseComponentProvider ()
 
virtual void safeRun ()=0
 
- Protected Member Functions inherited from QObject
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
 
QObjectsender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 

Protected Attributes

IComponentManagerm_componentManager
 
IComponentProviderm_componentProvider
 
LoggerFacadem_logger
 
QMainWindowm_mainWindow
 
IServiceLocatorm_serviceLocator
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
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)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

The abstract BootloaderBase class provides a basic bootstrapping sequence and hooks that specific implementations can override.

This class must be overridden to provide application specific boot loading sequence. It is just a template of the carousel's booting steps, so it contains empty realizations of all configure<> methods and instantiates default objects for the all create<> methods. You can derived from this class if you want determine your own bootloading sequence, but it is recomended to derived from the CarouselBootloader class and override create<> and configure<> methods and keep bootloading sequence.

See Also
IBootloader

Constructor & Destructor Documentation

BootloaderBase::BootloaderBase ( )
protected

Initializes a new instance of the BootloaderBase class.

When derive from this class you should override at least safeRun() method, in which loading sequence will be performed, and configureServiceLocator() method to register common services in the locator.

Member Function Documentation

void BootloaderBase::run ( )
virtual

Runs the bootloading process.

Implements IBootloader.

IServiceLocator* BootloaderBase::serviceLocator ( ) const
virtual

Gets the service locator, which should contains base objects after bootloading.

Implements IBootloader.

virtual void BootloaderBase::configureComponentManager ( )
protectedvirtual

Does nothing by default. When overridden in derived classes should add all components registered in provider to the component manager.

Reimplemented in CarouselBootloader.

virtual void BootloaderBase::configureComponentProvider ( )
protectedvirtual

Does nothing by default. You should override this method in the your specified bootloader to register new components, or setup components' discovering path (if you use DirectoryComponentProvider).

virtual void BootloaderBase::configureServiceLocator ( )
protectedpure virtual

When overridden in derived classes registers all common services such as IComponentManager, IComponentProvider and other in the locator.

Implemented in CarouselBootloader.

virtual IComponentManager* BootloaderBase::createComponentManager ( )
protectedvirtual

Creates default component manager using IComponentManager class and takes ownership.

virtual IComponentProvider* BootloaderBase::createComponentProvider ( )
protectedvirtual

Creates default provider using ComponentProvider class and takes ownership.

virtual LoggerFacade* BootloaderBase::createLoggerEngine ( )
protectedvirtual

Creates default logger using TextLogger class with stdout output and takes ownership of this logger. Should be overridden in the derived classes to instantiate your own logger facade over the better logging system (e.g. log4cplus).

virtual IServiceLocator* BootloaderBase::createServiceLocator ( )
protectedvirtual

Creates default service locator using ServiceLocator class and takes ownership.

virtual QMainWindow* BootloaderBase::createMainWindow ( )
protectedvirtual

Creates default main window class and takes ownership.

virtual void BootloaderBase::initialiseComponentProvider ( )
protectedvirtual

Does nothing by default. When overridden in derived classes should call IComponentProvider::initialize() method for the created component provider.

Reimplemented in CarouselBootloader.

virtual void BootloaderBase::safeRun ( )
protectedpure virtual

It is a safe part of the public run() method, that guaranted it would be called in derived class only once per instance.

Implemented in CarouselBootloader.

Member Data Documentation

IComponentManager* BootloaderBase::m_componentManager
protected

Component manager for the application.

IComponentProvider* BootloaderBase::m_componentProvider
protected

Component provider for the application.

LoggerFacade* BootloaderBase::m_logger
protected

Logger facade used by the bootloader.

IServiceLocator* BootloaderBase::m_serviceLocator
protected

Service locator for the application.

QMainWindow* BootloaderBase::m_mainWindow
protected

Main window (shell) for the application.