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

The IComponentDependencies interface provides methods to get all dependencies between the components. More...

#include <IComponentDependencies.h>

Inherited by ComponentDependencies.

Public Member Functions

virtual bool addComponent (IComponent *component)=0
 
virtual DependenciesSolvingResult completeListWithChild (IComponent *forChild) const =0
 
virtual DependenciesSolvingResult completeListWithChildren (const QList< IComponent * > &forChildren) const =0
 
virtual DependenciesSolvingResult completeListWithParent (IComponent *forParent) const =0
 
virtual DependenciesSolvingResult completeListWithParents (const QList< IComponent * > &forParents) const =0
 
virtual IComponentcomponentByName (const QString &byName) const =0
 
virtual const ObservableList
< IComponent * > & 
components () const =0
 
virtual DependenciesSolvingResult getChildComponents (const IComponent *forParent) const =0
 
virtual QList< IComponent * > getParentDefinitions (const IComponent *forChild) const =0
 
virtual DependenciesSolvingResult orderedComponents () const =0
 

Detailed Description

The IComponentDependencies interface provides methods to get all dependencies between the components.

Each component (described in a IComponent and IComponentDescriptionExtension classes, stores the name, description and availability of the component) that statically registered or dynamically discovered by providers will be added to the IComponentDependencies through IComponentManager after boot loading sequence in CarouselBootloader::configureComponentManager() method.

Then you can get any dependnecies between the components using specified methods.

Note
it does not take ownership for added components.

Member Function Documentation

virtual bool IComponentDependencies::addComponent ( IComponent component)
pure virtual

Adds a new component. Component with same name should not already exists in.

Parameters
componentIf IComponentDependencies already has component with same name as component
  • the last one will not be added. 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.

Implemented in ComponentDependencies.

virtual DependenciesSolvingResult IComponentDependencies::completeListWithChild ( IComponent forChild) const
pure virtual

Returns a dependencies solving result, that contains a list of distinct components and a list of components, those dependencies were not found. The component list will contains all immediate and extended parents for specified child component.

The components are ordered in such way, that parents are firsts and child is last. E.g. if you have following graph

* E
* v
* A <- B <- C <- D
*

and you call completeListWithChild() for the C component, the A, B and C components will be returned in that order.

Note
Incompatible components will not be added to the DependenciesSolvingResult::ordered() list.
Parameters
forChildThe component to get the dependencies (or parents) for.

Implemented in ComponentDependencies.

virtual DependenciesSolvingResult IComponentDependencies::completeListWithChildren ( const QList< IComponent * > &  forChildren) const
pure virtual

Returns a dependencies solving result, that contains a list of distinct components and a list of components, those dependencies were not found. The component list will contains all immediate and extended parents for specified children components.

The components are ordered in such way, that parents are firsts and children are last.

Note
Incompatible components will not be added to the DependenciesSolvingResult::ordered() list.
Parameters
forChildrenThe components to get the dependencies (or parents) for.

Implemented in ComponentDependencies.

virtual DependenciesSolvingResult IComponentDependencies::completeListWithParent ( IComponent forParent) const
pure virtual

Returns a dependencies solving result, that contains a list of distinct components and a list of components, those dependencies were not found. The component list will contains all immediate and extended children for specified parent component.

The components are ordered in such way, that children are firsts and parent is last. E.g. if you have following graph

* E
* v
* A <- B <- C <- D
*

and you call completeListWithParent() for the C component, the E, D and C components will be returned in such order, where indexOf(E) < indexOf(C) and indexOf(D) < indexOf(C).

Parameters
forParentThe component to get the components that depend on it (or its implicit children).

Implemented in ComponentDependencies.

virtual DependenciesSolvingResult IComponentDependencies::completeListWithParents ( const QList< IComponent * > &  forParents) const
pure virtual

Returns a dependencies solving result, that contains a list of distinct components and a list of components, those dependencies were not found. The component list will contains all immediate and extended children for specified parents components.

The components are ordered in such way, that children are firsts and parents are last. E.g. if you have following graph

* E
* v
* A <- B <- C <- D
*

and you call completeListWithParents() for the C component, the E, D and C components will be returned in such order, where indexOf(E) < indexOf(C) and indexOf(D) < indexOf(C).

Parameters
forParentsThe components to get the other components that depend on they (or their implicit children).

Implemented in ComponentDependencies.

virtual IComponent* IComponentDependencies::componentByName ( const QString byName) const
pure virtual

Finds the component by its name. Null pointer, if list is empty, or if component with specified name was not added.

Implemented in ComponentDependencies.

virtual const ObservableList<IComponent *>& IComponentDependencies::components ( ) const
pure virtual

Returns a list of added components.

Implemented in ComponentDependencies.

virtual QList<IComponent *> IComponentDependencies::getParentDefinitions ( const IComponent forChild) const
pure virtual

Returns a list of all parents (direct and indirect) for the specified child component.

* A <- B <- C <- E
* D <──┘
*

then, getParentDefinitions(E) will return {A, B, C, D} components.

Parameters
forChildThe component to get the dependencies (or parents) for. If forChild is null - result with empty collections will be returned.

Implemented in ComponentDependencies.

virtual DependenciesSolvingResult IComponentDependencies::getChildComponents ( const IComponent forParent) const
pure virtual

Returns a dependencies solving result for cpecified parent, that contains a list of distinct components and a list of components, those dependencies were not found. E.g. if we have components

* A <- B <- C <- E
* ^
* └─── D
*

then, getChildComponents(C) will return {E, D} components.

Parameters
forParentThe component to get the other components that depend on it (or its implicit children). If forParent is null or component with such name does not exists - result with empty collections will be returned.

Implemented in ComponentDependencies.

virtual DependenciesSolvingResult IComponentDependencies::orderedComponents ( ) const
pure virtual

Returns a dependencies solving result for all components, that contains a list of distinct components and a list of components, those dependencies were not found. The component list will contains all immediate and extended parents for specified children components.

The components are ordered in such way, that parents are firsts and children are lasts.

It is a shortkey for the

Implemented in ComponentDependencies.