![]() |
Carousel
|
The ComponentManager holds information about the components that can be used by the application. More...
#include <ComponentManager.h>
Inherits IComponentManager.
Protected Slots | |
virtual bool | enableAndStartComponent (IComponent *component) |
virtual void | forceShutdownCheckedComponent (IComponent *component) |
virtual void | onAboutToShutDown () |
virtual void | onComponentAboutToShutDown (IComponent *component) |
virtual void | onComponentShutDown (IComponent *component) |
virtual void | onComponentStarted (IComponent *component) |
virtual void | onStartedUp () |
virtual void | shutdownCheckedComponent (IComponent *component) |
virtual bool | startCheckedComponent (IComponent *component) |
Additional Inherited Members | |
![]() | |
void | aboutToShutDown () |
void | componentAboutToShutDown (IComponent *component) |
void | componentShutDown (IComponent *component) |
void | componentStarted (IComponent *component) |
void | startedUp () |
![]() | |
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) |
![]() | |
QList< IComponent * > | orphanComponents |
QList< IComponent * > | startedComponents |
QList< IComponent * > | stoppedComponents |
![]() | |
objectName | |
The ComponentManager holds information about the components that can be used by the application.
Each component (described in a IComponent and ComponentDefinition classes, stores the name, description and availability of the component) that was statically registered or dynamically discovered by providers will be added to the ComponentManager after boot loading sequence in CarouselBootloader::configureComponentManager() method. Components also can be added and started during run-time.
Then, after checking and resolving dependencies, all enabled components will be started with IServiceLocator reference as initialziation data. It enables components to get access to shared servces of your application.
Also manager uses IComponentDependencies for components sorting and finding components dependencies.
|
explicit |
Creates an instance of the ComponentManager class with default ComponentInitialiser and ComponentDependencies instances.
|
explicit |
Creates an instance of the ComponentManager class with specified dependencies and default ComponentInitialiser instance.
|
virtual |
Adds a new component. Component with same name should not already exists in the manager.
A newly is appended to the stoppedComponents() list and to the dependencies(). This method sets isChecked() to false.
component | If manager already has component with same name as component - the last one will not be added to the manager. The same for the null pointer - it will be ignored. |
Returns true if component was succesfully added. If it is a null point or already existed one - returns false. Note, that ComponentManager does not take ownership for component, which was not successfully added.
Implements IComponentManager.
|
virtual |
Uses DependencySolver for checking of added components according to their dependencies.
Returns a dependencies solving result, that contains a list of distinct components and a list of components, those dependencies were not found.
It caches resulting value for prefomance, but addComponent() is resets it.
Implements IComponentManager.
|
virtual |
Returns a list of all added components. It is a shortcut to the IComponentDependencies::components().
Implements IComponentManager.
|
virtual |
Returns a component dependencies.
Implements IComponentManager.
|
virtual |
Uses DependencySolver for checking of added components according to their dependencies.
Returns a dependencies solving result, that contains a list of distinct components and a list of components, those dependencies were not found.
Implements IComponentManager.
|
virtual |
Gets an initialization data that will be passed to the started components.
Implements IComponentManager.
|
virtual |
Returns a list of missing parent names those children were added to the manager.
This list is populated after check() or startup/shutdown components and resets after the addComponent() call.
Implements IComponentManager.
|
virtual |
Returns a list of components those parents were not added to the manager while components were started.
This list is populated after check() or startup/shutdown components and resets after the addComponent() call.
Implements IComponentManager.
|
virtual |
Returns a list of already stopped or non-started yet components.
Implements IComponentManager.
|
virtual |
Returns a list of started components.
Implements IComponentManager.
|
virtual |
Shuts down all the components. Call this method when your application is going to quit
Implements IComponentManager.
|
virtual |
Shuts down the specified component and all its implicit children, obtained by IComponentDependencies::completeListWithParent() in such order, that children will be shut down first.
Shut component is moved from the startedComponents() to the stoppedComponents() list.
Ignores null pointer or unexisting component.
Returns a DependenciesSolvingResult with components that were realy shut down. Components that already were shut down will not appear to the result list.
Implements IComponentManager.
|
virtual |
This method is added for convinient. It is a shortkey to the shutdownComponents(components()).
Returns a DependenciesSolvingResult with components that were realy shut down. Components that already were shut down will not appear to the result list.
Implements IComponentManager.
|
virtual |
Shuts down specified components in such order, that children will be shut down before their parents.
Shut components are moved from the startedComponents() to the stoppedComponents() list.
Returns a DependenciesSolvingResult with components that were realy shut down. Components that already were shut down will not appear to the result list.
Implements IComponentManager.
|
virtual |
Begins working and starts components which were added on the start of application. Starts only enabled components.
Components with disabled parent components will not be started.
Initialization data will be passed to the started components (if any).
Implements IComponentManager.
|
virtual |
Implicitly calls check() and starts (if resolving) up the specified components and all its parents, obtained by IComponentDependencies::completeListWithChild() in such order, that parents will be started first. All started components became enabled.
Components will not start if parent component could not start.
Initialization data will be passed to the started components (if any). Returns a dependencies solving result, that contains a list of distinct components and a list of components, those dependencies were not found.
All started components will be moved from the stoppedComponents() to the startedComponents() list.
Returns a DependenciesSolvingResult with components that were realy started. Components that already were started will not appear to the result list.
Implements IComponentManager.
|
virtual |
This method is added for convinient. It is a shortkey to the startupComponents(components()).
Initialization data will be passed to the started components (if any).
Returns a DependenciesSolvingResult with components that were realy started. Components that already were started will not appear to the result list.
Implements IComponentManager.
|
virtual |
Implicitly calls check() and starts (if resolving) up the specified components and all its parents, obtained by IComponentDependencies::completeListWithChild() in such order, that parents will be started first. All started components became enabled.
Components will not start if parent component could not start.
Initialization data will be passed to the started components (if any). Returns a dependencies solving result, that contains a list of distinct components and a list of components, those dependencies were not found.
Components, those parents were not added to manager, will be appended to the orphanComponents() list and names of their missing parents will be appended to the missingComponents() list. All started components will be moved from the stoppedComponents() to the startedComponents() list.
Returns a DependenciesSolvingResult with components that were realy started. Components that already were started will not appear to the result list.
Implements IComponentManager.
|
protectedvirtualslot |
This method is invoked after manager started up.
|
protectedvirtualslot |
This method is invoked before manager will be shut down.
|
protectedvirtualslot |
This method is invoked when component is started up by the ComponentManager. It emits componentStarted() signal and moves component from the stopped to started list.
|
protectedvirtualslot |
This method is invoked before component will be shut down by the ComponentManager. It emits componentAboutToShutDown().
|
protectedvirtualslot |
This method is invoked when component is shut down by the ComponentManager. It emits componentShutDown() signal and moves component from the started to stopped list.
|
protectedvirtualslot |
Starts specified component if it is possible (if component is enabled) and passes the initialization data to it.
Note, that components should have descending order, e.g. parents should stay before children, because parents should start first.
|
protectedvirtualslot |
Sets IComponent::Enabled availability to the specified component and tries to start up that component.
|
protectedvirtualslot |
Shuts down specified component. Built in components are ignored.
Note, that components should have descending order, e.g. parents should stay before children, because children should shut down first.
|
protectedvirtualslot |
Shuts down specified component regardless whether it is built in or not.
Note, that components should have descending order, e.g. parents should stay before children, because children should shut down first.